diff --git a/Gemfile.lock b/Gemfile.lock index 9913765b..0f2d1325 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,7 +28,7 @@ GEM ffi (1.9.25) fspath (3.1.0) highline (1.7.10) - html-pipeline (2.8.0) + html-pipeline (2.8.3) activesupport (>= 2) nokogiri (>= 1.4) i18n (1.0.1) @@ -50,7 +50,7 @@ GEM multi_json (1.13.1) mustermann (1.0.2) newrelic_rpm (5.2.0.345) - nokogiri (1.8.2) + nokogiri (1.8.4) mini_portile2 (~> 2.3.0) options (2.3.2) progress (3.4.0) @@ -88,7 +88,7 @@ GEM rack-protection (= 2.0.3) sinatra (= 2.0.3) tilt (>= 1.3, < 3) - sprockets (3.7.1) + sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-helpers (1.2.1) @@ -113,7 +113,7 @@ GEM ethon (>= 0.9.0) tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (4.1.11) + uglifier (4.1.14) execjs (>= 0.3.0, < 3) unicode-display_width (1.3.3) unicode_utils (1.4.0) diff --git a/assets/images/docs-2.png b/assets/images/docs-2.png index a1758a0e..d096eaa2 100644 Binary files a/assets/images/docs-2.png and b/assets/images/docs-2.png differ diff --git a/assets/images/docs-2@2x.png b/assets/images/docs-2@2x.png index b2d719c2..961063eb 100644 Binary files a/assets/images/docs-2@2x.png and b/assets/images/docs-2@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index 40ded15e..37bba8ec 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,7 +1,10 @@ [ [ + "2018-07-08", + "New documentations: Leaflet, Terraform and Koa" + ], [ "2018-03-26", - "DevDocs is joining the freeCodeCamp community. Read the announcement here." + "DevDocs is joining the freeCodeCamp community. Read the announcement here." ], [ "2018-02-04", "New documentations: Babel, Jekyll and JSDoc" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 35905385..fef9a024 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -365,6 +365,11 @@ credits = [ 'Steven Sanderson, the Knockout.js team, and other contributors', 'MIT', 'https://raw.githubusercontent.com/knockout/knockout/master/LICENSE' + ], [ + 'Koa', + '2018 Koa contributors', + 'MIT', + 'https://raw.githubusercontent.com/koajs/koa/master/LICENSE' ], [ 'Kotlin', '2010-2018 JetBrains s.r.o.', @@ -375,6 +380,11 @@ credits = [ 'Taylor Otwell', 'MIT', 'https://raw.githubusercontent.com/laravel/framework/master/LICENSE.txt' + ], [ + 'Leaflet', + '2010-2018 Vladimir Agafonkin
© 2010-2011, CloudMade
Maps © OpenStreetMap contributors.', + 'BSD', + 'https://raw.githubusercontent.com/Leaflet/Leaflet/master/LICENSE' ], [ 'Less', '2009-2016 The Core Less Team', @@ -553,8 +563,8 @@ credits = [ ], [ 'React, React Native, Flow, Relay', '2013-present Facebook Inc.', - 'CC BY', - 'https://raw.githubusercontent.com/reactjs/reactjs.org/master/LICENSE-DOCS.md' + 'MIT', + 'https://raw.githubusercontent.com/facebook/react/master/LICENSE' ], [ 'Redis', '2009-2018 Salvatore Sanfilippo', @@ -640,6 +650,11 @@ credits = [ '2018 The TensorFlow Authors', 'CC BY', 'https://creativecommons.org/licenses/by/3.0/' + ], [ + 'Terraform', + '2018 HashiCorp', + 'MPL', + 'https://raw.githubusercontent.com/hashicorp/terraform-website/master/LICENSE.md' ], [ 'Twig', '2009-2017 The Twig Team', diff --git a/assets/javascripts/views/content/content.coffee b/assets/javascripts/views/content/content.coffee index 7cf99409..8c5ba874 100644 --- a/assets/javascripts/views/content/content.coffee +++ b/assets/javascripts/views/content/content.coffee @@ -19,7 +19,10 @@ class app.views.Content extends app.View after: 'afterRoute' init: -> - @scrollEl = if app.isMobile() then document.body else @el + @scrollEl = if app.isMobile() + (document.scrollingElement || document.body) + else + @el @scrollMap = {} @scrollStack = [] diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss index c8dc1f8f..4500f90f 100644 --- a/assets/stylesheets/application-dark.css.scss +++ b/assets/stylesheets/application-dark.css.scss @@ -79,6 +79,7 @@ 'pages/phpunit', 'pages/postgres', 'pages/pug', + 'pages/python', 'pages/ramda', 'pages/rdoc', 'pages/react_native', @@ -95,6 +96,7 @@ 'pages/support_tables', 'pages/tcl_tk', 'pages/tensorflow', + 'pages/terraform', 'pages/underscore', 'pages/vue', 'pages/webpack', diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 26e0b885..f7321135 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -79,6 +79,7 @@ 'pages/phpunit', 'pages/postgres', 'pages/pug', + 'pages/python', 'pages/ramda', 'pages/rdoc', 'pages/react_native', @@ -95,6 +96,7 @@ 'pages/support_tables', 'pages/tcl_tk', 'pages/tensorflow', + 'pages/terraform', 'pages/underscore', 'pages/vue', 'pages/webpack', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index a4ae5bf1..d7e24591 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -93,6 +93,7 @@ ._icon-svg:before { background-position: -5rem -5rem; } ._icon-marionette:before { background-position: -6rem -5rem; } ._icon-jsdoc:before, +._icon-koa:before, ._icon-mongoose:before { background-position: -7rem -5rem; } ._icon-phpunit:before { background-position: -8rem -5rem; } ._icon-nokogiri:before { background-position: -9rem -5rem; @extend %darkIconFix !optional; } @@ -170,3 +171,5 @@ ._icon-homebrew:before { background-position: 0 -3rem; @extend %doc-icon-2; } ._icon-jekyll:before { background-position: -1rem -3rem; @extend %doc-icon-2; } ._icon-babel:before { background-position: -2rem -3rem; @extend %doc-icon-2; } +._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; } +._icon-terraform:before { background-position: -4rem -3rem; @extend %doc-icon-2; } diff --git a/assets/stylesheets/pages/_python.scss b/assets/stylesheets/pages/_python.scss new file mode 100644 index 00000000..78f2d4db --- /dev/null +++ b/assets/stylesheets/pages/_python.scss @@ -0,0 +1,6 @@ +._python { + @extend %sphinx; + + h2 > a, h3 > a, dt[id] > a.external, dt[id] > a.internal { float: none !important; } + } + diff --git a/assets/stylesheets/pages/_terraform.scss b/assets/stylesheets/pages/_terraform.scss new file mode 100644 index 00000000..6b3123aa --- /dev/null +++ b/assets/stylesheets/pages/_terraform.scss @@ -0,0 +1,4 @@ +._terraform { + @extend %simple; + .note, .alert { @extend %note; } +} diff --git a/lib/docs/filters/crystal/clean_html.rb b/lib/docs/filters/crystal/clean_html.rb index 3cfa0174..94f3f253 100644 --- a/lib/docs/filters/crystal/clean_html.rb +++ b/lib/docs/filters/crystal/clean_html.rb @@ -16,7 +16,7 @@ module Docs end def api - @doc = at_css('#main-content') + @doc = at_css('.main-content') at_css('h1 + p').remove if root_page? diff --git a/lib/docs/filters/crystal/entries.rb b/lib/docs/filters/crystal/entries.rb index a2449e19..3a54e3c6 100644 --- a/lib/docs/filters/crystal/entries.rb +++ b/lib/docs/filters/crystal/entries.rb @@ -32,7 +32,7 @@ module Docs if hierarchy && hierarchy.content.include?('Exception') 'Exceptions' else - type = at_css('#types-list > ul > .current > a').content + type = at_css('.types-list > ul > .current > a').content type = 'Float' if type.start_with?('Float') type = 'Int' if type.start_with?('Int') type = 'UInt' if type.start_with?('UInt') diff --git a/lib/docs/filters/dom/entries.rb b/lib/docs/filters/dom/entries.rb index 6d2e2ce3..305b32a3 100644 --- a/lib/docs/filters/dom/entries.rb +++ b/lib/docs/filters/dom/entries.rb @@ -55,6 +55,7 @@ module Docs 'Web Workers' => 'Web Workers', 'WebGL' => 'WebGL', 'WebRTC' => 'WebRTC', + 'WebUSB' => 'WebUSB', 'WebVR' => 'WebVR' } TYPE_BY_NAME_STARTS_WITH = { @@ -126,6 +127,7 @@ module Docs 'URL' => 'URL', 'VR' => 'WebVR', 'WebSocket' => 'Web Sockets', + 'USB' => 'WebUSB', 'window' => 'Window', 'Window' => 'Window', 'XMLHttpRequest' => 'XMLHTTPRequest' } diff --git a/lib/docs/filters/github/clean_html.rb b/lib/docs/filters/github/clean_html.rb index 80c8ea99..4d6da240 100644 --- a/lib/docs/filters/github/clean_html.rb +++ b/lib/docs/filters/github/clean_html.rb @@ -9,7 +9,7 @@ module Docs css('.highlight > pre').each do |node| node['data-language'] = node.parent['class'][/highlight-source-(\w+)/, 1] - node.content = node.content.strip_heredoc.gsub(' ', ' ') + node.content = node.content.strip_heredoc node.parent.replace(node) end diff --git a/lib/docs/filters/jest/clean_html.rb b/lib/docs/filters/jest/clean_html.rb index 394316b6..d1ced3f3 100644 --- a/lib/docs/filters/jest/clean_html.rb +++ b/lib/docs/filters/jest/clean_html.rb @@ -12,12 +12,13 @@ module Docs node.before(node.children).remove end - css('.anchor[name]').each do |node| - node.parent['id'] = node['name'] + css('.anchor').each do |node| + node.parent['id'] = node['id'] node.remove end css('pre').each do |node| + node['data-language'] = 'js' node['data-language'] = node['class'][/language-(\w+)/, 1] if node['class'] node.content = node.content end diff --git a/lib/docs/filters/jest/entries.rb b/lib/docs/filters/jest/entries.rb index e90f51ca..f87e4f77 100644 --- a/lib/docs/filters/jest/entries.rb +++ b/lib/docs/filters/jest/entries.rb @@ -6,7 +6,7 @@ module Docs end def get_type - type = at_css('.navItemActive').ancestors('.navGroup').first.at_css('h3').content + type = at_css('.navListItemActive').ancestors('.navGroup').first.at_css('h3').content if type == 'Introduction' 'Guides: Introduction' diff --git a/lib/docs/filters/koa/clean_html.rb b/lib/docs/filters/koa/clean_html.rb new file mode 100644 index 00000000..7fbbdcfe --- /dev/null +++ b/lib/docs/filters/koa/clean_html.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Docs + class Koa + class CleanHtmlFilter < Filter + def call + fix_homepage if slug.start_with? 'api/index' + + css('[data-language=shell]').each do |node| + node['data-language'] = 'bash' + end + + doc + end + + def fix_homepage + # Shrink the headers + for n in (1..5).to_a.reverse + css("h#{n}").each do |header| + header.name = "h#{n+1}" + end + end + + # Add an introduction + doc.children.before <<-HTML.strip_heredoc +

Koa

+ +

Introduction

+

+ Expressive HTTP middleware framework for node.js to make web applications and APIs more enjoyable to write. Koa's middleware stack flows in a stack-like manner, allowing you to perform actions downstream then filter and manipulate the response upstream. +

+

+ Only methods that are common to nearly all HTTP servers are integrated directly into Koa's small ~570 SLOC codebase. This includes things like content negotiation, normalization of node inconsistencies, redirection, and a few others. +

+

+ Koa is not bundled with any middleware. +

+ HTML + end + end + end +end diff --git a/lib/docs/filters/koa/entries.rb b/lib/docs/filters/koa/entries.rb new file mode 100644 index 00000000..6e237371 --- /dev/null +++ b/lib/docs/filters/koa/entries.rb @@ -0,0 +1,36 @@ +module Docs + class Koa + class EntriesFilter < Docs::EntriesFilter + @root_type = 'Koa' + def get_name + at_css('h1').content + end + + def additional_entries + return [] unless slug.match?(/^api/) + type = get_name + css('h2, h3').to_a + .delete_if do |node| + node.content == 'API' || + (slug.include?('index') && !node.content.include?('.')) + end + .map do |node| + name = node.content.strip.sub(/\(.*\)\z/, '()') + type = 'API' if type == @root_type && name.include?('.') + [name, node['id'], type] + end + end + + def get_type + case slug + when /^api\/index/ + 'API' + when /^api/ + get_name + else + 'Guides' + end + end + end + end +end diff --git a/lib/docs/filters/leaflet/clean_html.rb b/lib/docs/filters/leaflet/clean_html.rb new file mode 100644 index 00000000..802463de --- /dev/null +++ b/lib/docs/filters/leaflet/clean_html.rb @@ -0,0 +1,40 @@ +module Docs + class Leaflet + class CleanHtmlFilter < Filter + def call + css('#toc', '.expander', '.footer').remove + + css('h1').each do |node| + 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| + node.remove + break + end + + 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 code > b').first.content + if subtype && subtype.end_with?(' options') + name = "#{subtype}: #{value}" + elsif subtype + name = "#{type} #{subtype.downcase}: #{value}" + else + name = "#{type}: #{value}" + end + entries << [name, node['id'], type] + end + end + + entries + end + end + end +end diff --git a/lib/docs/filters/react_native/entries.rb b/lib/docs/filters/react_native/entries.rb index 54583368..71a55ece 100644 --- a/lib/docs/filters/react_native/entries.rb +++ b/lib/docs/filters/react_native/entries.rb @@ -12,7 +12,7 @@ module Docs end def get_type - link = at_css('.navItemActive') + link = at_css('.navListItemActive') return 'Miscellaneous' unless link section = link.ancestors('.navGroup').first type = section.at_css('h3').content.strip diff --git a/lib/docs/filters/svg/entries.rb b/lib/docs/filters/svg/entries.rb index aebdeb76..b1fbfe9c 100644 --- a/lib/docs/filters/svg/entries.rb +++ b/lib/docs/filters/svg/entries.rb @@ -3,8 +3,8 @@ module Docs class EntriesFilter < Docs::EntriesFilter def get_name name = super - name.gsub!('Element.', '').try(:downcase!) - name.gsub!('Attribute.', '').try(:downcase!) + name.gsub!('Element.', '') + name.gsub!('Attribute.', '') name.gsub!('Tutorial.', '') name.gsub!('_', '') diff --git a/lib/docs/filters/terraform/clean_html.rb b/lib/docs/filters/terraform/clean_html.rb new file mode 100644 index 00000000..7d662293 --- /dev/null +++ b/lib/docs/filters/terraform/clean_html.rb @@ -0,0 +1,33 @@ +module Docs + class Terraform + class CleanHtmlFilter < Filter + def call + @doc = at_css('#inner') + + css('hr', 'a.anchor').remove + + css('.alert').each do |node| + node.name = 'blockquote' + end + + css('pre').each do |node| + if language = node['class'][/(json|shell|ruby)/, 1] + node['data-language'] = language + end + # HCL isn't currently supported by Prism, Ruby syntax does an acceptable job for now + if language = node['class'][/(hcl)/, 1] + node['data-language'] = 'ruby' + end + node.content = node.content + node.remove_attribute('class') + end + + css('.highlight').each do |node| + node.before(node.children).remove + end + + doc + end + end + end +end diff --git a/lib/docs/filters/terraform/entries.rb b/lib/docs/filters/terraform/entries.rb new file mode 100644 index 00000000..486edac9 --- /dev/null +++ b/lib/docs/filters/terraform/entries.rb @@ -0,0 +1,76 @@ +module Docs + class Terraform + class EntriesFilter < Docs::EntriesFilter + + # Some providers have non-trivial mappings between the directory they live in and their name + # Anything *not* in this list will be capitalized instead. + PROVIDER_NAME_MAP = { + 'aws' => 'AWS', + 'azure' => 'Azure (Legacy)', + 'azurerm' => 'Azure', + 'centurylinkcloud' => 'CenturyLinkCloud', + 'cloudscale' => 'CloudScale.ch', + 'cloudstack' => 'CloudStack', + 'dme' => 'DNSMadeEasy', + 'dns' => 'DNS', + 'dnsimple' => 'DNSimple', + 'do' => 'DigitalOcean', + 'github' => 'GitHub', + 'google' => 'Google Cloud', + 'http' => 'HTTP', + 'mysql' => 'MySQL', + 'newrelic' => 'New Relic', + 'oneandone' => '1&1', + 'opentelekomcloud' => 'OpenTelekomCloud', + 'opsgenie' => 'OpsGenie', + 'opc' => 'Oracle Public Cloud', + 'oraclepaas' => 'Oracle Cloud Platform', + 'ovh' => 'OVH', + 'pagerduty' => 'PagerDuty', + 'panos' => 'Palo Alto Networks', + 'postgresql' => 'PostgreSQL', + 'powerdns' => 'PowerDNS', + 'profitbricks' => 'ProfitBricks', + 'rabbitmq' => 'RabbitMQ', + 'softlayer' => 'SoftLayer', + 'statuscake' => 'StatusCake', + 'tls' => 'TLS', + 'ultradns' => 'UltraDNS', + 'vcd' => 'VMware vCloud Director', + 'nsxt' => 'VMware NSX-T', + 'vsphere' => 'VMware vSphere', + } + + # Some providers have a lot (> 100) entries, which makes browsing them unwieldy. + # Any present in the list below will have an extra set of types added, breaking the pages out into the different + # products they offer. + LARGE_PROVIDERS = { + "aws" => true, + "azurerm" => true, + "google" => true, + } + + + def get_name + name ||= at_css('#inner h1').content + name.remove! "ยป " + name.remove! "Data Source: " + name + end + + def get_type + category, subcategory, subfolder, page = *slug.split('/') + provider = page ? subcategory : category + nice_provider = PROVIDER_NAME_MAP[provider] || provider.capitalize + + if LARGE_PROVIDERS[provider] + category_node = at_css('ul > li > ul > li.active') + parent_node = category_node.parent.previous_element if category_node + nice_provider = nice_provider + ": #{parent_node.content}" if category_node + end + + nice_provider + end + end + end +end diff --git a/lib/docs/scrapers/ansible.rb b/lib/docs/scrapers/ansible.rb index 2ac3ee6f..6292b83c 100644 --- a/lib/docs/scrapers/ansible.rb +++ b/lib/docs/scrapers/ansible.rb @@ -15,6 +15,26 @@ module Docs Licensed under the GNU General Public License version 3. HTML + version '2.6' do + self.release = '2.6.1' + self.base_url = 'https://docs.ansible.com/ansible/2.6/' + + 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.5' do self.release = '2.5.3' self.base_url = 'https://docs.ansible.com/ansible/2.5/' diff --git a/lib/docs/scrapers/codeceptjs.rb b/lib/docs/scrapers/codeceptjs.rb index c30a4a59..6fd2798c 100644 --- a/lib/docs/scrapers/codeceptjs.rb +++ b/lib/docs/scrapers/codeceptjs.rb @@ -3,7 +3,7 @@ module Docs self.name = 'CodeceptJS' self.type = 'codeceptjs' self.root_path = 'index.html' - self.release = '1.2.1' + self.release = '1.3.1' self.base_url = 'https://codecept.io/' self.links = { home: 'https://codecept.io/', diff --git a/lib/docs/scrapers/crystal.rb b/lib/docs/scrapers/crystal.rb index 1e95e540..bf8e8392 100644 --- a/lib/docs/scrapers/crystal.rb +++ b/lib/docs/scrapers/crystal.rb @@ -1,7 +1,7 @@ module Docs class Crystal < UrlScraper self.type = 'crystal' - self.release = '0.24.1' + self.release = '0.25.1' self.base_url = 'https://crystal-lang.org/' self.root_path = "api/#{release}/index.html" self.initial_paths = %w(docs/index.html) @@ -29,7 +29,7 @@ module Docs HTML else <<-HTML - © 2012–2017 Manas Technology Solutions.
+ © 2012–2018 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0. HTML end diff --git a/lib/docs/scrapers/d.rb b/lib/docs/scrapers/d.rb index c6d151d7..0cf41a9f 100644 --- a/lib/docs/scrapers/d.rb +++ b/lib/docs/scrapers/d.rb @@ -2,7 +2,7 @@ module Docs class D < UrlScraper include MultipleBaseUrls - self.release = '2.080.0' + self.release = '2.081.0' self.type = 'd' self.base_urls = ['https://dlang.org/phobos/', 'https://dlang.org/spec/'] self.root_path = 'index.html' diff --git a/lib/docs/scrapers/django.rb b/lib/docs/scrapers/django.rb index 37f3270a..cfedac46 100644 --- a/lib/docs/scrapers/django.rb +++ b/lib/docs/scrapers/django.rb @@ -35,7 +35,7 @@ module Docs HTML version '2.0' do - self.release = '2.0.5' + self.release = '2.0.7' self.dir = '/Users/Thibaut/DevDocs/Docs/Django20' self.base_url = 'https://docs.djangoproject.com/en/2.0/' end diff --git a/lib/docs/scrapers/electron.rb b/lib/docs/scrapers/electron.rb index e9881f70..e71690a3 100644 --- a/lib/docs/scrapers/electron.rb +++ b/lib/docs/scrapers/electron.rb @@ -2,7 +2,7 @@ module Docs class Electron < UrlScraper self.type = 'electron' self.base_url = 'https://electronjs.org/docs' - self.release = '2.0.0' + self.release = '2.0.2' self.links = { home: 'https://electronjs.org/', code: 'https://github.com/electron/electron' diff --git a/lib/docs/scrapers/erlang.rb b/lib/docs/scrapers/erlang.rb index ffa267f3..9c94aed5 100644 --- a/lib/docs/scrapers/erlang.rb +++ b/lib/docs/scrapers/erlang.rb @@ -40,6 +40,11 @@ module Docs Licensed under the Apache License, Version 2.0. HTML + version '21' do + self.release = '21.0' + self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang21' + end + version '20' do self.release = '20.3' self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang20' diff --git a/lib/docs/scrapers/flow.rb b/lib/docs/scrapers/flow.rb index cbf95f5c..bc559486 100644 --- a/lib/docs/scrapers/flow.rb +++ b/lib/docs/scrapers/flow.rb @@ -1,7 +1,7 @@ module Docs class Flow < UrlScraper self.type = 'flow' - self.release = '0.68.0' + self.release = '0.75.0' self.base_url = 'https://flow.org/en/docs/' self.links = { home: 'https://flow.org/', @@ -16,7 +16,7 @@ module Docs options[:attribution] = <<-HTML © 2013–present Facebook Inc.
- Licensed under the BSD License. + Licensed under the MIT License. HTML end end diff --git a/lib/docs/scrapers/jest.rb b/lib/docs/scrapers/jest.rb index 689b3268..efd05133 100644 --- a/lib/docs/scrapers/jest.rb +++ b/lib/docs/scrapers/jest.rb @@ -1,9 +1,9 @@ module Docs class Jest < UrlScraper self.type = 'jest' - self.release = '23.1.0' - self.base_url = 'https://facebook.github.io/jest/docs/en/' - self.root_path = 'getting-started.html' + self.release = '23.3.0' + self.base_url = 'https://jestjs.io/docs/en/' + self.root_path = 'getting-started' self.links = { home: 'https://facebook.github.io/jest/', code: 'https://github.com/facebook/jest' diff --git a/lib/docs/scrapers/koa.rb b/lib/docs/scrapers/koa.rb new file mode 100644 index 00000000..0fa4bc68 --- /dev/null +++ b/lib/docs/scrapers/koa.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Docs + class Koa < Github + self.base_url = 'https://github.com/koajs/koa/blob/master/docs/' + self.release = '2.5.1' + + self.root_path = 'api/index.md' + self.initial_paths = %w[ + error-handling + faq + guide + koa-vs-express + migration + troubleshooting + api/index + api/context + api/request + api/response + ].map { |name| name + '.md' } + + self.links = { + home: 'https://koajs.com/', + code: 'https://github.com/koajs/koa' + } + + html_filters.push 'koa/clean_html', 'koa/entries' + + options[:skip] = %w[middleware.gif] + options[:trailing_slash] = false + options[:container] = '.markdown-body' + + options[:attribution] = <<-HTML + © 2018 Koa contributors
+ Licensed under the MIT License. + HTML + end +end diff --git a/lib/docs/scrapers/leaflet.rb b/lib/docs/scrapers/leaflet.rb new file mode 100644 index 00000000..128217b0 --- /dev/null +++ b/lib/docs/scrapers/leaflet.rb @@ -0,0 +1,43 @@ +module Docs + class Leaflet < UrlScraper + self.name = 'Leaflet' + self.type = 'simple' + self.slug = 'leaflet' + self.links = { + home: 'https://leafletjs.com/', + code: 'https://github.com/Leaflet/Leaflet' + } + + html_filters.push 'leaflet/entries', 'leaflet/clean_html', 'title' + + options[:container] = '.container' + options[:skip_links] = true + + options[:attribution] = <<-HTML + © 2010–2018 Vladimir Agafonkin
+ © 2010–2011, CloudMade
+ Maps © OpenStreetMap contributors. + HTML + + version '1.3' do + self.release = '1.3.0' + self.base_url = "https://leafletjs.com/reference-#{release}.html" + end + + version '1.2' do + self.release = '1.2.0' + self.base_url = "https://leafletjs.com/reference-#{release}.html" + end + + version '1.1' do + self.release = '1.1.0' + self.base_url = "https://leafletjs.com/reference-#{release}.html" + end + + version '1.0' do + self.release = '1.0.3' + self.base_url = "https://leafletjs.com/reference-#{release}.html" + end + + end +end diff --git a/lib/docs/scrapers/node.rb b/lib/docs/scrapers/node.rb index 0dc7c7e8..322ea192 100644 --- a/lib/docs/scrapers/node.rb +++ b/lib/docs/scrapers/node.rb @@ -23,7 +23,7 @@ module Docs HTML version do - self.release = '10.4.0' + self.release = '10.6.0' self.base_url = 'https://nodejs.org/dist/latest-v10.x/docs/api/' end diff --git a/lib/docs/scrapers/python.rb b/lib/docs/scrapers/python.rb index 8b0289d5..9b7126e6 100644 --- a/lib/docs/scrapers/python.rb +++ b/lib/docs/scrapers/python.rb @@ -1,6 +1,6 @@ module Docs class Python < FileScraper - self.type = 'sphinx' + self.type = 'python' self.root_path = 'library/index.html' self.links = { home: 'https://www.python.org/', @@ -23,8 +23,16 @@ module Docs Licensed under the PSF License. HTML + version '3.7' do + self.release = '3.7.0' + self.dir = '/Users/Thibaut/DevDocs/Docs/Python37' # docs.python.org/3.7/download.html + 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 - self.release = '3.6.4' + self.release = '3.6.6' self.dir = '/Users/Thibaut/DevDocs/Docs/Python36' # docs.python.org/3.6/download.html self.base_url = 'https://docs.python.org/3.6/' diff --git a/lib/docs/scrapers/react_native.rb b/lib/docs/scrapers/react_native.rb index 8300bc3b..d1f94001 100644 --- a/lib/docs/scrapers/react_native.rb +++ b/lib/docs/scrapers/react_native.rb @@ -2,7 +2,7 @@ module Docs class ReactNative < UrlScraper self.slug = 'react_native' self.type = 'react_native' - self.release = '0.55' + self.release = '0.56' self.base_url = 'https://facebook.github.io/react-native/docs/' self.root_path = 'getting-started.html' self.links = { diff --git a/lib/docs/scrapers/sinon.rb b/lib/docs/scrapers/sinon.rb index 4a950406..00362b11 100644 --- a/lib/docs/scrapers/sinon.rb +++ b/lib/docs/scrapers/sinon.rb @@ -18,6 +18,11 @@ module Docs Licensed under the BSD License. HTML + version '6' do + self.release = '6.1.3' + self.base_url = "http://sinonjs.org/releases/v#{release}/" + end + version '5' do self.release = '5.1.0' self.base_url = "http://sinonjs.org/releases/v#{release}/" diff --git a/lib/docs/scrapers/terraform.rb b/lib/docs/scrapers/terraform.rb new file mode 100644 index 00000000..ab12775d --- /dev/null +++ b/lib/docs/scrapers/terraform.rb @@ -0,0 +1,22 @@ +module Docs + class Terraform < UrlScraper + self.name = 'Terraform' + self.type = 'terraform' + self.release = '0.11.7' + self.base_url = 'https://www.terraform.io/docs/' + self.root_path = 'index.html' + self.links = { + home: 'https://www.terraform.io/', + code: 'https://github.com/hashicorp/terraform' + } + + html_filters.push 'terraform/entries', 'terraform/clean_html' + + options[:skip_patterns] = [/enterprise/, /enterprise-legacy/] + + options[:attribution] = <<-HTML + © 2018 HashiCorp
+ Licensed under the MPL 2.0 License. + HTML + end +end diff --git a/public/icons/docs-2.pxm b/public/icons/docs-2.pxm index 0cb4c478..7549a0ab 100644 Binary files a/public/icons/docs-2.pxm and b/public/icons/docs-2.pxm differ diff --git a/public/icons/docs-2@2x.pxm b/public/icons/docs-2@2x.pxm index 8adb507c..ea8fee7c 100644 Binary files a/public/icons/docs-2@2x.pxm and b/public/icons/docs-2@2x.pxm differ diff --git a/public/icons/docs/leaflet/16.png b/public/icons/docs/leaflet/16.png new file mode 100644 index 00000000..f0638e03 Binary files /dev/null and b/public/icons/docs/leaflet/16.png differ diff --git a/public/icons/docs/leaflet/16@2x.png b/public/icons/docs/leaflet/16@2x.png new file mode 100644 index 00000000..24f0150d Binary files /dev/null and b/public/icons/docs/leaflet/16@2x.png differ diff --git a/public/icons/docs/leaflet/SOURCE b/public/icons/docs/leaflet/SOURCE new file mode 100644 index 00000000..80b6994d --- /dev/null +++ b/public/icons/docs/leaflet/SOURCE @@ -0,0 +1 @@ +http://leafletjs.com/docs/images/favicon.ico diff --git a/public/icons/docs/terraform/16.png b/public/icons/docs/terraform/16.png new file mode 100644 index 00000000..71f60110 Binary files /dev/null and b/public/icons/docs/terraform/16.png differ diff --git a/public/icons/docs/terraform/16@2x.png b/public/icons/docs/terraform/16@2x.png new file mode 100644 index 00000000..42e046bf Binary files /dev/null and b/public/icons/docs/terraform/16@2x.png differ