History

Improve RDoc scraper

Thibaut committed 12 years ago

Commit f16eb371 parent d74678b3 files · +4 −4Browse files

Unified · Split

3 files
  1. lib/docs/filters/rdoc/clean_html.rb +1 −1
  2. lib/docs/filters/rdoc/container.rb +1 −1
  3. lib/docs/scrapers/rdoc/rdoc.rb +2 −2
lib/docs/filters/rdoc/clean_html.rb+1−1
@@ -7,7 +7,7 @@ module Docs · 6 unmodified lines
7 end7 end
8 8
9 def root9 def root
10 at_css('h3').remove10 css('#methods + ul', 'h1', 'h2', 'li > ul').remove
11 11
12 # Remove skipped items12 # Remove skipped items
13 css('li > span').each do |node|13 css('li > span').each do |node|
lib/docs/filters/rdoc/container.rb+1−1
@@ -3,7 +3,7 @@ module Docs · 2 unmodified lines
3 class ContainerFilter < Filter3 class ContainerFilter < Filter
4 def call4 def call
5 if root_page?5 if root_page?
6 at_css '#classindex-section'6 at_css 'main'
7 else7 else
8 container = at_css 'main'8 container = at_css 'main'
9 9
lib/docs/scrapers/rdoc/rdoc.rb+2−2
@@ -2,12 +2,12 @@ module Docs · 1 unmodified line
2 class Rdoc < FileScraper2 class Rdoc < FileScraper
3 self.abstract = true3 self.abstract = true
4 self.type = 'rdoc'4 self.type = 'rdoc'
5 self.root_path = 'index.html'5 self.root_path = 'table_of_contents.html'
6 6
7 html_filters.replace 'container', 'rdoc/container'7 html_filters.replace 'container', 'rdoc/container'
8 html_filters.push 'rdoc/entries', 'rdoc/clean_html', 'title'8 html_filters.push 'rdoc/entries', 'rdoc/clean_html', 'title'
9 9
10 options[:title] = false10 options[:title] = false
11 options[:skip] = %w(table_of_contents.html)11 options[:skip] = %w(index.html)
12 end12 end
13end13end