electron: update to 11.0.1

pull/1351/head
samfundev 4 years ago
parent 23b4378582
commit d495f49ef6
No known key found for this signature in database
GPG Key ID: 5157E7288829EF25

@ -258,7 +258,7 @@ credits = [
'https://api.drupal.org/api/drupal/LICENSE.txt' 'https://api.drupal.org/api/drupal/LICENSE.txt'
], [ ], [
'Electron', 'Electron',
'2013-2018 GitHub Inc.', 'GitHub Inc.',
'MIT', 'MIT',
'https://raw.githubusercontent.com/electron/electron/master/LICENSE' 'https://raw.githubusercontent.com/electron/electron/master/LICENSE'
], [ ], [

@ -11,9 +11,13 @@ module Docs
if root_page? if root_page?
doc.child.before('<h1>Electron Documentation</h1>') doc.child.before('<h1>Electron Documentation</h1>')
css("div.subtron, div.py-6").remove
css('h2 > a').each do |node| css('h2 > a').each do |node|
node.before(node.children).remove node.before(node.children).remove
end end
else
@doc = doc.at_css('div.docs > div.markdown-body')
end end
at_css('h2').name = 'h1' if !at_css('h1') && at_css('h2') at_css('h2').name = 'h1' if !at_css('h1') && at_css('h2')

@ -1,17 +1,17 @@
module Docs module Docs
class Electron < UrlScraper class Electron < UrlScraper
self.type = 'simple' self.type = 'simple'
self.base_url = 'https://electronjs.org/docs' self.base_url = 'https://www.electronjs.org/docs'
self.release = '2.0.2' self.release = '11.0.1'
self.links = { self.links = {
home: 'https://electronjs.org/', home: 'https://www.electronjs.org/',
code: 'https://github.com/electron/electron' code: 'https://github.com/electron/electron'
} }
html_filters.push 'electron/clean_html', 'electron/entries' html_filters.push 'electron/clean_html', 'electron/entries'
options[:trailing_slash] = false options[:trailing_slash] = false
options[:container] = '.page-section > .container, .page-section > .container-narrow' options[:container] = 'main'
options[:skip] = %w(guides development tutorial versions all) options[:skip] = %w(guides development tutorial versions all)
options[:skip_patterns] = [/\/history\z/] options[:skip_patterns] = [/\/history\z/]
options[:replace_paths] = { options[:replace_paths] = {
@ -19,12 +19,12 @@ module Docs
} }
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2013&ndash;2018 GitHub Inc.<br> &copy; GitHub Inc.<br>
Licensed under the MIT license. Licensed under the MIT license.
HTML HTML
def get_latest_version(opts) def get_latest_version(opts)
doc = fetch_doc('https://electronjs.org/docs', opts) doc = fetch_doc('https://www.electronjs.org/docs', opts)
doc.at_css('.docs-version').content doc.at_css('.docs-version').content
end end
end end

Loading…
Cancel
Save