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
before_script:
- gem update --system
- gem update bundler
- gem install bundler

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

@ -28,7 +28,7 @@ class app.views.Document extends app.View
return
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) =>
if route is 'settings'

@ -16,8 +16,8 @@ class app.views.Mobile extends app.View
@detect: ->
try
(window.matchMedia('(max-width: 480px)').matches) or
(window.matchMedia('(max-device-width: 767px)').matches) or
(window.matchMedia('(max-device-height: 767px) and (max-device-width: 1024px)').matches) or
(window.matchMedia('(max-width: 767px)').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
# resolution (dpi) into account when reporting device width/height.
(navigator.userAgent.indexOf('Android') isnt -1 and navigator.userAgent.indexOf('Mobile') isnt -1) or

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

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

@ -7,7 +7,7 @@ module Docs
at_css('h1').content = 'Angular Documentation'
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|
node.before(node.children).remove
@ -86,6 +86,14 @@ module Docs
at_css('h1').content = subpath.remove('api/')
end
css('th h3').each do |node|
node.name = 'span'
end
css('code code').each do |node|
node.before(node.children).remove
end
doc
end
end

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

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

@ -11,14 +11,38 @@ module Docs
end
def get_type
if slug.include?('module')
if name =~ /\A[a-z]/ && node = css('.toctree-l2.current').last
"Modules: #{node.content.remove(' Modules')}"
if version == '2.4'
if slug.include?('module')
if name =~ /\A[a-z]/ && node = css('.toctree-l2.current').last
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
'Modules'
end
elsif slug.include?('playbook')
'Playbooks'
elsif slug =~ /\Auser_guide\//
'Guides: User'
elsif slug =~ /\Ascenario_guides\//
'Guides: Scenarios'
elsif slug.include?('guide')
'Guides'
else

@ -2,7 +2,7 @@ module Docs
class ReactNative
class CleanHtmlFilter < Filter
def call
@doc = at_css('.inner-content, article.withtoc')
@doc = at_css('.post')
if root_page?
at_css('h1').content = 'React Native Documentation'
@ -38,6 +38,11 @@ module Docs
node.content = node.content
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|
node.remove if node.content.strip == 'Note:'
end
@ -45,7 +50,7 @@ module Docs
css('h3#props', 'h3#methods').each { |node| node.name = 'h2' }
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
end

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

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

@ -7,15 +7,7 @@ module Docs
code: 'https://github.com/ansible/ansible'
}
html_filters.push 'ansible/entries', 'sphinx/clean_html'
options[:skip] = %w(
glossary.html
faq.html
community.html
tower.html
quickstart.html
list_of_all_modules.html)
html_filters.push 'ansible/entries', 'sphinx/clean_html', 'ansible/clean_html'
options[:attribution] = <<-HTML
&copy; 2012&ndash;2018 Michael DeHaan<br>
@ -23,9 +15,37 @@ module Docs
Licensed under the GNU General Public License version 3.
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
self.release = '2.4.3'
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

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

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

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

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

@ -23,22 +23,22 @@ module Docs
HTML
version do
self.release = '10.1.0'
self.release = '10.4.0'
self.base_url = 'https://nodejs.org/dist/latest-v10.x/docs/api/'
end
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/'
end
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/'
end
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/'
end
end

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

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

@ -2,7 +2,7 @@ module Docs
class ReactNative < UrlScraper
self.slug = '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.root_path = 'getting-started.html'
self.links = {
@ -12,7 +12,7 @@ module Docs
html_filters.push 'react_native/entries', 'react_native/clean_html'
options[:container] = '.documentationContent'
options[:container] = '.docMainWrapper'
options[:skip_patterns] = [/\Asample\-/]
options[:skip] = %w(
videos.html
@ -27,7 +27,7 @@ module Docs
}
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.
HTML
end

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

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

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

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

Loading…
Cancel
Save