Selaa lähdekoodia

Update Electron documentation (13.1.7)

Enoc 4 vuotta sitten
vanhempi
commit
0bb5d3e4a9
2 muutettua tiedostoa jossa 7 lisäystä ja 3 poistoa
  1. 2 1
      lib/docs/filters/electron/entries.rb
  2. 5 2
      lib/docs/scrapers/electron.rb

+ 2 - 1
lib/docs/filters/electron/entries.rb

@@ -3,6 +3,7 @@ module Docs
     class EntriesFilter < Docs::EntriesFilter
       def get_name
         return 'API' if subpath == '/api'
+        return 'Structures' if slug == 'api/structures'
 
         name = at_css('h1, h2').content
         name.remove! 'Class: '
@@ -14,7 +15,7 @@ module Docs
       end
 
       def get_type
-        return 'API' if subpath == '/api'
+        return 'API' if subpath == '/api' || slug == 'api/structures'
 
         if subpath.start_with?('/tutorial') || subpath.in?(%w(/glossary /faq))
           'Guides'

+ 5 - 2
lib/docs/scrapers/electron.rb

@@ -2,7 +2,7 @@ module Docs
   class Electron < UrlScraper
     self.type = 'simple'
     self.base_url = 'https://www.electronjs.org/docs'
-    self.release = '12.0.0'
+    self.release = '13.1.7'
     self.links = {
       home: 'https://www.electronjs.org/',
       code: 'https://github.com/electron/electron'
@@ -13,7 +13,10 @@ module Docs
     options[:trailing_slash] = false
     options[:container] = 'main'
     options[:skip] = %w(guides development tutorial versions all)
-    options[:skip_patterns] = [/\/history\z/]
+    options[:skip_patterns] = [
+      /\/history\z/,
+      /\/latest/      # beta site
+    ]
     options[:replace_paths] = {
       'api/web-view-tag' => 'api/webview-tag'
     }