瀏覽代碼

Merge branch 'master' into master

Simon Legner 5 年之前
父節點
當前提交
44eb7ec32a
共有 51 個文件被更改,包括 257 次插入94 次删除
  1. 4 0
      .github/CODEOWNERS
  2. 1 1
      Gemfile.lock
  3. 4 0
      README.md
  4. 13 8
      assets/javascripts/templates/pages/about_tmpl.coffee
  5. 1 1
      assets/stylesheets/application.css.scss
  6. 18 0
      docs/file-scrapers.md
  7. 2 0
      lib/docs/core/doc.rb
  8. 13 0
      lib/docs/filters/ansible/entries.rb
  9. 4 2
      lib/docs/filters/haxe/clean_html.rb
  10. 1 0
      lib/docs/filters/jest/entries.rb
  11. 7 7
      lib/docs/filters/leaflet/clean_html.rb
  12. 5 2
      lib/docs/filters/openjdk/clean_html.rb
  13. 62 2
      lib/docs/scrapers/angular.rb
  14. 7 2
      lib/docs/scrapers/angularjs.rb
  15. 9 4
      lib/docs/scrapers/ansible.rb
  16. 1 2
      lib/docs/scrapers/babel.rb
  17. 2 2
      lib/docs/scrapers/chef.rb
  18. 2 3
      lib/docs/scrapers/codeigniter.rb
  19. 1 1
      lib/docs/scrapers/dart.rb
  20. 3 3
      lib/docs/scrapers/docker.rb
  21. 1 1
      lib/docs/scrapers/elixir.rb
  22. 1 2
      lib/docs/scrapers/erlang.rb
  23. 1 2
      lib/docs/scrapers/fish.rb
  24. 5 3
      lib/docs/scrapers/gnu_cobol.rb
  25. 5 0
      lib/docs/scrapers/gnuplot.rb
  26. 1 1
      lib/docs/scrapers/go.rb
  27. 1 2
      lib/docs/scrapers/godot.rb
  28. 7 3
      lib/docs/scrapers/haxe.rb
  29. 1 3
      lib/docs/scrapers/influxdata.rb
  30. 2 2
      lib/docs/scrapers/jest.rb
  31. 5 0
      lib/docs/scrapers/leaflet.rb
  32. 7 2
      lib/docs/scrapers/lua.rb
  33. 1 2
      lib/docs/scrapers/moment.rb
  34. 4 3
      lib/docs/scrapers/nginx.rb
  35. 6 1
      lib/docs/scrapers/node.rb
  36. 8 1
      lib/docs/scrapers/openjdk.rb
  37. 1 3
      lib/docs/scrapers/pandas.rb
  38. 1 2
      lib/docs/scrapers/perl.rb
  39. 2 3
      lib/docs/scrapers/php.rb
  40. 6 1
      lib/docs/scrapers/postgresql.rb
  41. 5 1
      lib/docs/scrapers/pug.rb
  42. 12 4
      lib/docs/scrapers/python.rb
  43. 4 0
      lib/docs/scrapers/rdoc/ruby.rb
  44. 1 1
      lib/docs/scrapers/react.rb
  45. 2 2
      lib/docs/scrapers/react_native.rb
  46. 1 2
      lib/docs/scrapers/scikit_learn.rb
  47. 1 1
      lib/docs/scrapers/sqlite.rb
  48. 1 2
      lib/docs/scrapers/statsmodels.rb
  49. 1 2
      lib/docs/scrapers/vagrant.rb
  50. 1 1
      public/icons/docs/postgresql/SOURCE
  51. 2 1
      public/icons/docs/ruby/SOURCE

+ 4 - 0
.github/CODEOWNERS

@@ -0,0 +1,4 @@
+# This controls who gets notified for review and allows branches to be protected.
+# Protected branches can only be merged into after being approved by a codeowner.
+
+* @freeCodeCamp/devdocs

+ 1 - 1
Gemfile.lock

@@ -26,7 +26,7 @@ GEM
     eventmachine (1.2.7)
     execjs (2.7.0)
     exifr (1.3.6)
-    ffi (1.11.1)
+    ffi (1.12.2)
     fspath (3.1.2)
     highline (2.0.3)
     html-pipeline (2.12.0)

+ 4 - 0
README.md

