mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Improve Dojo scraper
This commit is contained in:
parent
150a4b6ab1
commit
384ee20b28
6 changed files with 18 additions and 17 deletions
|
@ -210,7 +210,7 @@ credits = [
|
|||
'https://raw.githubusercontent.com/docker/docker/master/LICENSE'
|
||||
], [
|
||||
'Dojo',
|
||||
'2005-2015 The Dojo Foundation',
|
||||
'2005-2017 JS Foundation',
|
||||
'BSD + AFL',
|
||||
'http://dojotoolkit.org/license.html'
|
||||
], [
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
#= require views/pages/base
|
||||
|
||||
class app.views.JavascriptWithMarkupCheckPage extends app.views.BasePage
|
||||
prepare: ->
|
||||
for el in @findAllByTag('pre')
|
||||
language = if el.textContent.match(/^\s*</)
|
||||
'markup'
|
||||
else
|
||||
'javascript'
|
||||
@highlightCode el, language
|
||||
return
|
||||
|
||||
app.views.DojoPage =
|
||||
app.views.JavascriptWithMarkupCheckPage
|
|
@ -21,6 +21,7 @@ app.views.CordovaPage =
|
|||
app.views.CrystalPage =
|
||||
app.views.D3Page =
|
||||
app.views.DockerPage =
|
||||
app.views.DojoPage =
|
||||
app.views.DrupalPage =
|
||||
app.views.ElectronPage =
|
||||
app.views.ElixirPage =
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
._dojo {
|
||||
@extend %simple;
|
||||
|
||||
.functionIcon, .parameters { @extend %code; }
|
||||
.jsdoc-inheritance { color: $textColorLight; }
|
||||
}
|
||||
|
|
|
@ -39,6 +39,21 @@ module Docs
|
|||
node.replace(node.content)
|
||||
end
|
||||
|
||||
css('.functionIcon', '.parameters').each do |node|
|
||||
node.name = 'code'
|
||||
node.content = node.content.strip
|
||||
end
|
||||
|
||||
css('pre').each do |node|
|
||||
node['data-language'] = node.content =~ /\A\s*</ ? 'markup' : 'javascript'
|
||||
end
|
||||
|
||||
css('.jsdoc-function-information', '.jsdoc-examples', '.jsdoc-example', 'span').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
css('table', 'a', 'h2', 'h3', 'td', 'strong').remove_attr('class')
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,7 +25,7 @@ module Docs
|
|||
options[:skip_patterns] = [/dijit/, /dojox/]
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2005–2015 The Dojo Foundation<br>
|
||||
© 2005–2017 JS Foundation<br>
|
||||
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
|
||||
HTML
|
||||
|
||||
|
|
Loading…
Reference in a new issue