History

Fix merge conflicts

Jasper van Merle committed 6 years ago

Commit 7ca18dd2 parents f1b464b 8677f3320 files · +81 −40Browse files

Showing the changes to lib/docs (16 of 20 files). Show all

Unified · Split

16 files
  1. lib/docs/filters/haxe/clean_html.rb +4 −2
  2. lib/docs/filters/jest/entries.rb +1 −0
  3. lib/docs/filters/leaflet/clean_html.rb +7 −7
  4. lib/docs/scrapers/angularjs.rb +7 −2
  5. lib/docs/scrapers/dart.rb +2 −1
  6. lib/docs/scrapers/gnuplot.rb +3 −2
  7. lib/docs/scrapers/go.rb +1 −1
  8. lib/docs/scrapers/haxe.rb +7 −3
  9. lib/docs/scrapers/jest.rb +2 −2
  10. lib/docs/scrapers/leaflet.rb +5 −0
  11. lib/docs/scrapers/lua.rb +7 −2
  12. lib/docs/scrapers/node.rb +6 −1
  13. lib/docs/scrapers/pandas.rb +1 −2
  14. lib/docs/scrapers/postgresql.rb +6 −1
  15. lib/docs/scrapers/python.rb +11 −3
  16. lib/docs/scrapers/sqlite.rb +1 −1
