Răsfoiți Sursa

Merge pull request #1351 from samfundev/doc-update

Update 5 documentations to their latest versions
Simon Legner 5 ani în urmă
părinte
comite
e13ab9a392

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

@@ -123,7 +123,7 @@ credits = [
     'https://www.gnu.org/licenses/fdl-1.3.en.html'
   ], [
     'Bluebird',
-    '2013-2017 Petka Antonov',
+    '2013-2018 Petka Antonov',
     'MIT',
     'https://raw.githubusercontent.com/petkaantonov/bluebird/master/LICENSE'
   ], [
@@ -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'
   ], [

+ 2 - 2
lib/docs/filters/codeceptjs/clean_html.rb

@@ -7,9 +7,9 @@ module Docs
           return doc
         end
 
-        @doc = doc.at_css('div.reference div[role=main]')
+        @doc = doc.at_css('article div.content__default')
 
-        css('hr').remove
+        css('hr, a.header-anchor').remove
 
         unless at_css('h1')
           at_css('h2').name = 'h1'

+ 1 - 1
lib/docs/filters/codeceptjs/entries.rb

@@ -2,7 +2,7 @@ module Docs
   class Codeceptjs
     class EntriesFilter < Docs::EntriesFilter
       def get_name
-        at_css('h1').content
+        at_css('h1').content.strip
       end
 
       def get_type

+ 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')

+ 1 - 1
lib/docs/scrapers/async.rb

@@ -1,7 +1,7 @@
 module Docs
   class Async < UrlScraper
     self.type = 'async'
-    self.release = '3.0.1'
+    self.release = '3.2.0'
     self.base_url = 'https://caolan.github.io/async/v3/'
     self.root_path = 'docs.html'
     self.links = {

+ 2 - 3
lib/docs/scrapers/bluebird.rb

@@ -1,10 +1,9 @@
 module Docs
   class Bluebird < UrlScraper
     self.type = 'simple'
-    self.release = '3.5.1'
+    self.release = '3.7.2'
     self.base_url = 'http://bluebirdjs.com/docs/'
     self.root_path = 'api-reference.html'
-    self.force_gzip = true
     self.links = {
       home: 'http://bluebirdjs.com/',
       code: 'https://github.com/petkaantonov/bluebird/'
@@ -15,7 +14,7 @@ module Docs
     options[:skip] = %w(support.html download-api-reference.html contribute.html)
 
     options[:attribution] = <<-HTML
-      &copy; 2013&ndash;2017 Petka Antonov<br>
+      &copy; 2013&ndash;2018 Petka Antonov<br>
       Licensed under the MIT License.
     HTML
 

+ 1 - 1
lib/docs/scrapers/codeception.rb

@@ -2,7 +2,7 @@ module Docs
   class Codeception < UrlScraper
     self.name = 'Codeception'
     self.type = 'codeception'
-    self.release = '3.0.3'
+    self.release = '4.1.12'
     self.base_url = 'https://codeception.com/docs/'
     self.root_path = 'index.html'
     self.links = {

+ 9 - 1
lib/docs/scrapers/codeceptjs.rb

@@ -3,7 +3,7 @@ module Docs
     self.name = 'CodeceptJS'
     self.type = 'simple'
     self.root_path = 'index.html'
-    self.release = '1.4.4'
+    self.release = '3.0.2'
     self.base_url = 'https://codecept.io/'
     self.links = {
       home: 'https://codecept.io/',
@@ -17,6 +17,14 @@ module Docs
     options[:skip_links] = ->(filter) { !filter.root_page? }
     options[:skip_patterns] = [/changelog/, /quickstart\z/]
 
+    options[:fix_urls] = -> (url) do
+      url.sub! %r{\.html\z}, ''
+      url.sub! %r{custom-helpers\z}, 'helpers'
+      url
+    end
+
+    options[:trailing_slash] = true
+
     options[:attribution] = <<-HTML
       &copy; 2015 DavertMik &lt;davert@codegyre.com&gt; (http://codegyre.com)<br>
       Licensed under the MIT License.

+ 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

BIN
public/icons/docs/codeceptjs/16.png


BIN
public/icons/docs/codeceptjs/16@2x.png


+ 1 - 1
public/icons/docs/codeceptjs/SOURCE

@@ -1 +1 @@
-http://codecept.io/images/cjs-base.png
+https://github.com/codeceptjs/website/blob/a4e7e9a8ebe56db7ed3783cb1f1d8d26a6c87b43/docs/.vuepress/public/logo.svg