Update D3.js documentation (3.4.8)

pull/110/head
Thibaut 11 years ago
parent 7ce9accb71
commit b8fbbdda49

@ -4,15 +4,15 @@ module Docs
def call
# Remove links inside <h2> and add "id" attributes
css('h2 > a').each do |node|
node.parent['id'] = node['name'].remove('wiki-') if node['name']
node.parent['id'] = node['name'].remove('user-content-') if node['name']
node.before(node.children).remove
end
css('#gollum-footer', '.markdown-body > blockquote:first-child', '.anchor').remove
css('.markdown-body > blockquote:first-child', '.anchor').remove
# Replace #head with <h1>
css('#head > h1').each do |node|
node.parent.before(node).remove
# Replace .gh-header with <h1>
css('.gh-header-title').each do |node|
node.parent.parent.before(node).remove
node.content = 'D3.js' if root_page?
end
@ -26,14 +26,14 @@ module Docs
next unless node['name'] || node.content == '#'
parent = node.parent
parent.name = 'h6'
parent['id'] = (node['name'] || node['href'].remove(/\A.+#/)).remove('wiki-')
parent['id'] = (node['name'] || node['href'].remove(/\A.+#/)).remove('user-content-')
parent.css('a[name]').remove
node.remove
end
# Fix internal links
css('a[href]').each do |node|
node['href'] = node['href'].sub(/#wiki\-(\w+?)\z/, '#\1')
node['href'] = node['href'].sub(/#user\-content\-(\w+?)\z/, '#\1').sub(/#wiki\-(\w+?)\z/, '#\1')
end
# Remove code highlighting

@ -11,8 +11,9 @@ module Docs
def additional_entries
css('h6[id]').inject [] do |entries, node|
name = node.content
name = node.content.strip
name.remove! %r{\(.*\z}
name.sub! %r{\A(svg:\w+)\s+.+}, '\1'
entries << [name, node['id']] unless name == entries.last.try(:first)
entries
end

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

Loading…
Cancel
Save