History

Update D3.js documentation (3.4.8)

Thibaut committed 12 years ago

Commit b8fbbdd1 parent 7ce9acc3 files · +10 −9Browse files

Showing the changes to lib/docs (3 of 3 files). Show all

Unified · Split

3 files
  1. lib/docs/filters/d3/clean_html.rb +7 −7
  2. lib/docs/filters/d3/entries.rb +2 −1
  3. lib/docs/scrapers/d3.rb +1 −1
lib/docs/filters/d3/clean_html.rb+7−7
@@ -4,15 +4,15 @@ module Docs · 3 unmodified lines
44 def call
55 # Remove links inside <h2> and add "id" attributes
66 css('h2 > a').each do |node|
7− node.parent['id'] = node['name'].remove('wiki-') if node['name']
7+ node.parent['id'] = node['name'].remove('user-content-') if node['name']
88 node.before(node.children).remove
99 end
1010
11− css('#gollum-footer', '.markdown-body > blockquote:first-child', '.anchor').remove
11+ css('.markdown-body > blockquote:first-child', '.anchor').remove
1212
13− # Replace #head with <h1>
14− css('#head > h1').each do |node|
15− node.parent.before(node).remove
13+ # Replace .gh-header with <h1>
14+ css('.gh-header-title').each do |node|
15+ node.parent.parent.before(node).remove
1616 node.content = 'D3.js' if root_page?
1717 end
1818
@@ -26,14 +26,14 @@ module Docs · 7 unmodified lines
2626 next unless node['name'] || node.content == '#'
2727 parent = node.parent
2828 parent.name = 'h6'
29− parent['id'] = (node['name'] || node['href'].remove(/\A.+#/)).remove('wiki-')
29+ parent['id'] = (node['name'] || node['href'].remove(/\A.+#/)).remove('user-content-')
3030 parent.css('a[name]').remove
3131 node.remove
3232 end
3333
3434 # Fix internal links
3535 css('a[href]').each do |node|
36− node['href'] = node['href'].sub(/#wiki\-(\w+?)\z/, '#\1')
36+ node['href'] = node['href'].sub(/#user\-content\-(\w+?)\z/, '#\1').sub(/#wiki\-(\w+?)\z/, '#\1')
3737 end
3838
3939 # Remove code highlighting
lib/docs/filters/d3/entries.rb+2−1
@@ -11,8 +11,9 @@ module Docs · 10 unmodified lines
1111
1212 def additional_entries
1313 css('h6[id]').inject [] do |entries, node|
14− name = node.content
14+ name = node.content.strip
1515 name.remove! %r{\(.*\z}
16+ name.sub! %r{\A(svg:\w+)\s+.+}, '\1'
1617 entries << [name, node['id']] unless name == entries.last.try(:first)
1718 entries
1819 end
lib/docs/scrapers/d3.rb+1−1
@@ -3,7 +3,7 @@ module Docs · 2 unmodified lines
33 self.name = 'D3.js'
44 self.slug = 'd3'
55 self.type = 'd3'
6− self.version = '3.4.6'
6+ self.version = '3.4.8'
77 self.base_url = 'https://github.com/mbostock/d3/wiki/'
88 self.root_path = 'API-Reference'
99