Update D3.js documentation (3.4.4)

pull/76/head
Thibaut 11 years ago
parent 911384079c
commit ccf60ac128

@ -2,6 +2,12 @@ module Docs
class D3 class D3
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
# Remove links inside <h2> and add "id" attributes
css('h2 > a').each do |node|
node.parent['id'] = node['name'].sub('wiki-', '') if node['name']
node.before(node.children).remove
end
css('#gollum-footer', '.markdown-body > blockquote:first-child', '.anchor').remove css('#gollum-footer', '.markdown-body > blockquote:first-child', '.anchor').remove
# Replace #head with <h1> # Replace #head with <h1>
@ -15,21 +21,6 @@ module Docs
node.before(node.at_css('.markdown-body').children).remove node.before(node.at_css('.markdown-body').children).remove
end end
# Remove links inside <h2>
css('h2 > a').each do |node|
node.before(node.children).remove
end
# Make headings for function definitions and add "id" attributes
css('p > a:first-child').each do |node|
next unless node['name'] || node.content == '#'
parent = node.parent
parent.name = 'h6'
parent['id'] = (node['name'] || node['href'].sub(/\A.+#/, '')).sub('wiki-', '')
parent.css('a[name]').remove
node.remove
end
# Make headings for function definitions and add "id" attributes # Make headings for function definitions and add "id" attributes
css('p > a:first-child').each do |node| css('p > a:first-child').each do |node|
next unless node['name'] || node.content == '#' next unless node['name'] || node.content == '#'

@ -3,7 +3,7 @@ module Docs
self.name = 'D3.js' self.name = 'D3.js'
self.slug = 'd3' self.slug = 'd3'
self.type = 'd3' self.type = 'd3'
self.version = '3.4.3' self.version = '3.4.4'
self.base_url = 'https://github.com/mbostock/d3/wiki/' self.base_url = 'https://github.com/mbostock/d3/wiki/'
self.root_path = 'API-Reference' self.root_path = 'API-Reference'

Loading…
Cancel
Save