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
22 class D3
33 class CleanHtmlFilter < Filter
44 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+
511 css('#gollum-footer', '.markdown-body > blockquote:first-child', '.anchor').remove
612
713 # Replace #head with <h1>
@@ -15,21 +21,6 @@ module Docs · 7 unmodified lines
1521 node.before(node.at_css('.markdown-body').children).remove
1622 end
1723
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−
3324 # Make headings for function definitions and add "id" attributes
3425 css('p > a:first-child').each do |node|
3526 next unless node['name'] || node.content == '#'
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.3'
6+ self.version = '3.4.4'
77 self.base_url = 'https://github.com/mbostock/d3/wiki/'
88 self.root_path = 'API-Reference'
99

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