Improve RDoc scraper

pull/69/head
Thibaut 11 years ago
parent d74678b4eb
commit f16eb371bf

@ -7,7 +7,7 @@ module Docs
end end
def root def root
at_css('h3').remove css('#methods + ul', 'h1', 'h2', 'li > ul').remove
# Remove skipped items # Remove skipped items
css('li > span').each do |node| css('li > span').each do |node|

@ -3,7 +3,7 @@ module Docs
class ContainerFilter < Filter class ContainerFilter < Filter
def call def call
if root_page? if root_page?
at_css '#classindex-section' at_css 'main'
else else
container = at_css 'main' container = at_css 'main'

@ -2,12 +2,12 @@ module Docs
class Rdoc < FileScraper class Rdoc < FileScraper
self.abstract = true self.abstract = true
self.type = 'rdoc' self.type = 'rdoc'
self.root_path = 'index.html' self.root_path = 'table_of_contents.html'
html_filters.replace 'container', 'rdoc/container' html_filters.replace 'container', 'rdoc/container'
html_filters.push 'rdoc/entries', 'rdoc/clean_html', 'title' html_filters.push 'rdoc/entries', 'rdoc/clean_html', 'title'
options[:title] = false options[:title] = false
options[:skip] = %w(table_of_contents.html) options[:skip] = %w(index.html)
end end
end end

Loading…
Cancel
Save