Skip to content

Commit 384ee20

Browse files
committed
Improve Dojo scraper
1 parent 150a4b6 commit 384ee20

6 files changed

Lines changed: 18 additions & 17 deletions

File tree

‎assets/javascripts/templates/pages/about_tmpl.coffee‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ credits = [
210210
'https://raw.githubusercontent.com/docker/docker/master/LICENSE'
211211
], [
212212
'Dojo',
213-
'2005-2015 The Dojo Foundation',
213+
'2005-2017 JS Foundation',
214214
'BSD + AFL',
215215
'http://dojotoolkit.org/license.html'
216216
], [

‎assets/javascripts/views/pages/javascript.coffee‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎assets/javascripts/views/pages/simple.coffee‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ app.views.CordovaPage =
2121
app.views.CrystalPage =
2222
app.views.D3Page =
2323
app.views.DockerPage =
24+
app.views.DojoPage =
2425
app.views.DrupalPage =
2526
app.views.ElectronPage =
2627
app.views.ElixirPage =
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
._dojo {
22
@extend %simple;
33

4-
.functionIcon, .parameters { @extend %code; }
54
.jsdoc-inheritance { color: $textColorLight; }
65
}

‎lib/docs/filters/dojo/clean_html.rb‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@ def call
3939
node.replace(node.content)
4040
end
4141

42+
css('.functionIcon', '.parameters').each do |node|
43+
node.name = 'code'
44+
node.content = node.content.strip
45+
end
46+
47+
css('pre').each do |node|
48+
node['data-language'] = node.content =~ /\A\s*</ ? 'markup' : 'javascript'
49+
end
50+
51+
css('.jsdoc-function-information', '.jsdoc-examples', '.jsdoc-example', 'span').each do |node|
52+
node.before(node.children).remove
53+
end
54+
55+
css('table', 'a', 'h2', 'h3', 'td', 'strong').remove_attr('class')
56+
4257
doc
4358
end
4459
end

‎lib/docs/scrapers/dojo.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Dojo < UrlScraper
2525
options[:skip_patterns] = [/dijit/, /dojox/]
2626

2727
options[:attribution] = <<-HTML
28-
&copy; 2005&ndash;2015 The Dojo Foundation<br>
28+
&copy; 2005&ndash;2017 JS Foundation<br>
2929
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
3030
HTML
3131

0 commit comments

Comments
 (0)