Improve Ruby/RDoc scraper

pull/15/head
Thibaut 11 years ago
parent 706270d89c
commit 1eed7c7778

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

@ -19,7 +19,7 @@ module Docs
css('hr').remove
# Remove paragraph/up links
css('h1 > span', 'h2 > span', 'h3 > span', 'h4 > span').remove
css('h1 > span', 'h2 > span', 'h3 > span', 'h4 > span', 'h5 > span', 'h6 > span').remove
# Move id attributes to headings
css('.method-detail').each do |node|

@ -19,6 +19,10 @@ module Docs
type
end
def include_default_entry?
at_css('#description p') || css('.documentation-section').any? { |node| node.content.present? }
end
def additional_entries
return [] if root_page?
require 'cgi'
@ -29,9 +33,12 @@ module Docs
name.sub! %r{\A-(?!\d)}, ''
name.gsub! '-', '%'
name = CGI.unescape(name)
name.prepend self.name + (node['id'] =~ /\A\w+-c-/ ? '::' : '#')
entries << [name, node['id']] unless entries.any? { |entry| entry[0] == name }
unless name.start_with? '_'
name.prepend self.name + (node['id'] =~ /\A\w+-c-/ ? '::' : '#')
entries << [name, node['id']] unless entries.any? { |entry| entry[0] == name }
end
entries
end
end

@ -29,15 +29,12 @@ module Docs
options[:skip] += %w(
fatal.html
unknown.html
CompositePublisher.html
Data.html
E2MM.html
English.html
Exception2MessageMapper.html
EXCEPTION_TYPE.html
GServer.html
Logging.html
MakeMakefile.html
ParallelEach.html
Requirement.html

Loading…
Cancel
Save