Przeglądaj źródła

electron: update to 11.0.1

samfundev 5 lat temu
rodzic
commit
d495f49ef6

+ 1 - 1
assets/javascripts/templates/pages/about_tmpl.coffee

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

+ 4 - 0
lib/docs/filters/electron/clean_html.rb

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

+ 6 - 6
lib/docs/scrapers/electron.rb

@@ -1,17 +1,17 @@
 module Docs
   class Electron < UrlScraper
     self.type = 'simple'
-    self.base_url = 'https://electronjs.org/docs'
-    self.release = '2.0.2'
+    self.base_url = 'https://www.electronjs.org/docs'
+    self.release = '11.0.1'
     self.links = {
-      home: 'https://electronjs.org/',
+      home: 'https://www.electronjs.org/',
       code: 'https://github.com/electron/electron'
     }
 
     html_filters.push 'electron/clean_html', 'electron/entries'
 
     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_patterns] = [/\/history\z/]
     options[:replace_paths] = {
@@ -19,12 +19,12 @@ module Docs
     }
 
     options[:attribution] = <<-HTML
-      &copy; 2013&ndash;2018 GitHub Inc.<br>
+      &copy; GitHub Inc.<br>
       Licensed under the MIT license.
     HTML
 
     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
     end
   end