lib/docs/filters/haxe/clean_html.rb+4−2
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Haxe2 class Haxe
3 class CleanHtmlFilter < Filter3 class CleanHtmlFilter < Filter
4 def call4 def call
5 css('.viewsource', 'hr', 'h1 > small', '.inherited-fields').remove5 css('.viewsource', 'hr', 'h1 > small', '.inherited-fields', '.label-meta').remove
6 6
7 css('h4 + h1').each do |node|7 css('h4 + h1').each do |node|
8 node.after(node.previous_element)8 node.after(node.previous_element)
@@ -28,8 +28,10 @@ module Docs · 19 unmodified lines
28 end28 end
29 29
30 css('.field').each do |node|30 css('.field').each do |node|
31 h3 = node.at_css('h3:not(:empty)')
32 next unless h3.present?
31 link = node.at_css('a[name]')33 link = node.at_css('a[name]')
32 node.at_css('h3:not(:empty)')['id'] = link['name']34 h3['id'] = link['name']
33 link.before(link.children).remove35 link.before(link.children).remove
34 node.before(node.children).remove36 node.before(node.children).remove
35 end37 end
lib/docs/filters/jest/entries.rb+1−0
@@ -19,6 +19,7 @@ module Docs · 18 unmodified lines
19 19
20 def additional_entries20 def additional_entries
21 return [] unless !root_page? && self.type == self.name # api page21 return [] unless !root_page? && self.type == self.name # api page
22 return [] if self.slug == 'environment-variables'
22 23
23 entries = []24 entries = []
24 25
lib/docs/filters/leaflet/clean_html.rb+7−7
@@ -8,25 +8,25 @@ module Docs · 7 unmodified lines
8 node.name = 'h2'8 node.name = 'h2'
9 end9 end
10 10
11 at_css('> h2:first-child').name = 'h1'11 # remove "This reference reflects Leaflet"
12 12 css('p:contains("This reference reflects Leaflet")').each do |node|
13 # remove "This reference reflects Leaflet 1.2.0."
14 css('h1 ~ p').each do |node|
15 node.remove13 node.remove
16 break14 break
17 end15 end
18 16
17 at_css('> h2:first-child').name = 'h1'
18
19 css('section', 'code b', '.accordion', '.accordion-overflow', '.accordion-content').each do |node|19 css('section', 'code b', '.accordion', '.accordion-overflow', '.accordion-content').each do |node|
20 node.before(node.children).remove20 node.before(node.children).remove
21 end21 end
22 22
23 css('pre > code').each do |node|23 css('pre > code').each do |node|
24 node['class'] ||= ''24 node['class'] ||= ''
25 lang = if node['class'].include?('lang-html') || node.content =~ /\A</25 lang = if node['class'].include?('lang-html') || node['class'].include?('language-html') || node.content =~ /\A</
26 'html'26 'html'
27 elsif node['class'].include?('lang-css')27 elsif node['class'].include?('lang-css') || node['class'].include?('language-css')
28 'css'28 'css'
29 elsif node['class'].include?('lang-js') || node['class'].include?('lang-javascript')29 elsif node['class'].include?('lang-js') || node['class'].include?('language-js') || node['class'].include?('lang-javascript')
30 'javascript'30 'javascript'
31 end31 end
32 node.parent['data-language'] = lang if lang32 node.parent['data-language'] = lang if lang
lib/docs/scrapers/angularjs.rb+7−2
@@ -38,8 +38,8 @@ module Docs · 37 unmodified lines
38 ]38 ]
39 39
40 options[:attribution] = <<-HTML40 options[:attribution] = <<-HTML
41 &copy; 2010&ndash;2018 Google, Inc.<br>41 &copy; 2010&ndash;2020 Google, Inc.<br>
42 Licensed under the Creative Commons Attribution License 4.0.42 Licensed under the Creative Commons Attribution License 3.0.
43 HTML43 HTML
44 44
45 stub '' do45 stub '' do
@@ -49,6 +49,11 @@ module Docs · 3 unmodified lines
49 capybara.execute_script("return document.querySelector('.side-navigation').innerHTML")49 capybara.execute_script("return document.querySelector('.side-navigation').innerHTML")
50 end50 end
51 51
52 version '1.8' do
53 self.release = '1.8.2'
54 self.base_url = "https://code.angularjs.org/#{release}/docs/partials/"
55 end
56
52 version '1.7' do57 version '1.7' do
53 self.release = '1.7.8'58 self.release = '1.7.8'
54 self.base_url = "https://code.angularjs.org/#{release}/docs/partials/"59 self.base_url = "https://code.angularjs.org/#{release}/docs/partials/"
lib/docs/scrapers/dart.rb+2−1
@@ -32,7 +32,8 @@ module Docs · 31 unmodified lines
32 32
33 def get_latest_version(opts)33 def get_latest_version(opts)
34 doc = fetch_doc('https://api.dartlang.org/', opts)34 doc = fetch_doc('https://api.dartlang.org/', opts)
35 doc.at_css('footer > span').content.sub(/Dart/, '').strip35 label = doc.at_css('footer > span').content.strip
36 label.sub(/Dart\s*/, '')
36 end37 end
37 end38 end
38end39end
lib/docs/scrapers/gnuplot.rb+3−2
@@ -38,8 +38,9 @@ module Docs · 37 unmodified lines
38 HTML38 HTML
39 39
40 def get_latest_version(opts)40 def get_latest_version(opts)
41 doc = fetch_doc('https://sourceforge.net/projects/gnuplot/files/gnuplot/', opts)41 doc = fetch_doc('http://www.gnuplot.info/download.html', opts)
42 doc.at_css('#files_list > tbody > tr:nth-child(2)')['title']42 label = doc.at_css('h2').content.strip
43 label.sub(/[^0-9.]*/, '')
43 end44 end
44 end45 end
45end46end
lib/docs/scrapers/go.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Go < UrlScraper2 class Go < UrlScraper
3 self.type = 'go'3 self.type = 'go'
4 self.release = '1.13'4 self.release = '1.15'
5 self.base_url = 'https://golang.org/pkg/'5 self.base_url = 'https://golang.org/pkg/'
6 self.links = {6 self.links = {
7 home: 'https://golang.org/',7 home: 'https://golang.org/',
lib/docs/scrapers/haxe.rb+7−3
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Haxe < UrlScraper2 class Haxe < UrlScraper
3 self.name = 'Haxe'3 self.name = 'Haxe'
4 self.type = 'simple'4 self.type = 'simple'
5 self.release = '3.4.7'5 self.release = '4.1.3'
6 self.base_url = 'https://api.haxe.org/'6 self.base_url = 'https://api.haxe.org/'
7 7
8 html_filters.push 'haxe/clean_html', 'haxe/entries'8 html_filters.push 'haxe/clean_html', 'haxe/entries'
@@ -10,7 +10,7 @@ module Docs · 1 unmodified line
10 options[:container] = '.span9'10 options[:container] = '.span9'
11 11
12 options[:attribution] = <<-HTML12 options[:attribution] = <<-HTML
13 &copy; 2005&ndash;2018 Haxe Foundation<br>13 &copy; 2005&ndash;2020 Haxe Foundation<br>
14 Licensed under a MIT license.14 Licensed under a MIT license.
15 HTML15 HTML
16 16
@@ -20,7 +20,7 @@ module Docs · 3 unmodified lines
20 code: 'https://github.com/HaxeFoundation/haxe'20 code: 'https://github.com/HaxeFoundation/haxe'
21 }21 }
22 22
23 options[:skip_patterns] = [/\A(?:cpp|cs|flash|java|js|neko|php|python|lua|hl|sys)/i]23 options[:skip_patterns] = [/\A(?:cpp|cs|flash|java|js|neko|php|python|lua|hl|sys|eval)/i]
24 end24 end
25 25
26 version 'C++' do26 version 'C++' do
@@ -67,6 +67,10 @@ module Docs · 40 unmodified lines
67 self.base_url = 'https://api.haxe.org/python/'67 self.base_url = 'https://api.haxe.org/python/'
68 end68 end
69 69
70 version 'Eval' do
71 self.base_url = 'https://api.haxe.org/eval/'
72 end
73
70 def get_latest_version(opts)74 def get_latest_version(opts)
71 doc = fetch_doc('https://api.haxe.org/', opts)75 doc = fetch_doc('https://api.haxe.org/', opts)
72 label = doc.at_css('.container.main-content h1 > small').content76 label = doc.at_css('.container.main-content h1 > small').content
lib/docs/scrapers/jest.rb+2−2
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Jest < UrlScraper2 class Jest < UrlScraper
3 self.type = 'simple'3 self.type = 'simple'
4 self.release = '24.9'4 self.release = '26.6'
5 self.base_url = 'https://jestjs.io/docs/en/'5 self.base_url = 'https://jestjs.io/docs/en/'
6 self.root_path = 'getting-started'6 self.root_path = 'getting-started'
7 self.links = {7 self.links = {
@@ -14,7 +14,7 @@ module Docs · 6 unmodified lines
14 options[:container] = '.docMainWrapper'14 options[:container] = '.docMainWrapper'
15 15
16 options[:attribution] = <<-HTML16 options[:attribution] = <<-HTML
17 &copy; 2019 Facebook, Inc. and its affiliates.<br>17 &copy; 2020 Facebook, Inc.<br>
18 Licensed under the MIT License.18 Licensed under the MIT License.
19 HTML19 HTML
20 20
lib/docs/scrapers/leaflet.rb+5−0
@@ -19,6 +19,11 @@ module Docs · 18 unmodified lines
19 Maps &copy; OpenStreetMap contributors.19 Maps &copy; OpenStreetMap contributors.
20 HTML20 HTML
21 21
22 version '1.7' do
23 self.release = '1.7.1'
24 self.base_url = "https://leafletjs.com/reference-#{release}.html"
25 end
26
22 version '1.6' do27 version '1.6' do
23 self.release = '1.6.0'28 self.release = '1.6.0'
24 self.base_url = "https://leafletjs.com/reference-#{release}.html"29 self.base_url = "https://leafletjs.com/reference-#{release}.html"
lib/docs/scrapers/lua.rb+7−2
@@ -8,12 +8,17 @@ module Docs · 7 unmodified lines
8 options[:skip_links] = true8 options[:skip_links] = true
9 9
10 options[:attribution] = <<-HTML10 options[:attribution] = <<-HTML
11 &copy; 1994&ndash;2017 Lua.org, PUC-Rio.<br>11 &copy; 1994&ndash;2020 Lua.org, PUC-Rio.<br>
12 Licensed under the MIT License.12 Licensed under the MIT License.
13 HTML13 HTML
14 14
15 version '5.4' do
16 self.release = '5.4.1'
17 self.base_url = 'https://www.lua.org/manual/5.4/'
18 end
19
15 version '5.3' do20 version '5.3' do
16 self.release = '5.3.4'21 self.release = '5.3.6'
17 self.base_url = 'https://www.lua.org/manual/5.3/'22 self.base_url = 'https://www.lua.org/manual/5.3/'
18 end23 end
19 24
lib/docs/scrapers/node.rb+6−1
@@ -23,7 +23,12 @@ module Docs · 22 unmodified lines
23 HTML23 HTML
24 24
25 version do25 version do
26 self.release = '12.9.1'26 self.release = '14.15.0'
27 self.base_url = 'https://nodejs.org/dist/latest-v14.x/docs/api/'
28 end
29
30 version '12 LTS' do
31 self.release = '12.19.0'
27 self.base_url = 'https://nodejs.org/dist/latest-v12.x/docs/api/'32 self.base_url = 'https://nodejs.org/dist/latest-v12.x/docs/api/'
28 end33 end
29 34
lib/docs/scrapers/pandas.rb+1−2
@@ -62,8 +62,7 @@ module Docs · 61 unmodified lines
62 end62 end
63 63
64 def get_latest_version(opts)64 def get_latest_version(opts)
65 doc = fetch_doc('http://pandas.pydata.org/pandas-docs/stable/', opts)65 get_latest_github_release('pandas-dev', 'pandas', opts)
66 doc.at_css('#pandas-documentation').content.scan(/Version: ([0-9.]+)/)[0][0]
67 end66 end
68 end67 end
69end68end
lib/docs/scrapers/postgresql.rb+6−1
@@ -51,10 +51,15 @@ module Docs · 50 unmodified lines
51 /\Aunsupported-features/ ]51 /\Aunsupported-features/ ]
52 52
53 options[:attribution] = <<-HTML53 options[:attribution] = <<-HTML
54 &copy; 1996&ndash;2019 The PostgreSQL Global Development Group<br>54 &copy; 1996&ndash;2020 The PostgreSQL Global Development Group<br>
55 Licensed under the PostgreSQL License.55 Licensed under the PostgreSQL License.
56 HTML56 HTML
57 57
58 version '13' do
59 self.release = '13.1'
60 self.base_url = "https://www.postgresql.org/docs/#{version}/"
61 end
62
58 version '12' do63 version '12' do
59 self.release = '12.1'64 self.release = '12.1'
60 self.base_url = "https://www.postgresql.org/docs/#{version}/"65 self.base_url = "https://www.postgresql.org/docs/#{version}/"
lib/docs/scrapers/python.rb+11−3
@@ -23,22 +23,30 @@ module Docs · 22 unmodified lines
23 Licensed under the PSF License.23 Licensed under the PSF License.
24 HTML24 HTML
25 25
26 # 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
27 version '3.9' do # docs.python.org/3.9/download.html
28 self.release = '3.9.0'
29 self.base_url = 'https://docs.python.org/3.9/'
30
31 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
32 end
33
26 version '3.8' do # docs.python.org/3.8/download.html34 version '3.8' do # docs.python.org/3.8/download.html
27 self.release = '3.8.1'35 self.release = '3.8.6'
28 self.base_url = 'https://docs.python.org/3.8/'36 self.base_url = 'https://docs.python.org/3.8/'
29 37
30 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'38 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
31 end39 end
32 40
33 version '3.7' do # docs.python.org/3.7/download.html41 version '3.7' do # docs.python.org/3.7/download.html
34 self.release = '3.7.6'42 self.release = '3.7.9'
35 self.base_url = 'https://docs.python.org/3.7/'43 self.base_url = 'https://docs.python.org/3.7/'
36 44
37 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'45 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
38 end46 end
39 47
40 version '3.6' do # docs.python.org/3.6/download.html48 version '3.6' do # docs.python.org/3.6/download.html
41 self.release = '3.6.10'49 self.release = '3.6.12'
42 self.base_url = 'https://docs.python.org/3.6/'50 self.base_url = 'https://docs.python.org/3.6/'
43 51
44 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'52 html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
lib/docs/scrapers/sqlite.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Sqlite < FileScraper2 class Sqlite < FileScraper
3 self.name = 'SQLite'3 self.name = 'SQLite'
4 self.type = 'sqlite'4 self.type = 'sqlite'
5 self.release = '3.30.1'5 self.release = '3.33.0'
6 self.base_url = 'https://sqlite.org/'6 self.base_url = 'https://sqlite.org/'
7 self.root_path = 'docs.html'7 self.root_path = 'docs.html'
8 self.initial_paths = %w(keyword_index.html)8 self.initial_paths = %w(keyword_index.html)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t