Merge branch 'master' into deploy

* master:
  Update gem dependencies
  Update Angular documentation (6.0.4)
  Update TypeScript documentation (2.9.0)
  Update Erlang documentation (20.3)
  Update webpack documentation (4.12.0)
  Update Sinon.JS documentation (5.1.0)
  Update npm documentation (6.1.0)
  Update React documentation (16.4.0)
  Update Yarn documentation (1.7.0)
  Update CodeceptJS documentation (1.2.1)
  Update Jest documentation (23.1.0)
  Update nginx documentation (1.15.0)
  Update Node.js documentation (10.4.0)
  Add back Ansible 2.4 version + improve scraper
  Fix and upgrade Ansible doc
  Improve ReactNative scraper
  update React Native to 0.55
  Move “DevDocs” in the tab title to after the dynamic portion of the title
  Use browser dimensions for mobile detection
  Fix Travis CI issue
pull/821/head
Thibaut Courouble 7 years ago
commit 8e1c4cfb0b

@ -1,4 +1,4 @@
language: ruby language: ruby
before_script: before_script:
- gem update --system - gem update --system
- gem update bundler - gem install bundler

@ -22,13 +22,13 @@ GEM
erubi (1.7.1) erubi (1.7.1)
ethon (0.11.0) ethon (0.11.0)
ffi (>= 1.3.0) ffi (>= 1.3.0)
eventmachine (1.2.5) eventmachine (1.2.7)
execjs (2.7.0) execjs (2.7.0)
exifr (1.3.3) exifr (1.3.4)
ffi (1.9.23) ffi (1.9.25)
fspath (3.1.0) fspath (3.1.0)
highline (1.7.10) highline (1.7.10)
html-pipeline (2.7.2) html-pipeline (2.8.0)
activesupport (>= 2) activesupport (>= 2)
nokogiri (>= 1.4) nokogiri (>= 1.4)
i18n (1.0.1) i18n (1.0.1)
@ -39,7 +39,7 @@ GEM
image_size (~> 1.5) image_size (~> 1.5)
in_threads (~> 1.3) in_threads (~> 1.3)
progress (~> 3.0, >= 3.0.1) progress (~> 3.0, >= 3.0.1)
image_optim_pack (0.5.0.20180419) image_optim_pack (0.5.1)
fspath (>= 2.1, < 4) fspath (>= 2.1, < 4)
image_optim (~> 0.19) image_optim (~> 0.19)
image_size (1.5.0) image_size (1.5.0)
@ -49,7 +49,7 @@ GEM
minitest (5.11.3) minitest (5.11.3)
multi_json (1.13.1) multi_json (1.13.1)
mustermann (1.0.2) mustermann (1.0.2)
newrelic_rpm (5.0.0.342) newrelic_rpm (5.2.0.345)
nokogiri (1.8.2) nokogiri (1.8.2)
mini_portile2 (~> 2.3.0) mini_portile2 (~> 2.3.0)
options (2.3.2) options (2.3.2)
@ -61,7 +61,7 @@ GEM
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.9.0) method_source (~> 0.9.0)
rack (2.0.5) rack (2.0.5)
rack-protection (2.0.1) rack-protection (2.0.3)
rack rack
rack-test (1.0.0) rack-test (1.0.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
@ -75,17 +75,18 @@ GEM
sass-listen (4.0.0) sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
sinatra (2.0.1) sinatra (2.0.3)
mustermann (~> 1.0) mustermann (~> 1.0)
rack (~> 2.0) rack (~> 2.0)
rack-protection (= 2.0.1) rack-protection (= 2.0.3)
tilt (~> 2.0) tilt (~> 2.0)
sinatra-contrib (2.0.1) sinatra-contrib (2.0.3)
backports (>= 2.0) activesupport (>= 4.0.0)
backports (>= 2.8.2)
multi_json multi_json
mustermann (~> 1.0) mustermann (~> 1.0)
rack-protection (= 2.0.1) rack-protection (= 2.0.3)
sinatra (= 2.0.1) sinatra (= 2.0.3)
tilt (>= 1.3, < 3) tilt (>= 1.3, < 3)
sprockets (3.7.1) sprockets (3.7.1)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
@ -112,9 +113,9 @@ GEM
ethon (>= 0.9.0) ethon (>= 0.9.0)
tzinfo (1.2.5) tzinfo (1.2.5)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (4.1.10) uglifier (4.1.11)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
unicode-display_width (1.3.2) unicode-display_width (1.3.3)
unicode_utils (1.4.0) unicode_utils (1.4.0)
unix_utils (0.0.15) unix_utils (0.0.15)
yajl-ruby (1.4.0) yajl-ruby (1.4.0)

@ -28,7 +28,7 @@ class app.views.Document extends app.View
return return
setTitle: (title) -> setTitle: (title) ->
@el.title = if title then "DevDocs — #{title}" else 'DevDocs API Documentation' @el.title = if title then "#{title} — DevDocs" else 'DevDocs API Documentation'
afterRoute: (route) => afterRoute: (route) =>
if route is 'settings' if route is 'settings'

@ -16,8 +16,8 @@ class app.views.Mobile extends app.View
@detect: -> @detect: ->
try try
(window.matchMedia('(max-width: 480px)').matches) or (window.matchMedia('(max-width: 480px)').matches) or
(window.matchMedia('(max-device-width: 767px)').matches) or (window.matchMedia('(max-width: 767px)').matches) or
(window.matchMedia('(max-device-height: 767px) and (max-device-width: 1024px)').matches) or (window.matchMedia('(max-height: 767px) and (max-width: 1024px)').matches) or
# Need to sniff the user agent because some Android and Windows Phone devices don't take # Need to sniff the user agent because some Android and Windows Phone devices don't take
# resolution (dpi) into account when reporting device width/height. # resolution (dpi) into account when reporting device width/height.
(navigator.userAgent.indexOf('Android') isnt -1 and navigator.userAgent.indexOf('Mobile') isnt -1) or (navigator.userAgent.indexOf('Android') isnt -1 and navigator.userAgent.indexOf('Mobile') isnt -1) or

@ -19,4 +19,6 @@
font-style: italic; font-style: italic;
text-align: right; text-align: right;
} }
td h3 { margin: 0 !important; }
} }

