Improve abstract rdoc scraper

pull/165/head
Thibaut 10 years ago
parent ceff86bac4
commit b58bc8bc58

@ -1,6 +1,6 @@
._rdoc {
> .description, > .documentation-section { padding-left: 1rem; }
> .description > h2, header > h3 { @extend %block-heading; }
> .description > h2, header > h3, > h2 { @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; }

@ -19,7 +19,9 @@ module Docs
meta << %(<dt>Included modules:</dt><dd class="meta-includes">#{includes.css('a').map(&:to_html).join(', ')}</dd>)
end
container.at_css('h1').after(meta)
if parent || includes
container.at_css('h1').after(meta)
end
container
end

@ -2,7 +2,9 @@ module Docs
class Rdoc
class EntriesFilter < Docs::EntriesFilter
def get_name
name = at_css('h1').content.strip
name = at_css('h1, h2').content.strip
name.remove! "\u{00B6}" # remove pilcrow sign
name.remove! "\u{2191}" # remove up arrow sign
name.remove! 'class '
name.remove! 'module '
name

@ -57,7 +57,7 @@ module Docs
ActiveSupport/Testing/Isolation/Subprocess.html
Rails/API/Task.html)
options[:skip_patterns] = [
options[:skip_patterns] += [
/\AActionController\/Caching(?!\/Fragments|\.)/,
/\AActionController\/RequestForgeryProtection\/ProtectionMethods/,
/\AActionController\/Testing/,

@ -5,9 +5,14 @@ module Docs
self.root_path = 'table_of_contents.html'
html_filters.replace 'container', 'rdoc/container'
html_filters.push 'rdoc/entries', 'rdoc/clean_html', 'title'
html_filters.push 'title', 'rdoc/entries', 'rdoc/clean_html'
options[:title] = false
options[:skip] = %w(index.html)
options[:skip_patterns] = [
/changelog/i,
/readme/i,
/news/i,
/license/i]
end
end

Loading…
Cancel
Save