Browse Source

Improve RDoc scraper

Thibaut 11 years ago
parent
commit
f16eb371bf

+ 1 - 1
lib/docs/filters/rdoc/clean_html.rb

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

+ 1 - 1
lib/docs/filters/rdoc/container.rb

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

+ 2 - 2
lib/docs/scrapers/rdoc/rdoc.rb

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