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
258 'https://api.drupal.org/api/drupal/LICENSE.txt'258 'https://api.drupal.org/api/drupal/LICENSE.txt'
259 ], [259 ], [
260 'Electron',260 'Electron',
261 '2013-2018 GitHub Inc.',261 'GitHub Inc.',
262 'MIT',262 'MIT',
263 'https://raw.githubusercontent.com/electron/electron/master/LICENSE'263 'https://raw.githubusercontent.com/electron/electron/master/LICENSE'
264 ], [264 ], [
lib/docs/filters/electron/clean_html.rb+4−0
@@ -11,9 +11,13 @@ module Docs · 10 unmodified lines
11 if root_page?11 if root_page?
12 doc.child.before('<h1>Electron Documentation</h1>')12 doc.child.before('<h1>Electron Documentation</h1>')
13 13
14 css("div.subtron, div.py-6").remove
15
14 css('h2 > a').each do |node|16 css('h2 > a').each do |node|
15 node.before(node.children).remove17 node.before(node.children).remove
16 end18 end
19 else
20 @doc = doc.at_css('div.docs > div.markdown-body')
17 end21 end
18 22
19 at_css('h2').name = 'h1' if !at_css('h1') && at_css('h2')23 at_css('h2').name = 'h1' if !at_css('h1') && at_css('h2')
lib/docs/scrapers/electron.rb+6−6
@@ -1,17 +1,17 @@
1module Docs1module Docs
2 class Electron < UrlScraper2 class Electron < UrlScraper
3 self.type = 'simple'3 self.type = 'simple'
4 self.base_url = 'https://electronjs.org/docs'4 self.base_url = 'https://www.electronjs.org/docs'
5 self.release = '2.0.2'5 self.release = '11.0.1'
6 self.links = {6 self.links = {
7 home: 'https://electronjs.org/',7 home: 'https://www.electronjs.org/',
8 code: 'https://github.com/electron/electron'8 code: 'https://github.com/electron/electron'
9 }9 }
10 10
11 html_filters.push 'electron/clean_html', 'electron/entries'11 html_filters.push 'electron/clean_html', 'electron/entries'
12 12
13 options[:trailing_slash] = false13 options[:trailing_slash] = false
14 options[:container] = '.page-section > .container, .page-section > .container-narrow'14 options[:container] = 'main'
15 options[:skip] = %w(guides development tutorial versions all)15 options[:skip] = %w(guides development tutorial versions all)
16 options[:skip_patterns] = [/\/history\z/]16 options[:skip_patterns] = [/\/history\z/]
17 options[:replace_paths] = {17 options[:replace_paths] = {
@@ -19,12 +19,12 @@ module Docs · 1 unmodified line
19 }19 }
20 20
21 options[:attribution] = <<-HTML21 options[:attribution] = <<-HTML
22 &copy; 2013&ndash;2018 GitHub Inc.<br>22 &copy; GitHub Inc.<br>
23 Licensed under the MIT license.23 Licensed under the MIT license.
24 HTML24 HTML
25 25
26 def get_latest_version(opts)26 def get_latest_version(opts)
27 doc = fetch_doc('https://electronjs.org/docs', opts)27 doc = fetch_doc('https://www.electronjs.org/docs', opts)
28 doc.at_css('.docs-version').content28 doc.at_css('.docs-version').content
29 end29 end
30 end30 end