History

Update D3.js documentation (3.4.4)

Thibaut committed 12 years ago

Commit ccf60ac1 parent 91138402 files · +7 −16Browse files

Unified · Split

2 files
  1. lib/docs/filters/d3/clean_html.rb +6 −15
  2. lib/docs/scrapers/d3.rb +1 −1
lib/docs/filters/d3/clean_html.rb+6−15
@@ -2,6 +2,12 @@ module Docs · 1 unmodified line
2 class D32 class D3
3 class CleanHtmlFilter < Filter3 class CleanHtmlFilter < Filter
4 def call4 def call
5 # Remove links inside <h2> and add "id" attributes
6 css('h2 > a').each do |node|
7 node.parent['id'] = node['name'].sub('wiki-', '') if node['name']
8 node.before(node.children).remove
9 end
10
5 css('#gollum-footer', '.markdown-body > blockquote:first-child', '.anchor').remove11 css('#gollum-footer', '.markdown-body > blockquote:first-child', '.anchor').remove
6 12
7 # Replace #head with <h1>13 # Replace #head with <h1>
@@ -15,21 +21,6 @@ module Docs · 7 unmodified lines
15 node.before(node.at_css('.markdown-body').children).remove21 node.before(node.at_css('.markdown-body').children).remove
16 end22 end
17 23
18 # Remove links inside <h2>
19 css('h2 > a').each do |node|
20 node.before(node.children).remove
21 end
22
23 # Make headings for function definitions and add "id" attributes
24 css('p > a:first-child').each do |node|
25 next unless node['name'] || node.content == '#'
26 parent = node.parent
27 parent.name = 'h6'
28 parent['id'] = (node['name'] || node['href'].sub(/\A.+#/, '')).sub('wiki-', '')
29 parent.css('a[name]').remove
30 node.remove
31 end
32
33 # Make headings for function definitions and add "id" attributes24 # Make headings for function definitions and add "id" attributes
34 css('p > a:first-child').each do |node|25 css('p > a:first-child').each do |node|
35 next unless node['name'] || node.content == '#'26 next unless node['name'] || node.content == '#'
lib/docs/scrapers/d3.rb+1−1
@@ -3,7 +3,7 @@ module Docs · 2 unmodified lines
3 self.name = 'D3.js'3 self.name = 'D3.js'
4 self.slug = 'd3'4 self.slug = 'd3'
5 self.type = 'd3'5 self.type = 'd3'
6 self.version = '3.4.3'6 self.version = '3.4.4'
7 self.base_url = 'https://github.com/mbostock/d3/wiki/'7 self.base_url = 'https://github.com/mbostock/d3/wiki/'
8 self.root_path = 'API-Reference'8 self.root_path = 'API-Reference'
9 9

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t