Update RDoc scraper

pull/33/head
Thibaut 11 years ago
parent 7b97af3bdb
commit a9737743cb

@ -1,7 +1,7 @@
._rdoc {
> .description, > .documentation-section { padding-left: 1rem; }
> .description > h2, .section-header { @extend %block-heading; }
> .description > h2, .section-header, .method-heading { margin-left: -1rem; }
> .description > h2, header > h3 { @extend %block-heading; }
> .description > h2, header > h3, .method-heading { margin-left: -1rem; }
.description > h1 { font-size: 1rem; }
.method-description > h2, h3, h4, h5, h6 { font-size: 1em; }

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

@ -5,17 +5,20 @@ module Docs
if root_page?
at_css '#classindex-section'
else
container = at_css '#documentation'
container = at_css 'main'
# Add <dl> mentioning parent class and included modules
meta = Nokogiri::XML::Node.new 'dl', doc
meta['class'] = 'meta'
if parent = at_css('#parent-class-section')
meta << %(<dt>Parent:</dt><dd class="meta-parent">#{parent.at_css('.link').inner_html.strip}</dd>)
end
if includes = at_css('#includes-section')
meta << %(<dt>Included modules:</dt><dd class="meta-includes">#{includes.css('a').map(&:to_html).join(', ')}</dd>)
end
container.at_css('h1').after(meta)
container

@ -20,7 +20,7 @@ module Docs
end
def include_default_entry?
at_css('#description p') || css('.documentation-section').any? { |node| node.content.present? }
at_css('> .description p') || css('.documentation-section').any? { |node| node.content.present? }
end
def additional_entries

Loading…
Cancel
Save