History

electron: update to 11.0.1

samfundev committed 5 years ago

Commit d495f491 parent 23b43783 files · +11 −7Browse files

Unified · Split

3 files
  1. assets/javascripts/templates/pages/about_tmpl.coffee +1 −1
  2. lib/docs/filters/electron/clean_html.rb +4 −0
  3. lib/docs/scrapers/electron.rb +6 −6
assets/javascripts/templates/pages/about_tmpl.coffee+1−1
@@ -258,7 +258,7 @@ credits = [ · 257 unmodified lines
258258 'https://api.drupal.org/api/drupal/LICENSE.txt'
259259 ], [
260260 'Electron',
261− '2013-2018 GitHub Inc.',
261+ 'GitHub Inc.',
262262 'MIT',
263263 'https://raw.githubusercontent.com/electron/electron/master/LICENSE'
264264 ], [
lib/docs/filters/electron/clean_html.rb+4−0
@@ -11,9 +11,13 @@ module Docs · 10 unmodified lines
1111 if root_page?
1212 doc.child.before('<h1>Electron Documentation</h1>')
1313
14+ css("div.subtron, div.py-6").remove
15+
1416 css('h2 > a').each do |node|
1517 node.before(node.children).remove
1618 end
19+ else
20+ @doc = doc.at_css('div.docs > div.markdown-body')
1721 end
1822
1923 at_css('h2').name = 'h1' if !at_css('h1') && at_css('h2')
lib/docs/scrapers/electron.rb+6−6
@@ -1,17 +1,17 @@
11 module Docs
22 class Electron < UrlScraper
33 self.type = 'simple'
4− self.base_url = 'https://electronjs.org/docs'
5− self.release = '2.0.2'
4+ self.base_url = 'https://www.electronjs.org/docs'
5+ self.release = '11.0.1'
66 self.links = {
7− home: 'https://electronjs.org/',
7+ home: 'https://www.electronjs.org/',
88 code: 'https://github.com/electron/electron'
99 }
1010
1111 html_filters.push 'electron/clean_html', 'electron/entries'
1212
1313 options[:trailing_slash] = false
14− options[:container] = '.page-section > .container, .page-section > .container-narrow'
14+ options[:container] = 'main'
1515 options[:skip] = %w(guides development tutorial versions all)
1616 options[:skip_patterns] = [/\/history\z/]
1717 options[:replace_paths] = {
@@ -19,12 +19,12 @@ module Docs · 1 unmodified line
1919 }
2020
2121 options[:attribution] = <<-HTML
22− &copy; 2013&ndash;2018 GitHub Inc.<br>
22+ &copy; GitHub Inc.<br>
2323 Licensed under the MIT license.
2424 HTML
2525
2626 def get_latest_version(opts)
27− doc = fetch_doc('https://electronjs.org/docs', opts)
27+ doc = fetch_doc('https://www.electronjs.org/docs', opts)
2828 doc.at_css('.docs-version').content
2929 end
3030 end