Add padrino support

pull/416/head
Matthias Guenther 9 years ago
parent ebd6a2204d
commit 79b5c06e1e
No known key found for this signature in database
GPG Key ID: 5287E11BD64C14E5

@ -0,0 +1,18 @@
module Docs
class Padrino
class CleanHtmlFilter < Filter
def call
title = at_css('#filecontents h1')
@doc = at_css('#content')
css('.highlight').each do |node|
node.name = 'pre'
node['data-lang'] = node.at_css('[data-lang]')['data-lang']
node.content = node.content
end
doc
end
end
end
end

@ -0,0 +1,17 @@
module Docs
class Padrino
class EntriesFilter < Docs::EntriesFilter
def get_name
node = at_css('h1')
result = node.content.strip
result << ' event' if type == 'Events'
result << '()' if node['class'].try(:include?, 'function')
result
end
def get_type
return 'Ruby'
end
end
end
end

@ -0,0 +1,20 @@
module Docs
class Padrino < UrlScraper
self.name = 'padrino'
self.slug = 'padrino'
self.type = 'ruby'
self.version = 'master'
self.base_url = 'http://www.rubydoc.info/github/padrino/padrino-framework'
self.links = {
home: 'http://padrinorb.com/',
code: 'https://github.com/padrino/padrino-framework'
}
html_filters.push 'padrino/clean_html', 'padrino/entries'
options[:attribution] = <<-HTML
&copy; Padrino contributors<br>
Licensed under the Creative Commons Attribution License.
HTML
end
end
Loading…
Cancel
Save