Skip to content

Commit 86d23b7

Browse files
committed
Update D3.js documentation (6.5.0)
1 parent 4280393 commit 86d23b7

4 files changed

Lines changed: 26 additions & 2 deletions

File tree

assets/javascripts/templates/pages/about_tmpl.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ credits = [
223223
'https://raw.githubusercontent.com/dlang/phobos/master/LICENSE_1_0.txt'
224224
], [
225225
'D3.js',
226-
'2010-2018 Michael Bostock',
226+
'2010-2020 Michael Bostock',
227227
'BSD',
228228
'https://raw.githubusercontent.com/d3/d3/master/LICENSE'
229229
], [

lib/docs/filters/d3/clean_html.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def call
3131
node.content = 'Source'
3232
node['class'] = 'source'
3333
end
34+
css('h6 a:contains("Source"), h6 a:contains("Examples")').each do |node|
35+
node['class'] = 'source'
36+
end
3437

3538
# Fix internal links
3639
css('a[href]').each do |node|

lib/docs/filters/d3/entries_v4.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ def get_type
1818
def additional_entries
1919
css('h6[id]').each_with_object [] do |node, entries|
2020
name = node.content.strip
21+
name.remove! 'Source, Examples'
2122
name.remove! 'Source'
23+
name.remove! 'Examples'
2224
name.remove! '<>'
25+
name.remove! ' · '
26+
name.remove! '0,' # from d3.quickselect
27+
name.remove! '=' # from d3.quickselect
2328
name.remove! %r{\s\-.*}
2429
name.remove! %r{\s*\[.*\]}
2530
name.gsub! %r{\(.+?\)\)?}, '()'

lib/docs/scrapers/d3.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,26 @@ class D3 < UrlScraper
1212
options[:container] = '.markdown-body'
1313

1414
options[:attribution] = <<-HTML
15-
&copy; 2010&ndash;2018 Michael Bostock<br>
15+
&copy; 2010&ndash;2020 Michael Bostock<br>
1616
Licensed under the BSD License.
1717
HTML
1818

19+
version '6' do
20+
self.release = '6.5.0'
21+
self.base_url = 'https://github.com/d3/'
22+
self.root_path = 'd3/blob/master/API.md'
23+
24+
html_filters.push 'd3/clean_html', 'd3/entries_v4'
25+
26+
options[:only_patterns] = [/\Ad3[\-\w]+\z/, /\Ad3\/blob\/master\/changes\.md\z/i]
27+
options[:skip_patterns] = [/3\.x-api-reference/]
28+
29+
options[:fix_urls] = ->(url) do
30+
url.sub! %r{/blob/master/readme.md}i, ''
31+
url
32+
end
33+
end
34+
1935
version '5' do
2036
self.release = '5.7.0'
2137
self.base_url = 'https://github.com/d3/'

0 commit comments

Comments
 (0)