@ -10,6 +10,7 @@
.important { @extend %note-orange; } .important { @extend %note-orange; }
.warning, .deprecated-removed, .deprecated { @extend %note-red; } .warning, .deprecated-removed, .deprecated { @extend %note-red; }
.hint { @extend %note-green; }
.versionmodified, span.title, .topic-title { .versionmodified, span.title, .topic-title {
display: block; display: block;

@ -7,7 +7,7 @@ module Docs
at_css('h1').content = 'Angular Documentation' at_css('h1').content = 'Angular Documentation'
end end
css('br', 'hr', '.material-icons', '.header-link').remove css('br', 'hr', '.material-icons', '.header-link', '.breadcrumb').remove
css('.content', 'article', '.api-header', 'section', '.instance-member').each do |node| css('.content', 'article', '.api-header', 'section', '.instance-member').each do |node|
node.before(node.children).remove node.before(node.children).remove
@ -86,6 +86,14 @@ module Docs
at_css('h1').content = subpath.remove('api/') at_css('h1').content = subpath.remove('api/')
end end
css('th h3').each do |node|
node.name = 'span'
end
css('code code').each do |node|
node.before(node.children).remove
end
doc doc
end end
end end

@ -16,6 +16,8 @@ module Docs
node.next_element.content.remove('@angular/') node.next_element.content.remove('@angular/')
elsif at_css('.api-type-label.module') elsif at_css('.api-type-label.module')
name.split('/').first name.split('/').first
elsif slug.start_with?('api/')
slug.split('/').second
else else
'Miscellaneous' 'Miscellaneous'
end end

@ -4,6 +4,10 @@ module Docs
def call def call
@doc = at_css('#page-content') @doc = at_css('#page-content')
css('font').each do |node|
node.before(node.children).remove
end
doc doc
end end
end end

@ -11,14 +11,38 @@ module Docs
end end
def get_type def get_type
if version == '2.4'
if slug.include?('module') if slug.include?('module')
if name =~ /\A[a-z]/ && node = css('.toctree-l2.current').last if name =~ /\A[a-z]/ && node = css('.toctree-l2.current').last
"Modules: #{node.content.remove(' Modules')}" return "Modules: #{node.content.remove(' Modules')}"
else
return 'Modules'
end
end
end
if slug =~ /\Acli\//
'CLI Reference'
elsif slug =~ /\Anetwork\//
'Network'
elsif slug =~ /\Aplugins\//
if name =~ /\A[a-z]/ && node = css('.toctree-l3.current').last
"Plugins: #{node.content.sub(/ Plugins.*/, '')}"
else
'Plugins'
end
elsif slug =~ /\Amodules\//
if slug =~ /\Amodules\/list_/ || slug=~ /_maintained\z/
'Modules: Categories'
else else
'Modules' 'Modules'
end end
elsif slug.include?('playbook') elsif slug.include?('playbook')
'Playbooks' 'Playbooks'
elsif slug =~ /\Auser_guide\//
'Guides: User'
elsif slug =~ /\Ascenario_guides\//
'Guides: Scenarios'
elsif slug.include?('guide') elsif slug.include?('guide')
'Guides' 'Guides'
else else

@ -2,7 +2,7 @@ module Docs
class ReactNative class ReactNative
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
@doc = at_css('.inner-content, article.withtoc') @doc = at_css('.post')
if root_page? if root_page?
at_css('h1').content = 'React Native Documentation' at_css('h1').content = 'React Native Documentation'
@ -38,6 +38,11 @@ module Docs
node.content = node.content node.content = node.content
end end
css('pre > code.hljs').each do |node|
node.parent['data-language'] = 'jsx'
node.before(node.children).remove
end
css('blockquote > p:first-child').each do |node| css('blockquote > p:first-child').each do |node|
node.remove if node.content.strip == 'Note:' node.remove if node.content.strip == 'Note:'
end end
@ -45,7 +50,7 @@ module Docs
css('h3#props', 'h3#methods').each { |node| node.name = 'h2' } css('h3#props', 'h3#methods').each { |node| node.name = 'h2' }
css('h4.propTitle').each { |node| node.name = 'h3' } css('h4.propTitle').each { |node| node.name = 'h3' }
css('> div > div', '> div', 'div > span', '.props', '.prop').each do |node| css('> div > div', '> div', 'div > span', '.props', '.prop', '> article', '.postHeader', '.web-player').each do |node|
node.before(node.children).remove node.before(node.children).remove
end end

@ -12,9 +12,9 @@ module Docs
end end
def get_type def get_type
link = at_css('.nav-docs-section .active, .toc .active') link = at_css('.navItemActive')
return 'Miscellaneous' unless link return 'Miscellaneous' unless link
section = link.ancestors('.nav-docs-section, section').first section = link.ancestors('.navGroup').first
type = section.at_css('h3').content.strip type = section.at_css('h3').content.strip
type = REPLACE_TYPES[type] || type type = REPLACE_TYPES[type] || type
type += ": #{name}" if type == 'Components' type += ": #{name}" if type == 'Components'
@ -22,15 +22,13 @@ module Docs
end end
def additional_entries def additional_entries
css('.props > .prop > .propTitle', '.props > .prop > .methodTitle').each_with_object [] do |node, entries| css('.mainContainer h3').each_with_object [] do |node, entries|
name = node.children.find(&:text?).try(:content) subname = node.text
next if name.blank? next if subname.blank? || node.css('code').empty?
sep = node.content.include?('static') ? '.' : '#' sep = subname.include?('()') ? '.' : '#'
name.prepend(self.name + sep) subname.prepend(name + sep)
name << '()' if node['class'].include?('methodTitle') id = node.at_css('.anchor')['id']
name.remove! %r{\??\:\s*\z} entries << [subname, id]
id = node.at_css('.anchor')['name']
entries << [name, id]
end end
end end
end end

@ -59,7 +59,7 @@ module Docs
end end
version do version do
self.release = '5.2.9' self.release = '6.0.4'
self.base_url = 'https://angular.io/' self.base_url = 'https://angular.io/'
self.root_path = 'docs' self.root_path = 'docs'
@ -78,6 +78,26 @@ module Docs
include Docs::Angular::Common include Docs::Angular::Common
end end
version '5' do
self.release = '5.2.11'
self.base_url = 'https://v5.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 '4' do version '4' do
self.release = '4.4.6' self.release = '4.4.6'
self.base_url = 'https://v4.angular.io/' self.base_url = 'https://v4.angular.io/'

@ -7,15 +7,7 @@ module Docs
code: 'https://github.com/ansible/ansible' code: 'https://github.com/ansible/ansible'
} }
html_filters.push 'ansible/entries', 'sphinx/clean_html' html_filters.push 'ansible/entries', 'sphinx/clean_html', 'ansible/clean_html'
options[:skip] = %w(
glossary.html
faq.html
community.html
tower.html
quickstart.html
list_of_all_modules.html)
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2012&ndash;2018 Michael DeHaan<br> &copy; 2012&ndash;2018 Michael DeHaan<br>
@ -23,9 +15,37 @@ module Docs
Licensed under the GNU General Public License version 3. Licensed under the GNU General Public License version 3.
HTML HTML
version '2.5' do
self.release = '2.5.3'
self.base_url = 'https://docs.ansible.com/ansible/2.5/'
options[:skip] = %w(
installation_guide/index.html
reference_appendices/glossary.html
reference_appendices/faq.html
reference_appendices/tower.html
user_guide/quickstart.html
modules/modules_by_category.html
modules/list_of_all_modules.html)
options[:skip_patterns] = [
/\Acommunity.*/i,
/\Adev_guide.*/i,
/\Aroadmap.*/i,
]
end
version '2.4' do version '2.4' do
self.release = '2.4.3' self.release = '2.4.3'
self.base_url = 'https://docs.ansible.com/ansible/2.4/' self.base_url = 'https://docs.ansible.com/ansible/2.4/'
options[:skip] = %w(
glossary.html
faq.html
community.html
tower.html
quickstart.html
list_of_all_modules.html)
end end
end end
end end