@@ -4,6 +4,10 @@ DevDocs combines multiple developer documentations in a clean and organized web
 
 DevDocs was created by [Thibaut Courouble](https://thibaut.me) and is operated by [freeCodeCamp](https://www.freecodecamp.org).
 
+## We are currently searching for maintainers
+
+Please reach out to the community on [Gitter](https://gitter.im/FreeCodeCamp/DevDocs) if you would like to join the team!
+
 Keep track of development news:
 
 * Join the contributor chat room on [Gitter](https://gitter.im/FreeCodeCamp/DevDocs)

+ 13 - 8
assets/javascripts/templates/pages/about_tmpl.coffee

@@ -22,7 +22,7 @@ app.templates.aboutPage = -> """
 
   <h2 class="_block-heading" id="copyright">Copyright and License</h2>
   <p class="_note">
-    <strong>Copyright 2013&ndash;2019 Thibaut Courouble and <a href="https://github.com/freeCodeCamp/devdocs/graphs/contributors">other contributors</a></strong><br>
+    <strong>Copyright 2013&ndash;2020 Thibaut Courouble and <a href="https://github.com/freeCodeCamp/devdocs/graphs/contributors">other contributors</a></strong><br>
     This software is licensed under the terms of the Mozilla Public License v2.0.<br>
     You may obtain a copy of the source code at <a href="https://github.com/freeCodeCamp/devdocs">github.com/freeCodeCamp/devdocs</a>.<br>
     For more information, see the <a href="https://github.com/freeCodeCamp/devdocs/blob/master/COPYRIGHT">COPYRIGHT</a>
@@ -82,8 +82,13 @@ app.templates.aboutPage = -> """
 """
 
 credits = [
-  [ 'Angular<br>Angular.js',
-    '2010-2019 Google, Inc.',
+  [ 'Angular.js',
+    '2010-2020 Google, Inc.',
+    'CC BY 3.0',
+    'https://creativecommons.org/licenses/by/3.0/'
+  ], [
+    'Angular',
+    '2010-2020 Google, Inc.',
     'CC BY',
     'https://creativecommons.org/licenses/by/4.0/'
   ], [
@@ -378,7 +383,7 @@ credits = [
     'https://raw.githubusercontent.com/jekyll/jekyll/master/LICENSE'
   ], [
     'Jest',
-    'Facebook, Inc. and its affiliates.',
+    '2020 Facebook, Inc.',
     'MIT',
     'https://raw.githubusercontent.com/facebook/jest/master/LICENSE'
   ], [
@@ -448,7 +453,7 @@ credits = [
     'https://raw.githubusercontent.com/lodash/lodash/master/LICENSE'
   ], [
     'Lua',
-    '1994–2017 Lua.org, PUC-Rio',
+    '1994–2020 Lua.org, PUC-Rio',
     'MIT',
     'http://www.lua.org/license.html'
   ], [
@@ -508,7 +513,7 @@ credits = [
     'https://github.com/LearnBoost/mongoose/blob/master/README.md#license'
   ], [
     'nginx',
-    '2002-2019 Igor Sysoev<br>&copy; 2011-2019 Nginx, Inc.',
+    '2002-2020 Igor Sysoev<br>&copy; 2011-2020 Nginx, Inc.',
     'BSD',
     'http://nginx.org/LICENSE'
   ], [
@@ -548,7 +553,7 @@ credits = [
     'https://octave.org/doc/interpreter/'
   ], [
     'OpenJDK',
-    '1993-2017, Oracle and/or its affiliates. All rights reserved.<br>Licensed under the GNU General Public License, version 2, with the Classpath Exception.<br>Various third party code in OpenJDK is licensed under different licenses.<br>Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.',
+    '1993, 2020, Oracle and/or its affiliates. All rights reserved.<br>Licensed under the GNU General Public License, version 2, with the Classpath Exception.<br>Various third party code in OpenJDK is licensed under different licenses.<br>Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.',
     'GPLv2',
     'http://openjdk.java.net/legal/gplv2+ce.html'
   ], [
@@ -603,7 +608,7 @@ credits = [
     'https://raw.githubusercontent.com/ponylang/ponyc/master/LICENSE'
   ], [
     'PostgreSQL',
-    '1996-2019 The PostgreSQL Global Development Group<br>&copy; 1994 The Regents of the University of California',
+    '1996-2020 The PostgreSQL Global Development Group<br>&copy; 1994 The Regents of the University of California',
     'PostgreSQL',
     'https://www.postgresql.org/about/licence/'
   ], [

+ 1 - 1
assets/stylesheets/application.css.scss

@@ -3,7 +3,7 @@
 //= depend_on sprites/docs.json
 
 /*!
- * Copyright 2013-2019 Thibaut Courouble and other contributors
+ * Copyright 2013-2020 Thibaut Courouble and other contributors
  *
  * This source code is licensed under the terms of the Mozilla
  * Public License, v. 2.0, a copy of which may be obtained at:

+ 18 - 0
docs/file-scrapers.md

@@ -80,6 +80,24 @@ $GS = '/usr/local/opt/ghostscript/bin/gs';	# GhostScript
 
 ## OpenJDK
 
+https://packages.debian.org/sid/openjdk-11-doc
+
+```sh
+mkdir docs/openjdk~11
+curl --remote-name http://ftp.debian.org/debian/pool/main/o/openjdk-11/openjdk-11-doc_11.0.9.1+1-1_all.deb
+bsdtar --extract --to-stdout --file openjdk-11-doc_11.0.9.1+1-1_all.deb data.tar.xz | \
+bsdtar --extract --xz --file - --strip-components=6 --directory=docs/openjdk\~11/ ./usr/share/doc/openjdk-11-jre-headless/api/
+```
+
+https://packages.debian.org/sid/openjdk-8-doc
+
+```sh
+mkdir docs/openjdk~8
+curl --remote-name http://ftp.debian.org/debian/pool/main/o/openjdk-8/openjdk-8-doc_8u272-b10-1_all.deb
+bsdtar --extract --to-stdout --file openjdk-8-doc_8u272-b10-1_all.deb data.tar.xz | \
+bsdtar --extract --xz --file - --strip-components=6 --directory=docs/openjdk\~8/ ./usr/share/doc/openjdk-8-jre-headless/api/
+```
+
 ## Perl
 
 ## PHP

+ 2 - 0
lib/docs/core/doc.rb

@@ -220,6 +220,8 @@ module Docs
 
       if opts.key?(:github_token) and url.start_with?('https://api.github.com/')
         headers['Authorization'] = "token #{opts[:github_token]}"
+      elsif ENV['GITHUB_TOKEN'] and url.start_with?('https://api.github.com/')
+        headers['Authorization'] = "token #{ENV['GITHUB_TOKEN']}"
       end
 
       opts[:logger].debug("Fetching #{url}")

+ 13 - 0
lib/docs/filters/ansible/entries.rb

@@ -7,6 +7,13 @@ module Docs
         name.remove! %r{ \- .*}
         name.remove! 'Introduction To '
         name.remove! %r{ Guide\z}
+
+        if version == "2.10"
+          if slug =~ /\Acollections\// and slug !~ /index$/
+            name = name.split('.')[2]
+          end
+        end
+
         name
       end
 
@@ -21,6 +28,12 @@ module Docs
           end
         end
 
+        if version == "2.10"
+          if slug =~ /\Acollections\//
+            return "Collection #{slug.split('/')[1..-2].join(".")}"
+          end
+        end
+
         if slug =~ /\Acli\//
           'CLI Reference'
         elsif slug =~ /\Anetwork\//

+ 4 - 2
lib/docs/filters/haxe/clean_html.rb

@@ -2,7 +2,7 @@ module Docs
   class Haxe
     class CleanHtmlFilter < Filter
       def call
-        css('.viewsource', 'hr', 'h1 > small', '.inherited-fields').remove
+        css('.viewsource', 'hr', 'h1 > small', '.inherited-fields', '.label-meta').remove
 
         css('h4 + h1').each do |node|
           node.after(node.previous_element)
@@ -28,8 +28,10 @@ module Docs
         end
 
         css('.field').each do |node|
+          h3 = node.at_css('h3:not(:empty)')
+          next unless h3.present?
           link = node.at_css('a[name]')
-          node.at_css('h3:not(:empty)')['id'] = link['name']
+          h3['id'] = link['name']
           link.before(link.children).remove
           node.before(node.children).remove
         end

+ 1 - 0
lib/docs/filters/jest/entries.rb

@@ -19,6 +19,7 @@ module Docs
 
       def additional_entries
         return [] unless !root_page? && self.type == self.name # api page
+        return [] if self.slug == 'environment-variables'
 
         entries = []
 

+ 7 - 7
lib/docs/filters/leaflet/clean_html.rb

@@ -8,25 +8,25 @@ module Docs
           node.name = 'h2'
         end
 
-        at_css('> h2:first-child').name = 'h1'
-
-        # remove "This reference reflects Leaflet 1.2.0."
-        css('h1 ~ p').each do |node|
+        # remove "This reference reflects Leaflet"
+        css('p:contains("This reference reflects Leaflet")').each do |node|
           node.remove
           break
         end
 
+        at_css('> h2:first-child').name = 'h1'
+
         css('section', 'code b', '.accordion', '.accordion-overflow', '.accordion-content').each do |node|
           node.before(node.children).remove
         end
 
         css('pre > code').each do |node|
           node['class'] ||= ''
-          lang = if node['class'].include?('lang-html') || node.content =~ /\A</
+          lang = if node['class'].include?('lang-html') || node['class'].include?('language-html') || node.content =~ /\A</
             'html'
-          elsif node['class'].include?('lang-css')
+          elsif node['class'].include?('lang-css') || node['class'].include?('language-css')
             'css'
-          elsif node['class'].include?('lang-js') || node['class'].include?('lang-javascript')
+          elsif node['class'].include?('lang-js') || node['class'].include?('language-js') || node['class'].include?('lang-javascript')
             'javascript'
           end
           node.parent['data-language'] = lang if lang

+ 5 - 2
lib/docs/filters/openjdk/clean_html.rb

@@ -33,7 +33,7 @@ module Docs
           node.content = node.content.remove(' Summary').remove(' Detail').pluralize
         end
 
-        if root_page?
+        if root_page? && version == '8'
           css('.header')[1].remove
           css('.contentContainer')[0].remove
           css('.contentContainer')[-1].remove
@@ -45,7 +45,10 @@ module Docs
             end
           end
 
-          at_css('h1').content = "OpenJDK #{release} Documentation" + (version != release ? " (#{version.split(' ').last})" : '')
+        end
+
+        if root_page?
+          at_css('h1').content = "OpenJDK #{release} Documentation"
         end
 
         css('table').each do |node|

+ 62 - 2
lib/docs/scrapers/angular.rb

@@ -11,7 +11,7 @@ module Docs
     options[:max_image_size] = 256_000
 
     options[:attribution] = <<-HTML
-      &copy; 2010&ndash;2019 Google, Inc.<br>
+      &copy; 2010&ndash;2020 Google, Inc.<br>
       Licensed under the Creative Commons Attribution License 4.0.
     HTML
 
@@ -59,7 +59,7 @@ module Docs
     end
 
     version do
-      self.release = '8.2.14'
+      self.release = '11.0.0'
       self.base_url = 'https://angular.io/'
       self.root_path = 'docs'
 
@@ -78,6 +78,66 @@ module Docs
       include Docs::Angular::Common
     end
 
+    version '10' do
+      self.release = '10.2.3'
+      self.base_url = 'https://v10.angular.io/'
+      self.root_path = 'docs'
+
+      html_filters.push 'angular/clean_html', 'angular/entries'
+
+      options[:follow_links] = false
+      options[:only_patterns] = [/\Aguide/, /\Atutorial/, /\Aapi/]
+      options[:fix_urls_before_parse] = ->(url) do
+        url.sub! %r{\Aguide/}, '/guide/'
+        url.sub! %r{\Atutorial/}, '/tutorial/'
+        url.sub! %r{\Aapi/}, '/api/'
+        url.sub! %r{\Agenerated/}, '/generated/'
+        url
+      end
+
+      include Docs::Angular::Common
+    end
+
+    version '9' do
+      self.release = '9.1.12'
+      self.base_url = 'https://v9.angular.io/'
+      self.root_path = 'docs'
+
+      html_filters.push 'angular/clean_html', 'angular/entries'
+
+      options[:follow_links] = false
+      options[:only_patterns] = [/\Aguide/, /\Atutorial/, /\Aapi/]
+      options[:fix_urls_before_parse] = ->(url) do
+        url.sub! %r{\Aguide/}, '/guide/'
+        url.sub! %r{\Atutorial/}, '/tutorial/'
+        url.sub! %r{\Aapi/}, '/api/'
+        url.sub! %r{\Agenerated/}, '/generated/'
+        url
+      end
+
+      include Docs::Angular::Common
+    end
+
+    version '8' do
+      self.release = '8.2.14'
+      self.base_url = 'https://v8.angular.io/'
+      self.root_path = 'docs'
+
+      html_filters.push 'angular/clean_html', 'angular/entries'
+
+      options[:follow_links] = false
+      options[:only_patterns] = [/\Aguide/, /\Atutorial/, /\Aapi/]
+      options[:fix_urls_before_parse] = ->(url) do
+        url.sub! %r{\Aguide/}, '/guide/'
+        url.sub! %r{\Atutorial/}, '/tutorial/'
+        url.sub! %r{\Aapi/}, '/api/'
+        url.sub! %r{\Agenerated/}, '/generated/'
+        url
+      end
+
+      include Docs::Angular::Common
+    end
+
     version '7' do
       self.release = '7.2.15'
       self.base_url = 'https://v7.angular.io/'

+ 7 - 2
lib/docs/scrapers/angularjs.rb

@@ -38,8 +38,8 @@ module Docs
     ]
 
     options[:attribution] = <<-HTML
-      &copy; 2010&ndash;2018 Google, Inc.<br>
-      Licensed under the Creative Commons Attribution License 4.0.
+      &copy; 2010&ndash;2020 Google, Inc.<br>
+      Licensed under the Creative Commons Attribution License 3.0.
     HTML
 
     stub '' do
@@ -49,6 +49,11 @@ module Docs
       capybara.execute_script("return document.querySelector('.side-navigation').innerHTML")
     end
 
+    version '1.8' do
+      self.release = '1.8.2'
+      self.base_url = "https://code.angularjs.org/#{release}/docs/partials/"
+    end
+
     version '1.7' do
       self.release = '1.7.8'
       self.base_url = "https://code.angularjs.org/#{release}/docs/partials/"

+ 9 - 4
lib/docs/scrapers/ansible.rb

@@ -30,18 +30,23 @@ module Docs
       /\Aroadmap.*/i,
     ]
 
+    version '2.10' do
+      self.release = '2.10.3'
+      self.base_url = "https://docs.ansible.com/ansible/#{version}/"
+    end
+
     version '2.9' do
-      self.release = '2.9.1'
+      self.release = '2.9.15'
       self.base_url = "https://docs.ansible.com/ansible/#{version}/"
     end
 
     version '2.8' do
-      self.release = '2.8.7'
+      self.release = '2.8.16'
       self.base_url = "https://docs.ansible.com/ansible/#{version}/"
     end
 
     version '2.7' do
-      self.release = '2.7.15'
+      self.release = '2.7.17'
       self.base_url = "https://docs.ansible.com/ansible/#{version}/"
     end
 
@@ -71,7 +76,7 @@ module Docs
 
     def get_latest_version(opts)
       doc = fetch_doc('https://docs.ansible.com/ansible/latest/index.html', opts)
-      doc.at_css('.DocSiteProduct-CurrentVersion').content.strip
+      doc.at_css('.version').content.strip
     end
   end
 end

+ 1 - 2
lib/docs/scrapers/babel.rb

@@ -24,8 +24,7 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://babeljs.io/docs/en/', opts)
-      doc.at_css('a[href="/versions"] > h3').content
+      get_latest_github_release('babel', 'babel', opts)
     end
   end
 end

+ 2 - 2
lib/docs/scrapers/chef.rb

@@ -49,8 +49,8 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://downloads.chef.io/chef', opts)
-      doc.at_css('h1.product-heading > span').content.strip
+      doc = fetch_doc('https://downloads.chef.io/products/infra', opts)
+      doc.at_css('#versions > option').content.strip
     end
   end
 end

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

@@ -40,9 +40,8 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://codeigniter.com/userguide3/changelog.html', opts)
-      header = doc.at_css('#change-log h2')
-      header.content.scan(/([0-9.]+)/)[0][0]
+      tags = get_github_tags('codeigniter4', 'codeigniter4', opts)
+      tags[0]['name'][1..-1]
     end
   end
 end

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

@@ -33,7 +33,7 @@ module Docs
     def get_latest_version(opts)
       doc = fetch_doc('https://api.dartlang.org/', opts)
       label = doc.at_css('footer > span').content.strip
-      label.sub(/Dart /, '')
+      label.sub(/Dart\s*/, '')
     end
   end
 end

+ 3 - 3
lib/docs/scrapers/docker.rb

@@ -260,9 +260,9 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://docs.docker.com/', opts)
-      label = doc.at_css('.nav-container button.dropdown-toggle').content.strip
-      label.scan(/([0-9.]+)/)[0][0]
+      doc = fetch_doc('https://docs.docker.com/engine/release-notes/', opts)
+      latest_version = doc.at_css('.content > section > h1[id^="version-"]').content.strip
+      latest_version.rpartition(' ')[-1]
     end
   end
 end

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

@@ -126,7 +126,7 @@ module Docs
 
     def get_latest_version(opts)
       doc = fetch_doc('https://hexdocs.pm/elixir/api-reference.html', opts)
-      doc.at_css('h2.sidebar-projectVersion').content.strip[1..-1]
+      doc.at_css('.sidebar-projectVersion').content.strip[1..-1]
     end
   end
 end

+ 1 - 2
lib/docs/scrapers/erlang.rb

@@ -57,8 +57,7 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://www.erlang.org/downloads', opts)
-      doc.at_css('.col-lg-3 > ul > li').content.strip.sub(/OTP /, '')
+      get_latest_github_release('erlang', 'otp', opts)[4..-1]
     end
   end
 end

+ 1 - 2
lib/docs/scrapers/fish.rb

@@ -54,8 +54,7 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('http://fishshell.com/docs/current/index.html', opts)
-      doc.at_css('#toc-index').content.scan(/([0-9.]+)/)[0][0]
+      get_latest_github_release('fish-shell', 'fish-shell', opts)
     end
   end
 end

+ 5 - 3
lib/docs/scrapers/gnu_cobol.rb

@@ -18,9 +18,11 @@ module Docs
     HTML
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://open-cobol.sourceforge.io/HTML/gnucobpg.html', opts)
-      title = doc.at_css('h1').content
-      title.scan(/([0-9.]+)/)[0][0]
+      fetch_doc('https://sourceforge.net/projects/gnucobol/files/gnucobol/', opts)
+        .css('#files_list > tbody > tr')
+        .map { |file| file['title'] }
+        .sort_by { |version| version.to_f }
+        .last
     end
   end
 end

+ 5 - 0
lib/docs/scrapers/gnuplot.rb

@@ -37,5 +37,10 @@ module Docs
       Distributed under the <a href="https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/Copyright">gnuplot license</a> (rights to distribute modified versions are withheld).
     HTML
 
+    def get_latest_version(opts)
+      doc = fetch_doc('http://www.gnuplot.info/download.html', opts)
+      label = doc.at_css('h2').content.strip
+      label.sub(/[^0-9.]*/, '')
+    end
   end
 end

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

@@ -1,7 +1,7 @@
 module Docs
   class Go < UrlScraper
     self.type = 'go'
-    self.release = '1.13'
+    self.release = '1.15'
     self.base_url = 'https://golang.org/pkg/'
     self.links = {
       home: 'https://golang.org/',

+ 1 - 2
lib/docs/scrapers/godot.rb

@@ -44,8 +44,7 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://docs.godotengine.org/', opts)
-      doc.at_css('.version').content.strip
+      get_latest_github_release('godotengine', 'godot', opts).split('-')[0]
     end
   end
 end

+ 7 - 3
lib/docs/scrapers/haxe.rb

@@ -2,7 +2,7 @@ module Docs
   class Haxe < UrlScraper
     self.name = 'Haxe'
     self.type = 'simple'
-    self.release = '3.4.7'
+    self.release = '4.1.3'
     self.base_url = 'https://api.haxe.org/'
 
     html_filters.push 'haxe/clean_html', 'haxe/entries'
@@ -10,7 +10,7 @@ module Docs
     options[:container] = '.span9'
 
     options[:attribution] = <<-HTML
-      &copy; 2005&ndash;2018 Haxe Foundation<br>
+      &copy; 2005&ndash;2020 Haxe Foundation<br>
       Licensed under a MIT license.
     HTML
 
@@ -20,7 +20,7 @@ module Docs
         code: 'https://github.com/HaxeFoundation/haxe'
       }
 
-      options[:skip_patterns] = [/\A(?:cpp|cs|flash|java|js|neko|php|python|lua|hl|sys)/i]
+      options[:skip_patterns] = [/\A(?:cpp|cs|flash|java|js|neko|php|python|lua|hl|sys|eval)/i]
     end
 
     version 'C++' do
@@ -67,6 +67,10 @@ module Docs
       self.base_url = 'https://api.haxe.org/python/'
     end
 
+    version 'Eval' do
+      self.base_url = 'https://api.haxe.org/eval/'
+    end
+
     def get_latest_version(opts)
       doc = fetch_doc('https://api.haxe.org/', opts)
       label = doc.at_css('.container.main-content h1 > small').content

+ 1 - 3
lib/docs/scrapers/influxdata.rb

@@ -48,9 +48,7 @@ module Docs
     HTML
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://docs.influxdata.com/influxdb/', opts)
-      label = doc.at_css('.navbar--current-product').content.strip
-      label.scan(/([0-9.]+)/)[0][0]
+      get_latest_github_release('influxdata', 'influxdb', opts)
     end
   end
 end

+ 2 - 2
lib/docs/scrapers/jest.rb

@@ -1,7 +1,7 @@
 module Docs
   class Jest < UrlScraper
     self.type = 'simple'
-    self.release = '24.9'
+    self.release = '26.6'
     self.base_url = 'https://jestjs.io/docs/en/'
     self.root_path = 'getting-started'
     self.links = {
@@ -14,7 +14,7 @@ module Docs
     options[:container] = '.docMainWrapper'
 
     options[:attribution] = <<-HTML
-      &copy; 2019 Facebook, Inc. and its affiliates.<br>
+      &copy; 2020 Facebook, Inc.<br>
       Licensed under the MIT License.
     HTML
 

+ 5 - 0
lib/docs/scrapers/leaflet.rb

@@ -19,6 +19,11 @@ module Docs
       Maps &copy; OpenStreetMap contributors.
     HTML
 
+    version '1.7' do
+      self.release = '1.7.1'
+      self.base_url = "https://leafletjs.com/reference-#{release}.html"
+    end
+
     version '1.6' do
       self.release = '1.6.0'
       self.base_url = "https://leafletjs.com/reference-#{release}.html"

+ 7 - 2
lib/docs/scrapers/lua.rb

@@ -8,12 +8,17 @@ module Docs
     options[:skip_links] = true
 
     options[:attribution] = <<-HTML
-      &copy; 1994&ndash;2017 Lua.org, PUC-Rio.<br>
+      &copy; 1994&ndash;2020 Lua.org, PUC-Rio.<br>
       Licensed under the MIT License.
     HTML
 
+    version '5.4' do
+      self.release = '5.4.1'
+      self.base_url = 'https://www.lua.org/manual/5.4/'
+    end
+
     version '5.3' do
-      self.release = '5.3.4'
+      self.release = '5.3.6'
       self.base_url = 'https://www.lua.org/manual/5.3/'
     end
 

+ 1 - 2
lib/docs/scrapers/moment.rb

@@ -24,8 +24,7 @@ module Docs
     HTML
 
     def get_latest_version(opts)
-      doc = fetch_doc('http://momentjs.com/', opts)
-      doc.at_css('.hero-title > h1 > span').content
+      get_github_tags('moment', 'moment', opts)[0]['name']
     end
   end
 end

+ 4 - 3
lib/docs/scrapers/nginx.rb

@@ -2,7 +2,7 @@ module Docs
   class Nginx < UrlScraper
     self.name = 'nginx'
     self.type = 'nginx'
-    self.release = '1.17.2'
+    self.release = '1.19.3'
     self.base_url = 'https://nginx.org/en/docs/'
     self.links = {
       home: 'https://nginx.org/',
@@ -20,9 +20,10 @@ module Docs
 
     options[:skip_patterns] = [/\/faq\//]
 
+    # http://nginx.org/LICENSE
     options[:attribution] = <<-HTML
-      &copy; 2002-2019 Igor Sysoev<br>
-      &copy; 2011-2019 Nginx, Inc.<br>
+      &copy; 2002-2020 Igor Sysoev<br>
+      &copy; 2011-2020 Nginx, Inc.<br>
       Licensed under the BSD License.
     HTML
 

+ 6 - 1
lib/docs/scrapers/node.rb

@@ -23,7 +23,12 @@ module Docs
     HTML
 
     version do
-      self.release = '12.9.1'
+      self.release = '14.15.0'
+      self.base_url = 'https://nodejs.org/dist/latest-v14.x/docs/api/'
+    end
+
+    version '12 LTS' do
+      self.release = '12.19.0'
       self.base_url = 'https://nodejs.org/dist/latest-v12.x/docs/api/'
     end
 

+ 8 - 1
lib/docs/scrapers/openjdk.rb

@@ -18,13 +18,20 @@ module Docs
       /doc-files\//]
 
     options[:attribution] = <<-HTML
-      &copy; 1993&ndash;2017, Oracle and/or its affiliates. All rights reserved.<br>
+      &copy; 1993, 2020, Oracle and/or its affiliates. All rights reserved.<br>
       Documentation extracted from Debian's OpenJDK Development Kit package.<br>
       Licensed under the GNU General Public License, version 2, with the Classpath Exception.<br>
       Various third party code in OpenJDK is licensed under different licenses (see Debian package).<br>
       Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
     HTML
 
+    version '11' do
+      self.release = '11.0.9'
+      self.root_path = 'index.html'
+      self.base_url = 'https://docs.oracle.com/en/java/javase/11/docs/api/'
+      options[:only_patterns] = [/\Ajava\./]
+    end
+
     version '8' do
       self.release = '8'
 

+ 1 - 3
lib/docs/scrapers/pandas.rb

@@ -62,9 +62,7 @@ module Docs
     end
 
     def get_latest_version(opts)
-      doc = fetch_doc('http://pandas.pydata.org/pandas-docs/stable/', opts)
-      label = doc.at_css('.body > .section > p').content
-      label.scan(/Version: ([0-9.]+)/)[0][0]
+      get_latest_github_release('pandas-dev', 'pandas', opts)
     end
   end
 end

+ 1 - 2
lib/docs/scrapers/perl.rb

@@ -46,8 +46,7 @@ module Docs
 
     def get_latest_version(opts)
       doc = fetch_doc('https://perldoc.perl.org/', opts)
-      header = doc.at_css('h2.h1').content
-      header.scan(/Perl ([0-9.]+)/)[0][0]
+      doc.at_css('#dropdownlink-stable').content
     end
   end
 end

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

@@ -68,9 +68,8 @@ module Docs
     HTML
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://secure.php.net/manual/en/doc.changelog.php', opts)
-      label = doc.at_css('tbody.gen-changelog > tr > td').content
-      label.split(',').last.strip
+      doc = fetch_doc('https://www.php.net/supported-versions.php', opts)
+      doc.at_css('table > tbody > .stable:last-of-type > td > a').content.strip
     end
   end
 end

+ 6 - 1
lib/docs/scrapers/postgresql.rb

@@ -51,10 +51,15 @@ module Docs
       /\Aunsupported-features/ ]
 
     options[:attribution] = <<-HTML
-      &copy; 1996&ndash;2019 The PostgreSQL Global Development Group<br>
+      &copy; 1996&ndash;2020 The PostgreSQL Global Development Group<br>
       Licensed under the PostgreSQL License.
     HTML
 
+    version '13' do
+      self.release = '13.1'
+      self.base_url = "https://www.postgresql.org/docs/#{version}/"
+    end
+
     version '12' do
       self.release = '12.1'
       self.base_url = "https://www.postgresql.org/docs/#{version}/"

+ 5 - 1
lib/docs/scrapers/pug.rb

@@ -3,7 +3,7 @@ module Docs
     self.type = 'pug'
     self.base_url = 'https://pugjs.org/'
     self.root_path = 'api/getting-started.html'
-    self.release = '2.0.3'
+    self.release = '3.0.0'
     self.links = {
       home: 'https://pugjs.org/',
       code: 'https://github.com/pugjs/pug'
@@ -18,6 +18,10 @@ module Docs
       Licensed under the MIT license.
     HTML
 
+    options[:skip_patterns] = [
+      /support/
+    ]
+
     def get_latest_version(opts)
       get_npm_version('pug', opts)
     end

+ 12 - 4
lib/docs/scrapers/python.rb

@@ -23,22 +23,30 @@ module Docs
       Licensed under the PSF License.
     HTML
 
+    # mkdir -p docs/python~3.9 && cd docs/python~3.9 && curl -L https://docs.python.org/3.9/archives/python-3.9.0-docs-html.tar.bz2 | tar xj --strip-components=1
+    version '3.9' do # docs.python.org/3.9/download.html
+      self.release = '3.9.0'
+      self.base_url = 'https://docs.python.org/3.9/'
+
+      html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
+    end
+
     version '3.8' do # docs.python.org/3.8/download.html
-      self.release = '3.8.1'
+      self.release = '3.8.6'
       self.base_url = 'https://docs.python.org/3.8/'
 
       html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
     end
 
     version '3.7' do # docs.python.org/3.7/download.html
-      self.release = '3.7.6'
+      self.release = '3.7.9'
       self.base_url = 'https://docs.python.org/3.7/'
 
       html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
     end
 
     version '3.6' do # docs.python.org/3.6/download.html
-      self.release = '3.6.10'
+      self.release = '3.6.12'
       self.base_url = 'https://docs.python.org/3.6/'
 
       html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
@@ -60,7 +68,7 @@ module Docs
 
     def get_latest_version(opts)
       doc = fetch_doc('https://docs.python.org/', opts)
-      doc.at_css('.version_switcher_placeholder').content
+      doc.at_css('title').content.split(' ')[0]
     end
   end
 end

+ 4 - 0
lib/docs/scrapers/rdoc/ruby.rb

@@ -69,6 +69,10 @@ module Docs
       Licensed under their own licenses.
     HTML
 
+    version '2.7' do
+      self.release = '2.7.2'
+    end
+
     version '2.6' do
       self.release = '2.6.3'
     end

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

@@ -2,7 +2,7 @@ module Docs
   class React < UrlScraper
     self.name = 'React'
     self.type = 'simple'
-    self.release = '16.12.0'
+    self.release = '17.0.1'
     self.base_url = 'https://reactjs.org/docs/'
     self.root_path = 'hello-world.html'
     self.links = {

+ 2 - 2
lib/docs/scrapers/react_native.rb

@@ -32,8 +32,8 @@ module Docs
     HTML
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://facebook.github.io/react-native/docs/getting-started.html', opts)
-      doc.at_css('header > a > h3').content
+      doc = fetch_doc('https://reactnative.dev/docs/getting-started', opts)
+      doc.at_css('meta[name="docsearch:version"]')['content']
     end
   end
 end

+ 1 - 2
lib/docs/scrapers/scikit_learn.rb

@@ -26,8 +26,7 @@ module Docs
     HTML
 
     def get_latest_version(opts)
-      doc = fetch_doc('https://scikit-learn.org/stable/documentation.html', opts)
-      doc.at_css('.body h1').content.scan(/([0-9.]+)/)[0][0]
+      get_latest_github_release('scikit-learn', 'scikit-learn', opts)
     end
   end
 end

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

@@ -2,7 +2,7 @@ module Docs
   class Sqlite < FileScraper
     self.name = 'SQLite'
     self.type = 'sqlite'
-    self.release = '3.30.1'
+    self.release = '3.33.0'
     self.base_url = 'https://sqlite.org/'
     self.root_path = 'docs.html'
     self.initial_paths = %w(keyword_index.html)

+ 1 - 2
lib/docs/scrapers/statsmodels.rb

@@ -22,8 +22,7 @@ module Docs
     HTML
 
     def get_latest_version(opts)
-      doc = fetch_doc('http://www.statsmodels.org/stable/', opts)
-      doc.at_css('.sphinxsidebarwrapper h3 + p > b').content[1..-1]
+      get_latest_github_release('statsmodels', 'statsmodels', opts)
     end
   end
 end

+ 1 - 2
lib/docs/scrapers/vagrant.rb

@@ -20,8 +20,7 @@ module Docs
     HTML
 
     def get_latest_version(opts)
-      contents = get_github_file_contents('hashicorp', 'vagrant', 'website/config.rb', opts)
-      contents.scan(/version\s+=\s+"([0-9.]+)"/)[0][0]
+      get_github_tags('hashicorp', 'vagrant', opts)[0]['name'][1..-1]
     end
   end
 end

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

@@ -1 +1 @@
-http://www.postgresql.org/about/press/presskit93/#logos
+https://www.postgresql.org/about/press/presskit93/#logos

+ 2 - 1
public/icons/docs/ruby/SOURCE

@@ -1 +1,2 @@
-http://commons.wikimedia.org/wiki/File:Ruby_logo.svg
+https://www.ruby-lang.org/en/about/logo/
+https://commons.wikimedia.org/wiki/File:Ruby_logo.svg