@ -3,7 +3,7 @@ module Docs
self.name = 'CodeceptJS' self.name = 'CodeceptJS'
self.type = 'codeceptjs' self.type = 'codeceptjs'
self.root_path = 'index.html' self.root_path = 'index.html'
self.release = '1.1.7' self.release = '1.2.1'
self.base_url = 'https://codecept.io/' self.base_url = 'https://codecept.io/'
self.links = { self.links = {
home: 'https://codecept.io/', home: 'https://codecept.io/',

@ -41,7 +41,7 @@ module Docs
HTML HTML
version '20' do version '20' do
self.release = '20.2' self.release = '20.3'
self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang20' self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang20'
end end

@ -1,7 +1,7 @@
module Docs module Docs
class Jest < UrlScraper class Jest < UrlScraper
self.type = 'jest' self.type = 'jest'
self.release = '22.4.2' self.release = '23.1.0'
self.base_url = 'https://facebook.github.io/jest/docs/en/' self.base_url = 'https://facebook.github.io/jest/docs/en/'
self.root_path = 'getting-started.html' self.root_path = 'getting-started.html'
self.links = { self.links = {

@ -2,7 +2,7 @@ module Docs
class Nginx < UrlScraper class Nginx < UrlScraper
self.name = 'nginx' self.name = 'nginx'
self.type = 'nginx' self.type = 'nginx'
self.release = '1.14.0' self.release = '1.15.0'
self.base_url = 'https://nginx.org/en/docs/' self.base_url = 'https://nginx.org/en/docs/'
self.links = { self.links = {
home: 'https://nginx.org/', home: 'https://nginx.org/',

@ -23,22 +23,22 @@ module Docs
HTML HTML
version do version do
self.release = '10.1.0' self.release = '10.4.0'
self.base_url = 'https://nodejs.org/dist/latest-v10.x/docs/api/' self.base_url = 'https://nodejs.org/dist/latest-v10.x/docs/api/'
end end
version '8 LTS' do version '8 LTS' do
self.release = '8.11.1' self.release = '8.11.2'
self.base_url = 'https://nodejs.org/dist/latest-v8.x/docs/api/' self.base_url = 'https://nodejs.org/dist/latest-v8.x/docs/api/'
end end
version '6 LTS' do version '6 LTS' do
self.release = '6.13.1' self.release = '6.14.2'
self.base_url = 'https://nodejs.org/dist/latest-v6.x/docs/api/' self.base_url = 'https://nodejs.org/dist/latest-v6.x/docs/api/'
end end
version '4 LTS' do version '4 LTS' do
self.release = '4.8.7' self.release = '4.9.1'
self.base_url = 'https://nodejs.org/dist/latest-v4.x/docs/api/' self.base_url = 'https://nodejs.org/dist/latest-v4.x/docs/api/'
end end
end end

@ -2,7 +2,7 @@ module Docs
class Npm < UrlScraper class Npm < UrlScraper
self.name = 'npm' self.name = 'npm'
self.type = 'npm' self.type = 'npm'
self.release = '6.0.0' self.release = '6.1.0'
self.base_url = 'https://docs.npmjs.com/' self.base_url = 'https://docs.npmjs.com/'
self.force_gzip = true self.force_gzip = true
self.links = { self.links = {

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

@ -2,7 +2,7 @@ module Docs
class ReactNative < UrlScraper class ReactNative < UrlScraper
self.slug = 'react_native' self.slug = 'react_native'
self.type = 'react_native' self.type = 'react_native'
self.release = '0.49' self.release = '0.55'
self.base_url = 'https://facebook.github.io/react-native/docs/' self.base_url = 'https://facebook.github.io/react-native/docs/'
self.root_path = 'getting-started.html' self.root_path = 'getting-started.html'
self.links = { self.links = {
@ -12,7 +12,7 @@ module Docs
html_filters.push 'react_native/entries', 'react_native/clean_html' html_filters.push 'react_native/entries', 'react_native/clean_html'
options[:container] = '.documentationContent' options[:container] = '.docMainWrapper'
options[:skip_patterns] = [/\Asample\-/] options[:skip_patterns] = [/\Asample\-/]
options[:skip] = %w( options[:skip] = %w(
videos.html videos.html
@ -27,7 +27,7 @@ module Docs
} }
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2015&ndash;2017 Facebook Inc.<br> &copy; 2015&ndash;2018 Facebook Inc.<br>
Licensed under the Creative Commons Attribution 4.0 International Public License. Licensed under the Creative Commons Attribution 4.0 International Public License.
HTML HTML
end end

@ -19,7 +19,7 @@ module Docs
HTML HTML
version '5' do version '5' do
self.release = '5.0.7' self.release = '5.1.0'
self.base_url = "http://sinonjs.org/releases/v#{release}/" self.base_url = "http://sinonjs.org/releases/v#{release}/"
end end

@ -2,7 +2,7 @@ module Docs
class Typescript < UrlScraper class Typescript < UrlScraper
self.name = 'TypeScript' self.name = 'TypeScript'
self.type = 'typescript' self.type = 'typescript'
self.release = '2.8.3' self.release = '2.9.0'
self.base_url = 'https://www.typescriptlang.org/docs/' self.base_url = 'https://www.typescriptlang.org/docs/'
self.root_path = 'tutorial.html' self.root_path = 'tutorial.html'
self.links = { self.links = {

@ -4,7 +4,7 @@ module Docs
self.type = 'webpack' self.type = 'webpack'
version do version do
self.release = '4.8.3' self.release = '4.12.0'
self.base_url = 'https://webpack.js.org/' self.base_url = 'https://webpack.js.org/'
self.root_path = 'guides/' self.root_path = 'guides/'
self.initial_paths = %w( self.initial_paths = %w(

@ -1,7 +1,7 @@
module Docs module Docs
class Yarn < UrlScraper class Yarn < UrlScraper
self.type = 'yarn' self.type = 'yarn'
self.release = '1.6.0' self.release = '1.7.0'
self.base_url = 'https://yarnpkg.com/en/docs/' self.base_url = 'https://yarnpkg.com/en/docs/'
self.links = { self.links = {
home: 'https://yarnpkg.com/', home: 'https://yarnpkg.com/',

Loading…
Cancel
Save