Unified · Split
| @@ -27,8 +27,6 @@ Want to contribute? Great. Please review the following guidelines carefully and · 26 unmodified lines | |||
| 27 | 2. Make sure your feature fits DevDocs's [vision](https://github.com/freeCodeCamp/devdocs/blob/master/README.md#vision). | 27 | 2. Make sure your feature fits DevDocs's [vision](https://github.com/freeCodeCamp/devdocs/blob/master/README.md#vision). |
| 28 | 3. Provide a clear and detailed explanation of the feature and why it's important to add it. | 28 | 3. Provide a clear and detailed explanation of the feature and why it's important to add it. |
| 29 | 29 | ||
| 30 | For general feedback and ideas, please use the [mailing list](https://groups.google.com/d/forum/devdocs). | ||
| 31 | |||
| 32 | ## Requesting new documentations | 30 | ## Requesting new documentations |
| 33 | 31 | ||
| 34 | Please don't open issues to request new documentations. | 32 | Please don't open issues to request new documentations. |
| @@ -37,7 +35,7 @@ Use the [Trello board](https://trello.com/b/6BmTulfx/devdocs-documentation) wher · 2 unmodified lines | |||
| 37 | ## Contributing code and features | 35 | ## Contributing code and features |
| 38 | 36 | ||
| 39 | 1. Search for existing issues; someone may already be working on a similar feature. | 37 | 1. Search for existing issues; someone may already be working on a similar feature. |
| 40 | 2. Before embarking on any significant pull request, please open an issue describing the changes you intend to make. Otherwise you risk spending a lot of time working on something I may not want to merge. This also tells other contributors that you're working on the feature. | 38 | 2. Before embarking on any significant pull request, please open an issue describing the changes you intend to make. Otherwise you risk spending a lot of time working on something we may not want to merge. This also tells other contributors that you're working on the feature. |
| 41 | 3. Follow the [coding conventions](#coding-conventions). | 39 | 3. Follow the [coding conventions](#coding-conventions). |
| 42 | 4. If you're modifying the Ruby code, include tests and ensure they pass. | 40 | 4. If you're modifying the Ruby code, include tests and ensure they pass. |
| 43 | 5. Try to keep your pull request small and simple. | 41 | 5. Try to keep your pull request small and simple. |
| @@ -65,13 +63,6 @@ Please don't submit a pull request updating the version number of a documentatio · 21 unmodified lines | |||
| 65 | 63 | ||
| 66 | To ask that an existing documentation be updated, please use the [Trello board](https://trello.com/c/2B0hmW7M/52-request-updates-here). | 64 | To ask that an existing documentation be updated, please use the [Trello board](https://trello.com/c/2B0hmW7M/52-request-updates-here). |
| 67 | 65 | ||
| 68 | ## Other contributions | ||
| 69 | |||
| 70 | Besides new docs and features, here are other ways you can contribute: | ||
| 71 | |||
| 72 | * **Improve our copy.** English isn't my first language so if you notice grammatical or usage errors, feel free to submit a pull request — it'll be much appreciated. | ||
| 73 | * **Participate in the issue tracker.** Your opinion matters — feel free to add comments to existing issues. You're also welcome to participate to the [mailing list](https://groups.google.com/d/forum/devdocs). | ||
| 74 | |||
| 75 | ## Coding conventions | 66 | ## Coding conventions |
| 76 | 67 | ||
| 77 | * two spaces; no tabs | 68 | * two spaces; no tabs |
| @@ -80,4 +71,4 @@ Besides new docs and features, here are other ways you can contribute: · 2 unmodified lines | |||
| 80 | 71 | ||
| 81 | ## Questions? | 72 | ## Questions? |
| 82 | 73 | ||
| 83 | If you have any questions, please feel free to ask on the [mailing list](https://groups.google.com/d/forum/devdocs). | 74 | If you have any questions, please feel free to ask them on the contributor chat room on [Gitter](https://gitter.im/FreeCodeCamp/DevDocs). |
| @@ -1,6 +1,6 @@ | |||
| 1 | <!-- | 1 | <!-- |
| 2 | Please read the contributing guidelines before opening an issue: | 2 | Please read the contributing guidelines before opening an issue: |
| 3 | https://github.com/freeCodeCamp/devdocs/blob/master/CONTRIBUTING.md | 3 | https://github.com/freeCodeCamp/devdocs/blob/master/.github/CONTRIBUTING.md |
| 4 | 4 | ||
| 5 | To request a new documentation, or an update of an existing documentation, go here: | 5 | To request a new documentation, or an update of an existing documentation, go here: |
| 6 | https://trello.com/b/6BmTulfx/devdocs-documentation | 6 | https://trello.com/b/6BmTulfx/devdocs-documentation |
| @@ -0,0 +1,8 @@ | |||
| 1 | daysUntilClose: 30 | ||
| 2 | responseRequiredLabel: needs-info | ||
| 3 | closeComment: > | ||
| 4 | This issue has been automatically closed because there has been no response | ||
| 5 | to our request for more information from the original author. With only the | ||
| 6 | information that’s currently in the issue, we don’t have enough information | ||
| 7 | to take action. Please comment if you have or find the answer we need so we | ||
| 8 | can investigate further. | ||
| @@ -1,11 +1,8 @@ | |||
| 1 | .DS_Store | 1 | .DS_Store |
| 2 | .bundle | 2 | .bundle |
| 3 | *.pxm | ||
| 4 | *.sketch | ||
| 5 | tmp | 3 | tmp |
| 6 | public/assets | 4 | public/assets |
| 7 | public/fonts | 5 | public/fonts |
| 8 | public/docs/**/* | 6 | public/docs/**/* |
| 9 | !public/docs/docs.json | 7 | docs/**/* |
| 10 | !public/docs/**/index.json | 8 | !docs/*.md |
| 11 | log | ||
| @@ -1 +1 @@ | |||
| 1 | 2.5.1 | 1 | 2.6.0 |
| @@ -1,13 +1,13 @@ | |||
| 1 | Copyright 2013-2018 Thibaut Courouble and other contributors | 1 | Copyright 2013-2019 Thibaut Courouble and other contributors |
| 2 | 2 | ||
| 3 | This Source Code Form is subject to the terms of the Mozilla Public | 3 | This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | License, v. 2.0. If a copy of the MPL was not distributed with this | 4 | License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. | 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 | 6 | ||
| 7 | Please do not use the name DevDocs to endorse or promote products | 7 | Please do not use the name DevDocs to endorse or promote products |
| 8 | derived from this software without my permission, except as may be | 8 | derived from this software without the maintainers' permission, except |
| 9 | necessary to comply with the notice/attribution requirements. | 9 | as may be necessary to comply with the notice/attribution requirements. |
| 10 | 10 | ||
| 11 | I also wish that any documentation file generated using this software | 11 | We also wish that any documentation file generated using this software |
| 12 | be attributed to DevDocs. Let's be fair to all contributors by giving | 12 | be attributed to DevDocs. Let's be fair to all contributors by giving |
| 13 | credit where credit's due. Thanks. | 13 | credit where credit's due. Thanks. |
| @@ -1,4 +1,4 @@ | |||
| 1 | FROM ruby:2.5.1 | 1 | FROM ruby:2.6.0 |
| 2 | 2 | ||
| 3 | ENV LANG=C.UTF-8 | 3 | ENV LANG=C.UTF-8 |
| 4 | 4 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | FROM ruby:2.5.1-alpine | 1 | FROM ruby:2.6.0-alpine |
| 2 | 2 | ||
| 3 | ENV LANG=C.UTF-8 | 3 | ENV LANG=C.UTF-8 |
| 4 | 4 | ||
| @@ -1,11 +1,14 @@ | |||
| 1 | source 'https://rubygems.org' | 1 | source 'https://rubygems.org' |
| 2 | ruby '2.5.1' | 2 | ruby '2.6.0' |
| 3 | 3 | ||
| 4 | gem 'rake' | 4 | gem 'rake' |
| 5 | gem 'thor' | 5 | gem 'thor' |
| 6 | gem 'pry', '~> 0.11.0' | 6 | gem 'pry', '~> 0.12.0' |
| 7 | gem 'activesupport', '~> 5.2', require: false | 7 | gem 'activesupport', '~> 5.2', require: false |
| 8 | gem 'yajl-ruby', require: false | 8 | gem 'yajl-ruby', require: false |
| 9 | gem 'html-pipeline' | ||
| 10 | gem 'typhoeus' | ||
| 11 | gem 'nokogiri' | ||
| 9 | 12 | ||
| 10 | group :app do | 13 | group :app do |
| 11 | gem 'rack' | 14 | gem 'rack' |
| @@ -31,14 +34,12 @@ group :development do · 19 unmodified lines | |||
| 31 | end | 34 | end |
| 32 | 35 | ||
| 33 | group :docs do | 36 | group :docs do |
| 34 | gem 'typhoeus' | ||
| 35 | gem 'nokogiri' | ||
| 36 | gem 'html-pipeline' | ||
| 37 | gem 'image_optim' | 37 | gem 'image_optim' |
| 38 | gem 'image_optim_pack', platforms: :ruby | 38 | gem 'image_optim_pack', platforms: :ruby |
| 39 | gem 'progress_bar', require: false | 39 | gem 'progress_bar', require: false |
| 40 | gem 'unix_utils', require: false | 40 | gem 'unix_utils', require: false |
| 41 | gem 'tty-pager', require: false | 41 | gem 'tty-pager', require: false |
| 42 | gem 'net-sftp', '>= 2.1.3.rc2', require: false | ||
| 42 | end | 43 | end |
| 43 | 44 | ||
| 44 | group :test do | 45 | group :test do |
| @@ -1,7 +1,7 @@ | |||
| 1 | GEM | 1 | GEM |
| 2 | remote: https://rubygems.org/ | 2 | remote: https://rubygems.org/ |
| 3 | specs: | 3 | specs: |
| 4 | activesupport (5.2.1) | 4 | activesupport (5.2.2) |
| 5 | concurrent-ruby (~> 1.0, >= 1.0.2) | 5 | concurrent-ruby (~> 1.0, >= 1.0.2) |
| 6 | i18n (>= 0.7, < 2) | 6 | i18n (>= 0.7, < 2) |
| 7 | minitest (~> 5.1) | 7 | minitest (~> 5.1) |
| @@ -17,77 +17,79 @@ GEM · 9 unmodified lines | |||
| 17 | coffee-script-source | 17 | coffee-script-source |
| 18 | execjs | 18 | execjs |
| 19 | coffee-script-source (1.12.2) | 19 | coffee-script-source (1.12.2) |
| 20 | concurrent-ruby (1.0.5) | 20 | concurrent-ruby (1.1.4) |
| 21 | daemons (1.2.6) | 21 | daemons (1.3.1) |
| 22 | erubi (1.7.1) | 22 | erubi (1.8.0) |
| 23 | ethon (0.11.0) | 23 | ethon (0.12.0) |
| 24 | ffi (>= 1.3.0) | 24 | ffi (>= 1.3.0) |
| 25 | eventmachine (1.2.7) | 25 | eventmachine (1.2.7) |
| 26 | execjs (2.7.0) | 26 | execjs (2.7.0) |
| 27 | exifr (1.3.4) | 27 | exifr (1.3.5) |
| 28 | ffi (1.9.25) | 28 | ffi (1.10.0) |
| 29 | fspath (3.1.0) | 29 | fspath (3.1.0) |
| 30 | highline (2.0.0) | 30 | highline (2.0.0) |
| 31 | html-pipeline (2.8.4) | 31 | html-pipeline (2.10.0) |
| 32 | activesupport (>= 2) | 32 | activesupport (>= 2) |
| 33 | nokogiri (>= 1.4) | 33 | nokogiri (>= 1.4) |
| 34 | i18n (1.1.0) | 34 | i18n (1.5.2) |
| 35 | concurrent-ruby (~> 1.0) | 35 | concurrent-ruby (~> 1.0) |
| 36 | image_optim (0.26.2) | 36 | image_optim (0.26.3) |
| 37 | exifr (~> 1.2, >= 1.2.2) | 37 | exifr (~> 1.2, >= 1.2.2) |
| 38 | fspath (~> 3.0) | 38 | fspath (~> 3.0) |
| 39 | image_size (>= 1.5, < 3) | 39 | image_size (>= 1.5, < 3) |
| 40 | in_threads (~> 1.3) | 40 | in_threads (~> 1.3) |
| 41 | progress (~> 3.0, >= 3.0.1) | 41 | progress (~> 3.0, >= 3.0.1) |
| 42 | image_optim_pack (0.5.1) | 42 | image_optim_pack (0.5.1.20190105) |
| 43 | fspath (>= 2.1, < 4) | 43 | fspath (>= 2.1, < 4) |
| 44 | image_optim (~> 0.19) | 44 | image_optim (~> 0.19) |
| 45 | image_size (2.0.0) | 45 | image_size (2.0.0) |
| 46 | in_threads (1.5.0) | 46 | in_threads (1.5.1) |
| 47 | method_source (0.9.0) | 47 | method_source (0.9.2) |
| 48 | mini_portile2 (2.3.0) | 48 | mini_portile2 (2.4.0) |
| 49 | minitest (5.11.3) | 49 | minitest (5.11.3) |
| 50 | multi_json (1.13.1) | 50 | multi_json (1.13.1) |
| 51 | mustermann (1.0.3) | 51 | mustermann (1.0.3) |
| 52 | newrelic_rpm (5.4.0.347) | 52 | net-sftp (3.0.0.beta1) |
| 53 | nokogiri (1.8.4) | 53 | net-ssh (>= 5.0.0, < 6.0.0) |
| 54 | mini_portile2 (~> 2.3.0) | 54 | net-ssh (5.1.0) |
| 55 | newrelic_rpm (5.7.0.350) | ||
| 56 | nokogiri (1.10.1) | ||
| 57 | mini_portile2 (~> 2.4.0) | ||
| 55 | options (2.3.2) | 58 | options (2.3.2) |
| 56 | progress (3.4.0) | 59 | progress (3.5.0) |
| 57 | progress_bar (1.3.0) | 60 | progress_bar (1.3.0) |
| 58 | highline (>= 1.6, < 3) | 61 | highline (>= 1.6, < 3) |
| 59 | options (~> 2.3.0) | 62 | options (~> 2.3.0) |
| 60 | pry (0.11.3) | 63 | pry (0.12.2) |
| 61 | coderay (~> 1.1.0) | 64 | coderay (~> 1.1.0) |
| 62 | method_source (~> 0.9.0) | 65 | method_source (~> 0.9.0) |
| 63 | rack (2.0.5) | 66 | rack (2.0.6) |
| 64 | rack-protection (2.0.4) | 67 | rack-protection (2.0.5) |
| 65 | rack | 68 | rack |
| 66 | rack-ssl-enforcer (0.2.9) | 69 | rack-ssl-enforcer (0.2.9) |
| 67 | rack-test (1.1.0) | 70 | rack-test (1.1.0) |
| 68 | rack (>= 1.0, < 3) | 71 | rack (>= 1.0, < 3) |
| 69 | rake (12.3.1) | 72 | rake (12.3.2) |
| 70 | rb-fsevent (0.10.3) | 73 | rb-fsevent (0.10.3) |
| 71 | rb-inotify (0.9.10) | 74 | rb-inotify (0.10.0) |
| 72 | ffi (>= 0.5.0, < 2) | 75 | ffi (~> 1.0) |
| 73 | rr (1.2.1) | 76 | rr (1.2.1) |
| 74 | sass (3.6.0) | 77 | sass (3.7.3) |
| 75 | sass-listen (~> 4.0.0) | 78 | sass-listen (~> 4.0.0) |
| 76 | sass-listen (4.0.0) | 79 | sass-listen (4.0.0) |
| 77 | rb-fsevent (~> 0.9, >= 0.9.4) | 80 | rb-fsevent (~> 0.9, >= 0.9.4) |
| 78 | rb-inotify (~> 0.9, >= 0.9.7) | 81 | rb-inotify (~> 0.9, >= 0.9.7) |
| 79 | sinatra (2.0.4) | 82 | sinatra (2.0.5) |
| 80 | mustermann (~> 1.0) | 83 | mustermann (~> 1.0) |
| 81 | rack (~> 2.0) | 84 | rack (~> 2.0) |
| 82 | rack-protection (= 2.0.4) | 85 | rack-protection (= 2.0.5) |
| 83 | tilt (~> 2.0) | 86 | tilt (~> 2.0) |
| 84 | sinatra-contrib (2.0.4) | 87 | sinatra-contrib (2.0.5) |
| 85 | activesupport (>= 4.0.0) | ||
| 86 | backports (>= 2.8.2) | 88 | backports (>= 2.8.2) |
| 87 | multi_json | 89 | multi_json |
| 88 | mustermann (~> 1.0) | 90 | mustermann (~> 1.0) |
| 89 | rack-protection (= 2.0.4) | 91 | rack-protection (= 2.0.5) |
| 90 | sinatra (= 2.0.4) | 92 | sinatra (= 2.0.5) |
| 91 | tilt (>= 1.3, < 3) | 93 | tilt (>= 1.3, < 3) |
| 92 | sprockets (3.7.2) | 94 | sprockets (3.7.2) |
| 93 | concurrent-ruby (~> 1.0) | 95 | concurrent-ruby (~> 1.0) |
| @@ -103,22 +105,22 @@ GEM · 9 unmodified lines | |||
| 103 | daemons (~> 1.0, >= 1.0.9) | 105 | daemons (~> 1.0, >= 1.0.9) |
| 104 | eventmachine (~> 1.0, >= 1.0.4) | 106 | eventmachine (~> 1.0, >= 1.0.4) |
| 105 | rack (>= 1, < 3) | 107 | rack (>= 1, < 3) |
| 106 | thor (0.20.0) | 108 | thor (0.20.3) |
| 107 | thread_safe (0.3.6) | 109 | thread_safe (0.3.6) |
| 108 | tilt (2.0.8) | 110 | tilt (2.0.9) |
| 109 | tty-pager (0.11.0) | 111 | tty-pager (0.12.0) |
| 110 | strings (~> 0.1.0) | 112 | strings (~> 0.1.4) |
| 111 | tty-screen (~> 0.6.4) | 113 | tty-screen (~> 0.6) |
| 112 | tty-which (~> 0.3.0) | 114 | tty-which (~> 0.4) |
| 113 | tty-screen (0.6.5) | 115 | tty-screen (0.6.5) |
| 114 | tty-which (0.3.0) | 116 | tty-which (0.4.0) |
| 115 | typhoeus (1.3.0) | 117 | typhoeus (1.3.1) |
| 116 | ethon (>= 0.9.0) | 118 | ethon (>= 0.9.0) |
| 117 | tzinfo (1.2.5) | 119 | tzinfo (1.2.5) |
| 118 | thread_safe (~> 0.1) | 120 | thread_safe (~> 0.1) |
| 119 | uglifier (4.1.19) | 121 | uglifier (4.1.20) |
| 120 | execjs (>= 0.3.0, < 3) | 122 | execjs (>= 0.3.0, < 3) |
| 121 | unicode-display_width (1.4.0) | 123 | unicode-display_width (1.4.1) |
| 122 | unicode_utils (1.4.0) | 124 | unicode_utils (1.4.0) |
| 123 | unix_utils (0.0.15) | 125 | unix_utils (0.0.15) |
| 124 | yajl-ruby (1.4.1) | 126 | yajl-ruby (1.4.1) |
| @@ -136,10 +138,11 @@ DEPENDENCIES · 11 unmodified lines | |||
| 136 | image_optim | 138 | image_optim |
| 137 | image_optim_pack | 139 | image_optim_pack |
| 138 | minitest | 140 | minitest |
| 141 | net-sftp (>= 2.1.3.rc2) | ||
| 139 | newrelic_rpm | 142 | newrelic_rpm |
| 140 | nokogiri | 143 | nokogiri |
| 141 | progress_bar | 144 | progress_bar |
| 142 | pry (~> 0.11.0) | 145 | pry (~> 0.12.0) |
| 143 | rack | 146 | rack |
| 144 | rack-ssl-enforcer | 147 | rack-ssl-enforcer |
| 145 | rack-test | 148 | rack-test |
| @@ -159,7 +162,7 @@ DEPENDENCIES · 13 unmodified lines | |||
| 159 | yajl-ruby | 162 | yajl-ruby |
| 160 | 163 | ||
| 161 | RUBY VERSION | 164 | RUBY VERSION |
| 162 | ruby 2.5.1p57 | 165 | ruby 2.6.0p0 |
| 163 | 166 | ||
| 164 | BUNDLED WITH | 167 | BUNDLED WITH |
| 165 | 1.16.1 | 168 | 1.17.2 |
| @@ -1,25 +1,24 @@ | |||
| 1 | # [DevDocs](https://devdocs.io) [](https://travis-ci.org/freeCodeCamp/devdocs) | 1 | # [DevDocs](https://devdocs.io) — API Documentation Browser [](https://travis-ci.org/freeCodeCamp/devdocs) |
| 2 | 2 | ||
| 3 | DevDocs combines multiple API documentations in a fast, organized, and searchable interface. | 3 | DevDocs combines multiple developer documentations in a clean and organized web UI with instant search, offline support, mobile version, dark theme, keyboard shortcuts, and more. |
| 4 | 4 | ||
| 5 | * Created by [Thibaut Courouble](https://thibaut.me) | 5 | DevDocs was created by [Thibaut Courouble](https://thibaut.me) and is operated by [freeCodeCamp](https://www.freecodecamp.org). |
| 6 | 6 | ||
| 7 | Keep track of development news: | 7 | Keep track of development news: |
| 8 | 8 | ||
| 9 | * Join the contributor chat room on [Gitter](https://gitter.im/FreeCodeCamp/DevDocs) | 9 | * Join the contributor chat room on [Gitter](https://gitter.im/FreeCodeCamp/DevDocs) |
| 10 | * Watch the repository on [GitHub](https://github.com/freeCodeCamp/devdocs/subscription) | 10 | * Watch the repository on [GitHub](https://github.com/freeCodeCamp/devdocs/subscription) |
| 11 | * Follow [@DevDocs](https://twitter.com/DevDocs) on Twitter | 11 | * Follow [@DevDocs](https://twitter.com/DevDocs) on Twitter |
| 12 | * Join the [mailing list](https://groups.google.com/d/forum/devdocs) | ||
| 13 | 12 | ||
| 14 | **Table of Contents:** [Quick Start](#quick-start) · [Vision](#vision) · [App](#app) · [Scraper](#scraper) · [Commands](#available-commands) · [Contributing](#contributing) · [License](#copyright--license) · [Questions?](#questions) | 13 | **Table of Contents:** [Quick Start](#quick-start) · [Vision](#vision) · [App](#app) · [Scraper](#scraper) · [Commands](#available-commands) · [Contributing](#contributing) · [License](#copyright--license) · [Questions?](#questions) |
| 15 | 14 | ||
| 16 | ## Quick Start | 15 | ## Quick Start |
| 17 | 16 | ||
| 18 | Unless you wish to contribute to the project, I recommend using the hosted version at [devdocs.io](https://devdocs.io). It's up-to-date and works offline out-of-the-box. | 17 | Unless you wish to contribute to the project, we recommend using the hosted version at [devdocs.io](https://devdocs.io). It's up-to-date and works offline out-of-the-box. |
| 19 | 18 | ||
| 20 | DevDocs is made of two pieces: a Ruby scraper that generates the documentation and metadata, and a JavaScript app powered by a small Sinatra app. | 19 | DevDocs is made of two pieces: a Ruby scraper that generates the documentation and metadata, and a JavaScript app powered by a small Sinatra app. |
| 21 | 20 | ||
| 22 | DevDocs requires Ruby 2.5.1, libcurl, and a JavaScript runtime supported by [ExecJS](https://github.com/rails/execjs#readme) (included in OS X and Windows; [Node.js](https://nodejs.org/en/) on Linux). Once you have these installed, run the following commands: | 21 | DevDocs requires Ruby 2.6.0, libcurl, and a JavaScript runtime supported by [ExecJS](https://github.com/rails/execjs#readme) (included in OS X and Windows; [Node.js](https://nodejs.org/en/) on Linux). Once you have these installed, run the following commands: |
| 23 | 22 | ||
| 24 | ``` | 23 | ``` |
| 25 | git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs | 24 | git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs |
| @@ -129,20 +128,20 @@ If multiple versions of Ruby are installed on your system, commands must be run · 103 unmodified lines | |||
| 129 | 128 | ||
| 130 | ## Contributing | 129 | ## Contributing |
| 131 | 130 | ||
| 132 | Contributions are welcome. Please read the [contributing guidelines](https://github.com/freeCodeCamp/devdocs/blob/master/CONTRIBUTING.md). | 131 | Contributions are welcome. Please read the [contributing guidelines](https://github.com/freeCodeCamp/devdocs/blob/master/.github/CONTRIBUTING.md). |
| 133 | 132 | ||
| 134 | DevDocs's own documentation is available on the [wiki](https://github.com/freeCodeCamp/devdocs/wiki). | 133 | DevDocs's own documentation is available on the [wiki](https://github.com/freeCodeCamp/devdocs/wiki). |
| 135 | 134 | ||
| 136 | ## Copyright / License | 135 | ## Copyright / License |
| 137 | 136 | ||
| 138 | Copyright 2013-2018 Thibaut Courouble and [other contributors](https://github.com/freeCodeCamp/devdocs/graphs/contributors) | 137 | Copyright 2013-2019 Thibaut Courouble and [other contributors](https://github.com/freeCodeCamp/devdocs/graphs/contributors) |
| 139 | 138 | ||
| 140 | This software is licensed under the terms of the Mozilla Public License v2.0. See the [COPYRIGHT](https://github.com/freeCodeCamp/devdocs/blob/master/COPYRIGHT) and [LICENSE](https://github.com/freeCodeCamp/devdocs/blob/master/LICENSE) files. | 139 | This software is licensed under the terms of the Mozilla Public License v2.0. See the [COPYRIGHT](https://github.com/freeCodeCamp/devdocs/blob/master/COPYRIGHT) and [LICENSE](https://github.com/freeCodeCamp/devdocs/blob/master/LICENSE) files. |
| 141 | 140 | ||
| 142 | Please do not use the name DevDocs to endorse or promote products derived from this software without my permission, except as may be necessary to comply with the notice/attribution requirements. | 141 | Please do not use the name DevDocs to endorse or promote products derived from this software without the maintainers' permission, except as may be necessary to comply with the notice/attribution requirements. |
| 143 | 142 | ||
| 144 | I also wish that any documentation file generated using this software be attributed to DevDocs. Let's be fair to all contributors by giving credit where credit's due. Thanks! | 143 | We also wish that any documentation file generated using this software be attributed to DevDocs. Let's be fair to all contributors by giving credit where credit's due. Thanks! |
| 145 | 144 | ||
| 146 | ## Questions? | 145 | ## Questions? |
| 147 | 146 | ||
| 148 | If you have any questions, please feel free to ask them on the [mailing list](https://groups.google.com/d/forum/devdocs). | 147 | If you have any questions, please feel free to ask them on the contributor chat room on [Gitter](https://gitter.im/FreeCodeCamp/DevDocs). |
| @@ -3,6 +3,7 @@ · 2 unmodified lines | |||
| 3 | require 'bundler/setup' | 3 | require 'bundler/setup' |
| 4 | require 'thor' | 4 | require 'thor' |
| 5 | 5 | ||
| 6 | Bundler.require :default | ||
| 6 | $LOAD_PATH.unshift 'lib' | 7 | $LOAD_PATH.unshift 'lib' |
| 7 | 8 | ||
| 8 | task :default do | 9 | task :default do |
| @@ -13,6 +14,9 @@ end · 4 unmodified lines | |||
| 13 | namespace :assets do | 14 | namespace :assets do |
| 14 | desc 'Compile all assets' | 15 | desc 'Compile all assets' |
| 15 | task :precompile do | 16 | task :precompile do |
| 17 | load 'tasks/docs.thor' | ||
| 18 | DocsCLI.new.prepare_deploy | ||
| 19 | |||
| 16 | load 'tasks/assets.thor' | 20 | load 'tasks/assets.thor' |
| 17 | AssetsCLI.new.compile | 21 | AssetsCLI.new.compile |
| 18 | end | 22 | end |
| @@ -157,10 +157,17 @@ · 156 unmodified lines | |||
| 157 | new app.views.Updates() | 157 | new app.views.Updates() |
| 158 | @updateChecker = new app.UpdateChecker() | 158 | @updateChecker = new app.UpdateChecker() |
| 159 | 159 | ||
| 160 | reboot: -> | ||
| 161 | if location.pathname isnt '/' and location.pathname isnt '/settings' | ||
| 162 | window.location = "/##{location.pathname}" | ||
| 163 | else | ||
| 164 | window.location = '/' | ||
| 165 | return | ||
| 166 | |||
| 160 | reload: -> | 167 | reload: -> |
| 161 | @docs.clearCache() | 168 | @docs.clearCache() |
| 162 | @disabledDocs.clearCache() | 169 | @disabledDocs.clearCache() |
| 163 | if @appCache then @appCache.reload() else window.location = '/' | 170 | if @appCache then @appCache.reload() else @reboot() |
| 164 | return | 171 | return |
| 165 | 172 | ||
| 166 | reset: -> | 173 | reset: -> |
| @@ -27,7 +27,7 @@ class app.AppCache · 26 unmodified lines | |||
| 27 | return | 27 | return |
| 28 | 28 | ||
| 29 | reload: -> | 29 | reload: -> |
| 30 | $.on @cache, 'updateready noupdate error', -> window.location = '/' | 30 | $.on @cache, 'updateready noupdate error', -> app.reboot() |
| 31 | @notifyUpdate = false | 31 | @notifyUpdate = false |
| 32 | @notifyProgress = true | 32 | @notifyProgress = true |
| 33 | try @cache.update() catch | 33 | try @cache.update() catch |
| @@ -1,5 +1,5 @@ | |||
| 1 | ### | 1 | ### |
| 2 | * Copyright 2013-2018 Thibaut Courouble and other contributors | 2 | * Copyright 2013-2019 Thibaut Courouble and other contributors |
| 3 | * | 3 | * |
| 4 | * This source code is licensed under the terms of the Mozilla | 4 | * This source code is licensed under the terms of the Mozilla |
| 5 | * Public License, v. 2.0, a copy of which may be obtained at: | 5 | * Public License, v. 2.0, a copy of which may be obtained at: |
| @@ -62,12 +62,12 @@ app.templates.unsupportedBrowser = """ · 61 unmodified lines | |||
| 62 | <li>iOS 10+ | 62 | <li>iOS 10+ |
| 63 | </ul> | 63 | </ul> |
| 64 | <p class="_fail-text"> | 64 | <p class="_fail-text"> |
| 65 | If you're unable to upgrade, I apologize. | 65 | If you're unable to upgrade, we apologize. |
| 66 | I decided to prioritize speed and new features over support for older browsers. | 66 | We decided to prioritize speed and new features over support for older browsers. |
| 67 | <p class="_fail-text"> | 67 | <p class="_fail-text"> |
| 68 | Note: if you're already using one of the browsers above, check your settings and add-ons. | 68 | Note: if you're already using one of the browsers above, check your settings and add-ons. |
| 69 | The app uses feature detection, not user agent sniffing. | 69 | The app uses feature detection, not user agent sniffing. |
| 70 | <p class="_fail-text"> | 70 | <p class="_fail-text"> |
| 71 | — Thibaut <a href="https://twitter.com/DevDocs" class="_fail-link">@DevDocs</a> | 71 | — <a href="https://twitter.com/DevDocs">@DevDocs</a> |
| 72 | </div> | 72 | </div> |
| 73 | """ | 73 | """ |
| @@ -11,22 +11,18 @@ app.templates.aboutPage = -> """ · 10 unmodified lines | |||
| 11 | </nav> | 11 | </nav> |
| 12 | 12 | ||
| 13 | <h1 class="_lined-heading">DevDocs: API Documentation Browser</h1> | 13 | <h1 class="_lined-heading">DevDocs: API Documentation Browser</h1> |
| 14 | <p>DevDocs combines multiple API documentations in a clean and organized web UI with instant search, offline support, mobile version, dark theme, keyboard shortcuts, and more. | 14 | <p>DevDocs combines multiple developer documentations in a clean and organized web UI with instant search, offline support, mobile version, dark theme, keyboard shortcuts, and more. |
| 15 | <ul> | 15 | <p>DevDocs is free and <a href="https://github.com/freeCodeCamp/devdocs">open source</a>. It was created by <a href="https://thibaut.me">Thibaut Courouble</a> and is operated by <a href="https://www.freecodecamp.org/">freeCodeCamp</a>. |
| 16 | <li>Created and maintained by <a href="https://thibaut.me">Thibaut Courouble</a> | ||
| 17 | <li>Free and <a href="https://github.com/freeCodeCamp/devdocs">open source</a> | ||
| 18 | <iframe class="_github-btn" src="https://ghbtns.com/github-btn.html?user=freeCodeCamp&repo=devdocs&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20" tabindex="-1"></iframe> | ||
| 19 | </ul> | ||
| 20 | <p>To keep up-to-date with the latest news: | 16 | <p>To keep up-to-date with the latest news: |
| 21 | <ul> | 17 | <ul> |
| 22 | <li>Follow <a href="https://twitter.com/DevDocs">@DevDocs</a> on Twitter | 18 | <li>Follow <a href="https://twitter.com/DevDocs">@DevDocs</a> on Twitter |
| 23 | <li>Watch the repository on <a href="https://github.com/freeCodeCamp/devdocs/subscription">GitHub</a> | 19 | <li>Watch the repository on <a href="https://github.com/freeCodeCamp/devdocs/subscription">GitHub</a> <iframe class="_github-btn" src="https://ghbtns.com/github-btn.html?user=freeCodeCamp&repo=devdocs&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20" tabindex="-1"></iframe> |
| 24 | <li>Join the <a href="https://groups.google.com/d/forum/devdocs">mailing list</a> | 20 | <li>Join the <a href="https://gitter.im/FreeCodeCamp/DevDocs">Gitter</a> chat room |
| 25 | </ul> | 21 | </ul> |
| 26 | 22 | ||
| 27 | <h2 class="_block-heading" id="copyright">Copyright and License</h2> | 23 | <h2 class="_block-heading" id="copyright">Copyright and License</h2> |
| 28 | <p class="_note"> | 24 | <p class="_note"> |
| 29 | <strong>Copyright 2013–2018 Thibaut Courouble and <a href="https://github.com/freeCodeCamp/devdocs/graphs/contributors">other contributors</a></strong><br> | 25 | <strong>Copyright 2013–2019 Thibaut Courouble and <a href="https://github.com/freeCodeCamp/devdocs/graphs/contributors">other contributors</a></strong><br> |
| 30 | This software is licensed under the terms of the Mozilla Public License v2.0.<br> | 26 | This software is licensed under the terms of the Mozilla Public License v2.0.<br> |
| 31 | You may obtain a copy of the source code at <a href="https://github.com/freeCodeCamp/devdocs">github.com/freeCodeCamp/devdocs</a>.<br> | 27 | You may obtain a copy of the source code at <a href="https://github.com/freeCodeCamp/devdocs">github.com/freeCodeCamp/devdocs</a>.<br> |
| 32 | For more information, see the <a href="https://github.com/freeCodeCamp/devdocs/blob/master/COPYRIGHT">COPYRIGHT</a> | 28 | For more information, see the <a href="https://github.com/freeCodeCamp/devdocs/blob/master/COPYRIGHT">COPYRIGHT</a> |
| @@ -48,11 +44,10 @@ app.templates.aboutPage = -> """ · 15 unmodified lines | |||
| 48 | <dt>Where can I suggest new docs and features? | 44 | <dt>Where can I suggest new docs and features? |
| 49 | <dd>You can suggest and vote for new docs on the <a href="https://trello.com/b/6BmTulfx/devdocs-documentation">Trello board</a>.<br> | 45 | <dd>You can suggest and vote for new docs on the <a href="https://trello.com/b/6BmTulfx/devdocs-documentation">Trello board</a>.<br> |
| 50 | If you have a specific feature request, add it to the <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a>.<br> | 46 | If you have a specific feature request, add it to the <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a>.<br> |
| 51 | Otherwise use the <a href="https://groups.google.com/d/forum/devdocs">mailing list</a>. | 47 | Otherwise, come talk to us in the <a href="https://gitter.im/FreeCodeCamp/DevDocs">Gitter</a> chat room. |
| 52 | <dt>Where can I report bugs? | 48 | <dt>Where can I report bugs? |
| 53 | <dd>In the <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a>. Thanks! | 49 | <dd>In the <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a>. Thanks! |
| 54 | </dl> | 50 | </dl> |
| 55 | <p>For anything else, feel free to email me at <a href="mailto:thibaut@devdocs.io">thibaut@devdocs.io</a>. | ||
| 56 | 51 | ||
| 57 | <h2 class="_block-heading" id="credits">Credits</h2> | 52 | <h2 class="_block-heading" id="credits">Credits</h2> |
| 58 | 53 | ||
| @@ -76,12 +71,12 @@ app.templates.aboutPage = -> """ · 17 unmodified lines | |||
| 76 | 71 | ||
| 77 | <h2 class="_block-heading" id="privacy">Privacy Policy</h2> | 72 | <h2 class="_block-heading" id="privacy">Privacy Policy</h2> |
| 78 | <ul> | 73 | <ul> |
| 79 | <li><a href="https://devdocs.io">devdocs.io</a> ("App") is operated by Thibaut Courouble ("We"). | 74 | <li><a href="https://devdocs.io">devdocs.io</a> ("App") is operated by <a href="https://www.freecodecamp.org/">freeCodeCamp</a> ("We"). |
| 80 | <li>We do not collect personal information. | 75 | <li>We do not collect personal information through the app. |
| 81 | <li>We use Google Analytics, Gauges and Sentry to collect anonymous traffic information and improve the app. | 76 | <li>We use Google Analytics, Gauges and Sentry to collect anonymous traffic information and improve the app. |
| 82 | <li>The app uses cookies to store user preferences. | 77 | <li>The app uses cookies to store user preferences. |
| 83 | <li>By using the app, you signify your acceptance of this policy. If you do not agree to this policy, please do not use the app. | 78 | <li>By using the app, you signify your acceptance of this policy. If you do not agree to this policy, please do not use the app. |
| 84 | <li>If you have any questions regarding privacy, please email <a href="mailto:thibaut@devdocs.io">thibaut@devdocs.io</a>. | 79 | <li>If you have any questions regarding privacy, please email <a href="mailto:privacy@freecodecamp.org">privacy@freecodecamp.org</a>. |
| 85 | </ul> | 80 | </ul> |
| 86 | """ | 81 | """ |
| 87 | 82 | ||
| @@ -102,7 +97,7 @@ credits = [ · 14 unmodified lines | |||
| 102 | 'https://www.apache.org/licenses/LICENSE-2.0' | 97 | 'https://www.apache.org/licenses/LICENSE-2.0' |
| 103 | ], [ | 98 | ], [ |
| 104 | 'Async', | 99 | 'Async', |
| 105 | '2010-2017 Caolan McMahon', | 100 | '2010-2018 Caolan McMahon', |
| 106 | 'MIT', | 101 | 'MIT', |
| 107 | 'https://raw.githubusercontent.com/caolan/async/master/LICENSE' | 102 | 'https://raw.githubusercontent.com/caolan/async/master/LICENSE' |
| 108 | ], [ | 103 | ], [ |
| @@ -192,7 +187,7 @@ credits = [ · 83 unmodified lines | |||
| 192 | 'https://raw.githubusercontent.com/jashkenas/coffeescript/master/LICENSE' | 187 | 'https://raw.githubusercontent.com/jashkenas/coffeescript/master/LICENSE' |
| 193 | ], [ | 188 | ], [ |
| 194 | 'Cordova', | 189 | 'Cordova', |
| 195 | '2012-2017 The Apache Software Foundation', | 190 | '2012-2018 The Apache Software Foundation', |
| 196 | 'Apache', | 191 | 'Apache', |
| 197 | 'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE' | 192 | 'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE' |
| 198 | ], [ | 193 | ], [ |
| @@ -372,7 +367,7 @@ credits = [ · 173 unmodified lines | |||
| 372 | 'https://raw.githubusercontent.com/jquery/api.jqueryui.com/master/LICENSE.txt' | 367 | 'https://raw.githubusercontent.com/jquery/api.jqueryui.com/master/LICENSE.txt' |
| 373 | ], [ | 368 | ], [ |
| 374 | 'Julia', | 369 | 'Julia', |
| 375 | '2009-2016 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors', | 370 | '2009-2018 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors', |
| 376 | 'MIT', | 371 | 'MIT', |
| 377 | 'https://raw.githubusercontent.com/JuliaLang/julia/master/LICENSE.md' | 372 | 'https://raw.githubusercontent.com/JuliaLang/julia/master/LICENSE.md' |
| 378 | ], [ | 373 | ], [ |
| @@ -447,7 +442,7 @@ credits = [ · 68 unmodified lines | |||
| 447 | 'https://daringfireball.net/projects/markdown/license' | 442 | 'https://daringfireball.net/projects/markdown/license' |
| 448 | ], [ | 443 | ], [ |
| 449 | 'Matplotlib', | 444 | 'Matplotlib', |
| 450 | '2012-2017 Matplotlib Development Team. All rights reserved.', | 445 | '2012-2018 Matplotlib Development Team. All rights reserved.', |
| 451 | 'Custom', | 446 | 'Custom', |
| 452 | 'https://raw.githubusercontent.com/matplotlib/matplotlib/master/LICENSE/LICENSE' | 447 | 'https://raw.githubusercontent.com/matplotlib/matplotlib/master/LICENSE/LICENSE' |
| 453 | ], [ | 448 | ], [ |
| @@ -652,7 +647,7 @@ credits = [ · 198 unmodified lines | |||
| 652 | 'http://scikit-image.org/docs/dev/license.html' | 647 | 'http://scikit-image.org/docs/dev/license.html' |
| 653 | ], [ | 648 | ], [ |
| 654 | 'scikit-learn', | 649 | 'scikit-learn', |
| 655 | '2007-2017 The scikit-learn developers', | 650 | '2007-2018 The scikit-learn developers', |
| 656 | 'BSD', | 651 | 'BSD', |
| 657 | 'https://raw.githubusercontent.com/scikit-learn/scikit-learn/master/COPYING' | 652 | 'https://raw.githubusercontent.com/scikit-learn/scikit-learn/master/COPYING' |
| 658 | ], [ | 653 | ], [ |
| @@ -697,9 +692,9 @@ credits = [ · 38 unmodified lines | |||
| 697 | 'https://raw.githubusercontent.com/hashicorp/terraform-website/master/LICENSE.md' | 692 | 'https://raw.githubusercontent.com/hashicorp/terraform-website/master/LICENSE.md' |
| 698 | ], [ | 693 | ], [ |
| 699 | 'Twig', | 694 | 'Twig', |
| 700 | '2009-2017 The Twig Team', | 695 | '2009-2018 The Twig Team', |
| 701 | 'BSD', | 696 | 'BSD', |
| 702 | 'https://twig.sensiolabs.org/license' | 697 | 'https://twig.symfony.com/license' |
| 703 | ], [ | 698 | ], [ |
| 704 | 'TypeScript', | 699 | 'TypeScript', |
| 705 | 'Microsoft and other contributors', | 700 | 'Microsoft and other contributors', |
| @@ -707,7 +702,7 @@ credits = [ · 1 unmodified line | |||
| 707 | 'https://raw.githubusercontent.com/Microsoft/TypeScript-Handbook/master/LICENSE' | 702 | 'https://raw.githubusercontent.com/Microsoft/TypeScript-Handbook/master/LICENSE' |
| 708 | ], [ | 703 | ], [ |
| 709 | 'Underscore.js', | 704 | 'Underscore.js', |
| 710 | '2009-2017 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors', | 705 | '2009-2018 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors', |
| 711 | 'MIT', | 706 | 'MIT', |
| 712 | 'https://raw.githubusercontent.com/jashkenas/underscore/master/LICENSE' | 707 | 'https://raw.githubusercontent.com/jashkenas/underscore/master/LICENSE' |
| 713 | ], [ | 708 | ], [ |
| @@ -14,7 +14,7 @@ app.templates.intro = """ · 13 unmodified lines | |||
| 14 | <li>Run <code>thor docs:download --installed</code> to update all downloaded documentations. | 14 | <li>Run <code>thor docs:download --installed</code> to update all downloaded documentations. |
| 15 | <li>To be notified about new versions, don't forget to <a href="https://github.com/freeCodeCamp/devdocs/subscription">watch the repository</a> on GitHub. | 15 | <li>To be notified about new versions, don't forget to <a href="https://github.com/freeCodeCamp/devdocs/subscription">watch the repository</a> on GitHub. |
| 16 | <li>The <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a> is the preferred channel for bug reports and | 16 | <li>The <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a> is the preferred channel for bug reports and |
| 17 | feature requests. For everything else, use the <a href="https://groups.google.com/d/forum/devdocs">mailing list</a>. | 17 | feature requests. For everything else, use <a href="https://gitter.im/FreeCodeCamp/DevDocs">Gitter</a>. |
| 18 | <li>Contributions are welcome. See the <a href="https://github.com/freeCodeCamp/devdocs/blob/master/CONTRIBUTING.md">guidelines</a>. | 18 | <li>Contributions are welcome. See the <a href="https://github.com/freeCodeCamp/devdocs/blob/master/CONTRIBUTING.md">guidelines</a>. |
| 19 | <li>DevDocs is licensed under the terms of the Mozilla Public License v2.0. For more information, | 19 | <li>DevDocs is licensed under the terms of the Mozilla Public License v2.0. For more information, |
| 20 | see the <a href="https://github.com/freeCodeCamp/devdocs/blob/master/COPYRIGHT">COPYRIGHT</a> and | 20 | see the <a href="https://github.com/freeCodeCamp/devdocs/blob/master/COPYRIGHT">COPYRIGHT</a> and |
| @@ -57,6 +57,7 @@ class app.views.OfflinePage extends app.View · 56 unmodified lines | |||
| 57 | doc[action](@onInstallSuccess.bind(@, doc), @onInstallError.bind(@, doc), @onInstallProgress.bind(@, doc)) | 57 | doc[action](@onInstallSuccess.bind(@, doc), @onInstallError.bind(@, doc), @onInstallProgress.bind(@, doc)) |
| 58 | el.parentNode.innerHTML = "#{el.textContent.replace(/e$/, '')}ing…" | 58 | el.parentNode.innerHTML = "#{el.textContent.replace(/e$/, '')}ing…" |
| 59 | else if action = el.getAttribute('data-action-all') | 59 | else if action = el.getAttribute('data-action-all') |
| 60 | return unless action isnt 'uninstall' or window.confirm('Uninstall all docs?') | ||
| 60 | app.db.migrate() | 61 | app.db.migrate() |
| 61 | $.click(el) for el in @findAll("[data-action='#{action}']") | 62 | $.click(el) for el in @findAll("[data-action='#{action}']") |
| 62 | return | 63 | return |
| @@ -77,7 +77,7 @@ class app.views.Document extends app.View · 76 unmodified lines | |||
| 77 | switch target.getAttribute('data-behavior') | 77 | switch target.getAttribute('data-behavior') |
| 78 | when 'back' then history.back() | 78 | when 'back' then history.back() |
| 79 | when 'reload' then window.location.reload() | 79 | when 'reload' then window.location.reload() |
| 80 | when 'reboot' then window.location = '/' | 80 | when 'reboot' then app.reboot() |
| 81 | when 'hard-reload' then app.reload() | 81 | when 'hard-reload' then app.reload() |
| 82 | when 'reset' then app.reset() if confirm('Are you sure you want to reset DevDocs?') | 82 | when 'reset' then app.reset() if confirm('Are you sure you want to reset DevDocs?') |
| 83 | return | 83 | return |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | |||
| 4 | //= depend_on docs-2@2x.png | 4 | //= depend_on docs-2@2x.png |
| 5 | 5 | ||
| 6 | /*! | 6 | /*! |
| 7 | * Copyright 2013-2018 Thibaut Courouble and other contributors | 7 | * Copyright 2013-2019 Thibaut Courouble and other contributors |
| 8 | * | 8 | * |
| 9 | * This source code is licensed under the terms of the Mozilla | 9 | * This source code is licensed under the terms of the Mozilla |
| 10 | * Public License, v. 2.0, a copy of which may be obtained at: | 10 | * Public License, v. 2.0, a copy of which may be obtained at: |
| @@ -460,4 +460,5 @@ · 459 unmodified lines | |||
| 460 | display: inline-block; | 460 | display: inline-block; |
| 461 | vertical-align: text-top; | 461 | vertical-align: text-top; |
| 462 | margin-left: .25rem; | 462 | margin-left: .25rem; |
| 463 | background: inherit; | ||
| 463 | } | 464 | } |
| @@ -32,5 +32,3 @@ · 31 unmodified lines | |||
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | ._fail-text:last-child { margin: 0; } | 34 | ._fail-text:last-child { margin: 0; } |
| 35 | |||
| 36 | ._fail-link { float: right; } | ||
| @@ -30,6 +30,7 @@ · 29 unmodified lines | |||
| 30 | .notice, | 30 | .notice, |
| 31 | .warning, | 31 | .warning, |
| 32 | .overheadIndicator, | 32 | .overheadIndicator, |
| 33 | .blockIndicator, | ||
| 33 | .syntaxbox, // CSS, JavaScript | 34 | .syntaxbox, // CSS, JavaScript |
| 34 | .twopartsyntaxbox, // CSS | 35 | .twopartsyntaxbox, // CSS |
| 35 | .inheritsbox, // JavaScript | 36 | .inheritsbox, // JavaScript |
| @@ -104,4 +105,28 @@ · 68 unmodified lines | |||
| 104 | .cleared { clear: both; } // CSS/box-shadow | 105 | .cleared { clear: both; } // CSS/box-shadow |
| 105 | 106 | ||
| 106 | code > strong { font-weight: normal; } | 107 | code > strong { font-weight: normal; } |
| 108 | |||
| 109 | // Compatibility tablees | ||
| 110 | |||
| 111 | .bc-github-link { | ||
| 112 | float: right; | ||
| 113 | font-size: .75rem; | ||
| 114 | } | ||
| 115 | |||
| 116 | .bc-supports-yes, .bc-supports-yes + dd, .bc-supports-yes + dd + dd { background: var(--noteGreenBackground); } | ||
| 117 | .bc-supports-partial, .bc-supports-partial + dd, .bc-supports-partial + dd + dd { background: var(--noteOrangeBackground); } | ||
| 118 | .bc-supports-no, .bc-supports-no + dd, .bc-supports-no + dd + dd { background: var(--noteRedBackground); } | ||
| 119 | |||
| 120 | .bc-table { | ||
| 121 | min-width: 100%; | ||
| 122 | |||
| 123 | dl { | ||
| 124 | margin: .25rem 0 0; | ||
| 125 | padding: .25rem 0 0; | ||
| 126 | font-size: .75rem; | ||
| 127 | border-top: 1px solid var(--boxBorder); | ||
| 128 | } | ||
| 129 | |||
| 130 | dd { margin: 0; } | ||
| 131 | } | ||
| 107 | } | 132 | } |
| @@ -20,5 +20,8 @@ · 19 unmodified lines | |||
| 20 | margin: 0 0 1em 1em; | 20 | margin: 0 0 1em 1em; |
| 21 | @extend %label; | 21 | @extend %label; |
| 22 | } | 22 | } |
| 23 | |||
| 24 | .srclink { float: right; } | ||
| 25 | details > table { margin: 0; } | ||
| 23 | } | 26 | } |
| 24 | 27 | ||
| @@ -33,19 +33,8 @@ · 32 unmodified lines | |||
| 33 | } | 33 | } |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | .method-description { position: relative; } | ||
| 37 | |||
| 38 | .method-source-code { | 36 | .method-source-code { |
| 39 | display: none; | 37 | display: none; |
| 40 | position: absolute; | ||
| 41 | z-index: 1; | ||
| 42 | top: 0; | ||
| 43 | left: -1em; | ||
| 44 | right: 0; | ||
| 45 | background: var(--contentBackground); | ||
| 46 | box-shadow: 0 1em 1em 1em var(--contentBackground); | ||
| 47 | |||
| 48 | > pre { margin: 0; } | ||
| 49 | } | 38 | } |
| 50 | 39 | ||
| 51 | // Rails guides | 40 | // Rails guides |
| @@ -0,0 +1,102 @@ | |||
| 1 | # Maintainer's Guide | ||
| 2 | |||
| 3 | This document is intended for [DevDocs maintainers](#list-of-maintainers). | ||
| 4 | |||
| 5 | ## Merging pull requests | ||
| 6 | |||
| 7 | - Unless the change is trivial or in an area that you are familiar with, PRs should be approved by at least two maintainers before being merged. | ||
| 8 | |||
| 9 | - PRs that add or update documentations should always be merged locally, and the app deployed, before the merge is pushed to GitHub. | ||
| 10 | |||
| 11 | This workflow is required because there is a dependency between the local and production environments. The `thor docs:download` command downloads documentations from production files uploaded by the `thor docs:upload` command. If a PR adding a new documentation is merged and pushed to GitHub before the files have been uploaded to production, the `thor docs:download` will fail for the new documentation and the docker container will not build properly until the new documentation is deployed to production. | ||
| 12 | |||
| 13 | ## Updating docs | ||
| 14 | |||
| 15 | The process for updating docs is as follow: | ||
| 16 | |||
| 17 | - Make version/release changes in the scraper file. | ||
| 18 | - If needed, update the copyright notice of the documentation in the scraper file (`options[:attribution]`) and the about page (`about_tmpl.coffee`). The copyright notice must be the same as the one on the original documentation. | ||
| 19 | - Run `thor docs:generate`. | ||
| 20 | - Make sure the documentation still works well. The `thor docs:generate` command outputs a summary of the changes, which helps identifying issues (e.g. deleted files) and new pages to check out in the app. Verify locally that everything works, especially the files that were created (if any), and that the categorization of entries is still good. Often, updates will require code changes to tweak some new markup in the source website or categorize new entries. | ||
| 21 | - Commit the changes (protip: use the `thor docs:commit` command documented below). | ||
| 22 | - Optional: do more updates. | ||
| 23 | - Run `thor docs:upload` (documented below). | ||
| 24 | - [Deploy the app](#deploying-devdocs) and verify that everything works in production. | ||
| 25 | - Push to GitHub. | ||
| 26 | - Run `thor docs:clean` (documented below). | ||
| 27 | |||
| 28 | Note: changes to `public/docs/docs.json` should never be committed. This file reflects which documentations have been downloaded or generated locally, which is always none on a fresh `git clone`. | ||
| 29 | |||
| 30 | ## Setup requirements | ||
| 31 | |||
| 32 | In order to deploy DevDocs, you must: | ||
| 33 | |||
| 34 | - be given access to Heroku, [configure the Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) on your computer, and familiarize yourself with Heroku's UI and CLI, as well as that of New Relic (accessible through [the Heroku dashboard](https://dashboard.heroku.com/apps/devdocs)). | ||
| 35 | |||
| 36 | - be given access to DevDocs's [Sentry instance](https://sentry.io/devdocs/devdocs-js/) (for JS error tracking) and familiarize yourself with its UI. | ||
| 37 | |||
| 38 | - be provided with DevDocs's S3 credentials, and install (`brew install awscli` on macOS) and [configure](https://docs.aws.amazon.com/cli/latest/reference/configure/) the AWS CLI on your computer. The configuration must add a named profile called "devdocs": | ||
| 39 | ``` | ||
| 40 | aws configure --profile devdocs | ||
| 41 | ``` | ||
| 42 | |||
| 43 | - be provided with DevDocs's MaxCDN push zone credentials, and add them to your `.bash_profile` as such: | ||
| 44 | ``` | ||
| 45 | export DEVDOCS_DL_USERNAME="username" | ||
| 46 | export DEVDOCS_DL_PASSWORD="password" | ||
| 47 | ``` | ||
| 48 | |||
| 49 | ## Thor commands | ||
| 50 | |||
| 51 | In addition to the [publicly-documented commands](https://github.com/freeCodeCamp/devdocs#available-commands), the following commands are aimed at DevDocs maintainers: | ||
| 52 | |||
| 53 | - `thor docs:package` | ||
| 54 | |||
| 55 | Generates packages for one or more documentations. Those packages are intended to be uploaded to DevDocs's MaxCDN push zone by maintainers via the `thor docs:upload` command, and downloaded by users via the `thor docs:download` command. | ||
| 56 | |||
| 57 | Versions can be specified as such: `thor docs:package rails@5.2 node@10\ LTS`. | ||
| 58 | |||
| 59 | Packages can also be automatically generated during the scraping process by passing the `--package` option to `thor docs:generate`. | ||
| 60 | |||
| 61 | - `thor docs:upload` | ||
| 62 | |||
| 63 | This command does two operations: | ||
| 64 | |||
| 65 | 1. sync the files for the specified documentations with S3 (used by the Heroku app); | ||
| 66 | 2. upload the documentations' packages to DevDocs's MaxCDN push zone (used by the `thor docs:download` command). | ||
| 67 | |||
| 68 | For the command to work, you must have the AWS CLI and MaxCDN credentials configured as indicated above. | ||
| 69 | |||
| 70 | **Important:** the app should always be deployed immediately after this command has finished running. Do not run this command unless you are able and ready to deploy DevDocs. | ||
| 71 | |||
| 72 | To upload all documentations that are packaged on your computer, run `thor docs:upload --packaged`. | ||
| 73 | To test your configuration and the effect of this command without uploading anything, pass the `--dryrun` option. | ||
| 74 | |||
| 75 | - `thor docs:commit` | ||
| 76 | |||
| 77 | Shortcut command to create a Git commit for a given documentation once it has been updated. Scraper and `assets/` file changes will be committed. The commit message will include the most recent version that the documentation was updated to. If some files were missed by the commit, use `git commit --amend` to add them to the commit. The command may be run before `thor docs:upload` is run, but the commit should not be pushed to GitHub before the files have been uploaded and the app deployed. | ||
| 78 | |||
| 79 | - `thor docs:clean` | ||
| 80 | |||
| 81 | Shortcut command to delete all package files (once uploaded via `thor docs:upload`, they are not needed anymore). | ||
| 82 | |||
| 83 | ## Deploying DevDocs | ||
| 84 | |||
| 85 | Once docs have been uploaded via `thor docs:upload` (if applicable), deploying DevDocs is as simple as running `git push heroku master`. See [Heroku's documentation](https://devcenter.heroku.com/articles/git) for more information. | ||
| 86 | |||
| 87 | - If you're deploying documentation updates, verify that the documentations work properly once the deploy is done (you will need to reload [devdocs.io](https://devdocs.io/) a couple times for the application cache to update and the new version to load). | ||
| 88 | - If you're deploying frontend changes, monitor [Sentry](https://sentry.io/devdocs/devdocs-js/) for new JS errors once the deploy is done. | ||
| 89 | - If you're deploying server changes, monitor New Relic (accessible through [the Heroku dashboard](https://dashboard.heroku.com/apps/devdocs)) for Ruby exceptions and throughput or response time changes once the deploy is done. | ||
| 90 | |||
| 91 | If any issue arises, run `heroku rollback` to rollback to the previous of the app (this can also be done via Heroku's UI). Note that this will not revert changes made to documentation files that were uploaded via `thor docs:upload`. Try and fix the issue as quickly as possible, then re-deploy the app. Reach out to other maintainers if you need help. | ||
| 92 | |||
| 93 | If this is your first deploy, make sure another maintainer is around to assist. | ||
| 94 | |||
| 95 | ## List of maintainers | ||
| 96 | |||
| 97 | - [Beau Carnes](https://github.com/beaucarnes) | ||
| 98 | - [Jed Fox](https://github.com/j-f1) | ||
| 99 | - [Jasper van Merle](https://github.com/jmerle) | ||
| 100 | - [Thibaut Courouble](https://github.com/thibaut) | ||
| 101 | |||
| 102 | Interested in helping maintain DevDocs? Come talk to us on [Gitter](https://gitter.im/FreeCodeCamp/DevDocs) :) | ||
| @@ -12,7 +12,7 @@ class App < Sinatra::Application · 11 unmodified lines | |||
| 12 | Rack::Mime::MIME_TYPES['.webapp'] = 'application/x-web-app-manifest+json' | 12 | Rack::Mime::MIME_TYPES['.webapp'] = 'application/x-web-app-manifest+json' |
| 13 | 13 | ||
| 14 | configure do | 14 | configure do |
| 15 | use Rack::SslEnforcer, only_environments: ['production', 'test'], hsts: false, force_secure_cookies: false | 15 | use Rack::SslEnforcer, only_environments: ['production', 'test'], hsts: true, force_secure_cookies: false |
| 16 | 16 | ||
| 17 | set :sentry_dsn, ENV['SENTRY_DSN'] | 17 | set :sentry_dsn, ENV['SENTRY_DSN'] |
| 18 | set :protection, except: [:frame_options, :xss_header] | 18 | set :protection, except: [:frame_options, :xss_header] |
| @@ -69,7 +69,7 @@ class App < Sinatra::Application · 50 unmodified lines | |||
| 69 | set :static, false | 69 | set :static, false |
| 70 | set :cdn_origin, 'https://cdn.devdocs.io' | 70 | set :cdn_origin, 'https://cdn.devdocs.io' |
| 71 | set :docs_origin, '//docs.devdocs.io' | 71 | set :docs_origin, '//docs.devdocs.io' |
| 72 | set :csp, "default-src 'self' *; script-src 'self' 'nonce-devdocs' http://cdn.devdocs.io https://cdn.devdocs.io https://www.google-analytics.com https://secure.gaug.es http://*.jquery.com https://*.jquery.com; font-src 'none'; style-src 'self' 'unsafe-inline' *; img-src 'self' * data:;" | 72 | set :csp, "default-src 'self' *; script-src 'self' 'nonce-devdocs' https://cdn.devdocs.io https://www.google-analytics.com https://secure.gaug.es https://*.jquery.com; font-src 'none'; style-src 'self' 'unsafe-inline' *; img-src 'self' * data:;" |
| 73 | 73 | ||
| 74 | use Rack::ConditionalGet | 74 | use Rack::ConditionalGet |
| 75 | use Rack::ETag | 75 | use Rack::ETag |
| @@ -1,5 +1,5 @@ | |||
| 1 | require 'bundler/setup' | 1 | require 'bundler/setup' |
| 2 | Bundler.require :docs | 2 | Bundler.require :default, :docs |
| 3 | 3 | ||
| 4 | require 'active_support' | 4 | require 'active_support' |
| 5 | require 'active_support/core_ext' | 5 | require 'active_support/core_ext' |
| @@ -29,6 +29,7 @@ module Docs · 23 unmodified lines | |||
| 29 | self.rescue_errors = false | 29 | self.rescue_errors = false |
| 30 | 30 | ||
| 31 | class DocNotFound < NameError; end | 31 | class DocNotFound < NameError; end |
| 32 | class SetupError < StandardError; end | ||
| 32 | 33 | ||
| 33 | def self.all | 34 | def self.all |
| 34 | Dir["#{root_path}/docs/scrapers/**/*.rb"]. | 35 | Dir["#{root_path}/docs/scrapers/**/*.rb"]. |
| @@ -74,6 +75,22 @@ module Docs · 39 unmodified lines | |||
| 74 | end | 75 | end |
| 75 | end | 76 | end |
| 76 | 77 | ||
| 78 | def self.find_by_slug(slug, version = nil) | ||
| 79 | doc = all.find { |klass| klass.slug == slug } | ||
| 80 | |||
| 81 | unless doc | ||
| 82 | raise DocNotFound.new(%(could not find doc with "#{slug}"), slug) | ||
| 83 | end | ||
| 84 | |||
| 85 | if version.present? | ||
| 86 | version = doc.versions.find { |klass| klass.version == version || klass.version_slug == version } | ||
| 87 | raise DocNotFound.new(%(could not find version "#{version}" for doc "#{doc.name}"), doc.name) unless version | ||
| 88 | doc = version | ||
| 89 | end | ||
| 90 | |||
| 91 | doc | ||
| 92 | end | ||
| 93 | |||
| 77 | def self.generate_page(name, version, page_id) | 94 | def self.generate_page(name, version, page_id) |
| 78 | find(name, version).store_page(store, page_id) | 95 | find(name, version).store_page(store, page_id) |
| 79 | end | 96 | end |
| @@ -95,6 +95,9 @@ module Docs · 94 unmodified lines | |||
| 95 | false | 95 | false |
| 96 | end | 96 | end |
| 97 | end | 97 | end |
| 98 | rescue Docs::SetupError => error | ||
| 99 | puts "ERROR: #{error.message}" | ||
| 100 | false | ||
| 98 | end | 101 | end |
| 99 | 102 | ||
| 100 | def store_pages(store) | 103 | def store_pages(store) |
| @@ -118,6 +121,9 @@ module Docs · 17 unmodified lines | |||
| 118 | false | 121 | false |
| 119 | end | 122 | end |
| 120 | end | 123 | end |
| 124 | rescue Docs::SetupError => error | ||
| 125 | puts "ERROR: #{error.message}" | ||
| 126 | false | ||
| 121 | end | 127 | end |
| 122 | 128 | ||
| 123 | private | 129 | private |
| @@ -1,5 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Requester < Typhoeus::Hydra | 2 | class Requester < Typhoeus::Hydra |
| 3 | include Instrumentable | ||
| 4 | |||
| 3 | attr_reader :request_options | 5 | attr_reader :request_options |
| 4 | 6 | ||
| 5 | def self.run(urls, options = {}, &block) | 7 | def self.run(urls, options = {}, &block) |
| @@ -20,7 +22,7 @@ module Docs · 14 unmodified lines | |||
| 20 | def initialize(options = {}) | 22 | def initialize(options = {}) |
| 21 | @request_options = options.extract!(:request_options)[:request_options].try(:dup) || {} | 23 | @request_options = options.extract!(:request_options)[:request_options].try(:dup) || {} |
| 22 | options[:max_concurrency] ||= 20 | 24 | options[:max_concurrency] ||= 20 |
| 23 | options[:pipelining] = false | 25 | options[:pipelining] = 0 |
| 24 | super | 26 | super |
| 25 | end | 27 | end |
| 26 | 28 | ||
| @@ -52,9 +54,11 @@ module Docs · 25 unmodified lines | |||
| 52 | end | 54 | end |
| 53 | 55 | ||
| 54 | def handle_response(response) | 56 | def handle_response(response) |
| 55 | on_response.each do |callback| | 57 | instrument 'handle_response.requester', url: response.url do |
| 56 | result = callback.call(response) | 58 | on_response.each do |callback| |
| 57 | result.each { |url| request(url) } if result.is_a? Array | 59 | result = callback.call(response) |
| 60 | result.each { |url| request(url) } if result.is_a?(Array) | ||
| 61 | end | ||
| 58 | end | 62 | end |
| 59 | end | 63 | end |
| 60 | end | 64 | end |
| @@ -1,14 +1,13 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class FileScraper < Scraper | 2 | class FileScraper < Scraper |
| 3 | SOURCE_DIRECTORY = File.expand_path '../../../../../docs', __FILE__ | ||
| 4 | |||
| 3 | Response = Struct.new :body, :url | 5 | Response = Struct.new :body, :url |
| 4 | 6 | ||
| 5 | class << self | 7 | class << self |
| 6 | attr_accessor :dir | ||
| 7 | |||
| 8 | def inherited(subclass) | 8 | def inherited(subclass) |
| 9 | super | 9 | super |
| 10 | subclass.base_url = base_url | 10 | subclass.base_url = base_url |
| 11 | subclass.dir = dir | ||
| 12 | end | 11 | end |
| 13 | end | 12 | end |
| 14 | 13 | ||
| @@ -16,13 +15,25 @@ module Docs · 1 unmodified line | |||
| 16 | 15 | ||
| 17 | html_filters.push 'clean_local_urls' | 16 | html_filters.push 'clean_local_urls' |
| 18 | 17 | ||
| 18 | def source_directory | ||
| 19 | @source_directory ||= File.join(SOURCE_DIRECTORY, self.class.path) | ||
| 20 | end | ||
| 21 | |||
| 19 | private | 22 | private |
| 20 | 23 | ||
| 24 | def assert_source_directory_exists | ||
| 25 | unless Dir.exists?(source_directory) | ||
| 26 | raise SetupError, "The #{self.class.name} scraper requires the original documentation files to be stored in the \"#{source_directory}\" directory." | ||
| 27 | end | ||
| 28 | end | ||
| 29 | |||
| 21 | def request_one(url) | 30 | def request_one(url) |
| 22 | Response.new read_file(file_path_for(url)), URL.parse(url) | 31 | assert_source_directory_exists |
| 32 | Response.new read_file(url_to_path(url)), URL.parse(url) | ||
| 23 | end | 33 | end |
| 24 | 34 | ||
| 25 | def request_all(urls) | 35 | def request_all(urls) |
| 36 | assert_source_directory_exists | ||
| 26 | queue = [urls].flatten | 37 | queue = [urls].flatten |
| 27 | until queue.empty? | 38 | until queue.empty? |
| 28 | result = yield request_one(queue.shift) | 39 | result = yield request_one(queue.shift) |
| @@ -34,12 +45,12 @@ module Docs · 5 unmodified lines | |||
| 34 | response.body.present? | 45 | response.body.present? |
| 35 | end | 46 | end |
| 36 | 47 | ||
| 37 | def file_path_for(url) | 48 | def url_to_path(url) |
| 38 | File.join self.class.dir, url.remove(base_url.to_s) | 49 | url.remove(base_url.to_s) |
| 39 | end | 50 | end |
| 40 | 51 | ||
| 41 | def read_file(path) | 52 | def read_file(path) |
| 42 | File.read(path) | 53 | File.read(File.join(source_directory, path)) |
| 43 | rescue | 54 | rescue |
| 44 | instrument 'warn.doc', msg: "Failed to open file: #{path}" | 55 | instrument 'warn.doc', msg: "Failed to open file: #{path}" |
| 45 | nil | 56 | nil |
| @@ -72,7 +72,7 @@ module Docs · 71 unmodified lines | |||
| 72 | 72 | ||
| 73 | if base == dest | 73 | if base == dest |
| 74 | '' | 74 | '' |
| 75 | elsif dest.start_with? File.join(base, '') | 75 | elsif dest.start_with?(::File.join(base, '')) |
| 76 | url.path[(path.length)..-1] | 76 | url.path[(path.length)..-1] |
| 77 | end | 77 | end |
| 78 | end | 78 | end |
| @@ -20,8 +20,8 @@ module Docs · 19 unmodified lines | |||
| 20 | def additional_entries | 20 | def additional_entries |
| 21 | return [] unless subpath.start_with?('helpers') && subpath != 'helpers/' | 21 | return [] unless subpath.start_with?('helpers') && subpath != 'helpers/' |
| 22 | 22 | ||
| 23 | css('h2').each_with_object [] do |node, entries| | 23 | css('h2, h3').each_with_object [] do |node, entries| |
| 24 | next if node['id'] == 'access-from-helpers' | 24 | next if node['id'] == 'access-from-helpers' || node.content !~ /\s*[a-z_]/ |
| 25 | entries << ["#{node.content} (#{name})", node['id']] | 25 | entries << ["#{node.content} (#{name})", node['id']] |
| 26 | end | 26 | end |
| 27 | end | 27 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Cordova | 2 | class Cordova |
| 3 | class CleanHtmlFilter < Filter | 3 | class CleanHtmlFilter < Filter |
| 4 | def call | 4 | def call |
| 5 | @doc = at_css('.page-content > div') | 5 | @doc = at_css('#page-toc-source') || at_css('.page-content > div') |
| 6 | 6 | ||
| 7 | at_css('h1').content = 'Apache Cordova' if root_page? | 7 | at_css('h1').content = 'Apache Cordova' if root_page? |
| 8 | 8 | ||
| @@ -31,6 +31,8 @@ module Docs · 30 unmodified lines | |||
| 31 | 'Keywords' | 31 | 'Keywords' |
| 32 | elsif subpath.start_with?('experimental') | 32 | elsif subpath.start_with?('experimental') |
| 33 | 'Experimental libraries' | 33 | 'Experimental libraries' |
| 34 | elsif subpath.start_with?('language/') | ||
| 35 | 'Language' | ||
| 34 | elsif type = at_css('.t-navbar > div:nth-child(4) > :first-child').try(:content) | 36 | elsif type = at_css('.t-navbar > div:nth-child(4) > :first-child').try(:content) |
| 35 | type.strip! | 37 | type.strip! |
| 36 | type.remove! ' library' | 38 | type.remove! ' library' |
| @@ -6,13 +6,16 @@ module Docs · 5 unmodified lines | |||
| 6 | 'CSS_Background_and_Borders' => 'Backgrounds & Borders', | 6 | 'CSS_Background_and_Borders' => 'Backgrounds & Borders', |
| 7 | 'CSS_Columns' => 'Multi-column Layout', | 7 | 'CSS_Columns' => 'Multi-column Layout', |
| 8 | 'CSS_Flexible_Box_Layout' => 'Flexible Box Layout', | 8 | 'CSS_Flexible_Box_Layout' => 'Flexible Box Layout', |
| 9 | 'CSS_Fonts' => 'Fonts', | ||
| 9 | 'CSS_Grid_Layout' => 'Grid Layout', | 10 | 'CSS_Grid_Layout' => 'Grid Layout', |
| 10 | 'CSS_Images' => 'Images', | 11 | 'CSS_Images' => 'Images', |
| 11 | 'CSS_Lists_and_Counters' => 'Lists', | 12 | 'CSS_Lists_and_Counters' => 'Lists', |
| 12 | 'CSS_Transforms' => 'Transforms', | 13 | 'CSS_Transforms' => 'Transforms', |
| 13 | 'Media_Queries' => 'Media Queries', | 14 | 'Media_Queries' => 'Media Queries', |
| 15 | 'filter-function' => 'Filter Effects', | ||
| 14 | 'transform-function' => 'Transforms', | 16 | 'transform-function' => 'Transforms', |
| 15 | '@media' => 'Media Queries', | 17 | '@media' => 'Media Queries', |
| 18 | 'overscroll' => 'Overscroll', | ||
| 16 | 'text-size-adjust' => 'Miscellaneous', | 19 | 'text-size-adjust' => 'Miscellaneous', |
| 17 | 'resolved_value' => 'Miscellaneous', | 20 | 'resolved_value' => 'Miscellaneous', |
| 18 | 'touch-action' => 'Miscellaneous', | 21 | 'touch-action' => 'Miscellaneous', |
| @@ -42,7 +45,7 @@ module Docs · 23 unmodified lines | |||
| 42 | end | 45 | end |
| 43 | 46 | ||
| 44 | def get_type | 47 | def get_type |
| 45 | if slug.include?('-webkit') || slug.include?('-moz') | 48 | if slug.include?('-webkit') || slug.include?('-moz') || slug.include?('-ms') |
| 46 | 'Extensions' | 49 | 'Extensions' |
| 47 | elsif type = TYPE_BY_PATH[slug.split('/').first] | 50 | elsif type = TYPE_BY_PATH[slug.split('/').first] |
| 48 | type | 51 | type |
| @@ -66,19 +69,22 @@ module Docs · 17 unmodified lines | |||
| 66 | 'Pseudo-Elements' | 69 | 'Pseudo-Elements' |
| 67 | elsif name.start_with?(':') | 70 | elsif name.start_with?(':') |
| 68 | 'Selectors' | 71 | 'Selectors' |
| 72 | elsif name.start_with?('display-') | ||
| 73 | 'Display' | ||
| 69 | else | 74 | else |
| 70 | 'Miscellaneous' | 75 | 'Miscellaneous' |
| 71 | end | 76 | end |
| 72 | end | 77 | end |
| 73 | 78 | ||
| 74 | STATUSES = { | 79 | STATUSES = { |
| 75 | 'spec-Living' => 0, | 80 | 'spec-Living' => 0, |
| 76 | 'spec-REC' => 1, | 81 | 'spec-REC' => 1, |
| 77 | 'spec-CR' => 2, | 82 | 'spec-CR' => 2, |
| 78 | 'spec-PR' => 3, | 83 | 'spec-PR' => 3, |
| 79 | 'spec-LC' => 4, | 84 | 'spec-LC' => 4, |
| 80 | 'spec-WD' => 5, | 85 | 'spec-WD' => 5, |
| 81 | 'spec-ED' => 6 | 86 | 'spec-ED' => 6, |
| 87 | 'spec-Obsolete' => 7 | ||
| 82 | } | 88 | } |
| 83 | 89 | ||
| 84 | PRIORITY_STATUSES = %w(spec-REC spec-CR) | 90 | PRIORITY_STATUSES = %w(spec-REC spec-CR) |
| @@ -86,6 +92,7 @@ module Docs · 1 unmodified line | |||
| 86 | 92 | ||
| 87 | def get_spec | 93 | def get_spec |
| 88 | return unless table = at_css('#Specifications + table') || css('.standard-table').last | 94 | return unless table = at_css('#Specifications + table') || css('.standard-table').last |
| 95 | |||
| 89 | specs = table.css('tbody tr').to_a | 96 | specs = table.css('tbody tr').to_a |
| 90 | # [link, span] | 97 | # [link, span] |
| 91 | specs.map! { |node| [node.at_css('> td:nth-child(1) > a'), node.at_css('> td:nth-child(2) > span')] } | 98 | specs.map! { |node| [node.at_css('> td:nth-child(1) > a'), node.at_css('> td:nth-child(2) > span')] } |
| @@ -110,8 +117,8 @@ module Docs · 18 unmodified lines | |||
| 110 | 'shape' => [ | 117 | 'shape' => [ |
| 111 | %w(rect() Syntax) ], | 118 | %w(rect() Syntax) ], |
| 112 | 'timing-function' => [ | 119 | 'timing-function' => [ |
| 113 | %w(cubic-bezier() The_cubic-bezier()_class_of_timing-functions), | 120 | %w(cubic-bezier()), |
| 114 | %w(steps() The_steps()_class_of_timing-functions), | 121 | %w(steps()), |
| 115 | %w(linear linear), | 122 | %w(linear linear), |
| 116 | %w(ease ease), | 123 | %w(ease ease), |
| 117 | %w(ease-in ease-in), | 124 | %w(ease-in ease-in), |
| @@ -30,7 +30,7 @@ module Docs · 29 unmodified lines | |||
| 30 | end | 30 | end |
| 31 | 31 | ||
| 32 | # Remove <div> wrapping .overheadIndicator | 32 | # Remove <div> wrapping .overheadIndicator |
| 33 | css('div > .overheadIndicator:first-child:last-child').each do |node| | 33 | css('div > .overheadIndicator:first-child:last-child', 'div > .blockIndicator:first-child:last-child').each do |node| |
| 34 | node.parent.replace(node) | 34 | node.parent.replace(node) |
| 35 | end | 35 | end |
| 36 | 36 | ||
| @@ -6,6 +6,7 @@ module Docs · 5 unmodified lines | |||
| 6 | 'EXT_' => 'WebGL', | 6 | 'EXT_' => 'WebGL', |
| 7 | 'OES_' => 'WebGL', | 7 | 'OES_' => 'WebGL', |
| 8 | 'WEBGL_' => 'WebGL', | 8 | 'WEBGL_' => 'WebGL', |
| 9 | 'Sensor API' => 'Sensors', | ||
| 9 | 'Ambient Light' => 'Ambient Light', | 10 | 'Ambient Light' => 'Ambient Light', |
| 10 | 'Audio' => 'Audio', | 11 | 'Audio' => 'Audio', |
| 11 | 'Battery Status' => 'Battery Status', | 12 | 'Battery Status' => 'Battery Status', |
| @@ -22,10 +23,12 @@ module Docs · 10 unmodified lines | |||
| 22 | 'Encrypted Media Extensions' => 'Encrypted Media', | 23 | 'Encrypted Media Extensions' => 'Encrypted Media', |
| 23 | 'Fetch' => 'Fetch', | 24 | 'Fetch' => 'Fetch', |
| 24 | 'File API' => 'File', | 25 | 'File API' => 'File', |
| 26 | 'Fullscreen' => 'Fullscreen', | ||
| 25 | 'Geolocation' => 'Geolocation', | 27 | 'Geolocation' => 'Geolocation', |
| 26 | 'Geometry' => 'Geometry', | 28 | 'Geometry' => 'Geometry', |
| 27 | 'High Resolution Time' => 'Performance', | 29 | 'High Resolution Time' => 'Performance', |
| 28 | 'Intersection' => 'Intersection Observer', | 30 | 'Intersection' => 'Intersection Observer', |
| 31 | 'Keyboard' => 'Keyboard', | ||
| 29 | 'Media Capabilities' => 'Media', | 32 | 'Media Capabilities' => 'Media', |
| 30 | 'Media Capture' => 'Media', | 33 | 'Media Capture' => 'Media', |
| 31 | 'Media Session' => 'Media', | 34 | 'Media Session' => 'Media', |
| @@ -35,6 +38,7 @@ module Docs · 3 unmodified lines | |||
| 35 | 'MIDI' => 'Audio', | 38 | 'MIDI' => 'Audio', |
| 36 | 'Navigation Timing' => 'Performance', | 39 | 'Navigation Timing' => 'Performance', |
| 37 | 'Network Information' => 'Network Information', | 40 | 'Network Information' => 'Network Information', |
| 41 | 'Orientation Sensor' => 'Sensors', | ||
| 38 | 'Payment' => 'Payments', | 42 | 'Payment' => 'Payments', |
| 39 | 'Performance Timeline' => 'Performance', | 43 | 'Performance Timeline' => 'Performance', |
| 40 | 'Pointer Events' => 'Pointer Events', | 44 | 'Pointer Events' => 'Pointer Events', |
| @@ -53,11 +57,13 @@ module Docs · 12 unmodified lines | |||
| 53 | 'Web App Manifest' => 'Web App Manifest', | 57 | 'Web App Manifest' => 'Web App Manifest', |
| 54 | 'Budget' => 'Budget', | 58 | 'Budget' => 'Budget', |
| 55 | 'Web Authentication' => 'Authentication', | 59 | 'Web Authentication' => 'Authentication', |
| 60 | 'Web Locks' => 'Locks', | ||
| 56 | 'Web Workers' => 'Web Workers', | 61 | 'Web Workers' => 'Web Workers', |
| 57 | 'WebGL' => 'WebGL', | 62 | 'WebGL' => 'WebGL', |
| 58 | 'WebRTC' => 'WebRTC', | 63 | 'WebRTC' => 'WebRTC', |
| 59 | 'WebUSB' => 'WebUSB', | 64 | 'WebUSB' => 'WebUSB', |
| 60 | 'WebVR' => 'WebVR' } | 65 | 'WebVR' => 'WebVR', |
| 66 | 'WebVTT' => 'WebVTT' } | ||
| 61 | 67 | ||
| 62 | TYPE_BY_NAME_STARTS_WITH = { | 68 | TYPE_BY_NAME_STARTS_WITH = { |
| 63 | 'AbortController' => 'Fetch', | 69 | 'AbortController' => 'Fetch', |
| @@ -89,10 +95,12 @@ module Docs · 25 unmodified lines | |||
| 89 | 'Fetch' => 'Fetch', | 95 | 'Fetch' => 'Fetch', |
| 90 | 'File' => 'File', | 96 | 'File' => 'File', |
| 91 | 'GlobalEventHandlers' => 'GlobalEventHandlers', | 97 | 'GlobalEventHandlers' => 'GlobalEventHandlers', |
| 98 | 'HMDVR' => 'WebVR', | ||
| 92 | 'history' => 'History', | 99 | 'history' => 'History', |
| 93 | 'HTML Drag' => 'Drag & Drop', | 100 | 'HTML Drag' => 'Drag & Drop', |
| 94 | 'HTML' => 'Elements', | 101 | 'HTML' => 'Elements', |
| 95 | 'IDB' => 'IndexedDB', | 102 | 'IDB' => 'IndexedDB', |
| 103 | 'Keyboard' => 'Keyboard', | ||
| 96 | 'location' => 'Location', | 104 | 'location' => 'Location', |
| 97 | 'navigator' => 'Navigator', | 105 | 'navigator' => 'Navigator', |
| 98 | 'MediaKeySession' => 'Encrypted Media', | 106 | 'MediaKeySession' => 'Encrypted Media', |
| @@ -122,6 +130,7 @@ module Docs · 23 unmodified lines | |||
| 122 | 'StyleSheet' => 'CSS', | 130 | 'StyleSheet' => 'CSS', |
| 123 | 'Stylesheet' => 'CSS', | 131 | 'Stylesheet' => 'CSS', |
| 124 | 'SVG' => 'SVG', | 132 | 'SVG' => 'SVG', |
| 133 | 'TextTrack' => 'WebVTT', | ||
| 125 | 'TimeRanges' => 'Media', | 134 | 'TimeRanges' => 'Media', |
| 126 | 'timing' => 'Performance', | 135 | 'timing' => 'Performance', |
| 127 | 'Timing' => 'Performance', | 136 | 'Timing' => 'Performance', |
| @@ -160,6 +169,7 @@ module Docs · 32 unmodified lines | |||
| 160 | 'timing' => 'Performance', | 169 | 'timing' => 'Performance', |
| 161 | 'Timing' => 'Performance', | 170 | 'Timing' => 'Performance', |
| 162 | 'udio' => 'Audio', | 171 | 'udio' => 'Audio', |
| 172 | 'VRDevice' => 'WebVR', | ||
| 163 | 'WebGL' => 'WebGL', | 173 | 'WebGL' => 'WebGL', |
| 164 | 'WEBGL' => 'WebGL', | 174 | 'WEBGL' => 'WebGL', |
| 165 | 'WebRTC' => 'WebRTC', | 175 | 'WebRTC' => 'WebRTC', |
| @@ -239,7 +249,7 @@ module Docs · 73 unmodified lines | |||
| 239 | 249 | ||
| 240 | def include_default_entry? | 250 | def include_default_entry? |
| 241 | return true if type == 'Console' | 251 | return true if type == 'Console' |
| 242 | return true unless node = doc.at_css('.overheadIndicator') | 252 | return true unless node = doc.at_css('.overheadIndicator, .blockIndicator') |
| 243 | node = node.parent while node.parent != doc | 253 | node = node.parent while node.parent != doc |
| 244 | return true if node.previous_element.try(:name).in?(%w(h2 h3)) | 254 | return true if node.previous_element.try(:name).in?(%w(h2 h3)) |
| 245 | content = node.content | 255 | content = node.content |
| @@ -65,6 +65,10 @@ module Docs · 64 unmodified lines | |||
| 65 | end | 65 | end |
| 66 | end | 66 | end |
| 67 | 67 | ||
| 68 | css('pre code').each do |node| | ||
| 69 | node.before(node.children).remove | ||
| 70 | end | ||
| 71 | |||
| 68 | doc | 72 | doc |
| 69 | end | 73 | end |
| 70 | end | 74 | end |
| @@ -52,7 +52,7 @@ module Docs · 51 unmodified lines | |||
| 52 | return [] if subpath.start_with?('users_guide') | 52 | return [] if subpath.start_with?('users_guide') |
| 53 | return [] if IGNORE_ENTRIES_PATHS.include?(subpath.split('/').last) | 53 | return [] if IGNORE_ENTRIES_PATHS.include?(subpath.split('/').last) |
| 54 | 54 | ||
| 55 | css('#synopsis > ul > li').each_with_object [] do |node, entries| | 55 | css('#synopsis > details > ul > li').each_with_object [] do |node, entries| |
| 56 | link = node.at_css('a') | 56 | link = node.at_css('a') |
| 57 | name = node.content.strip | 57 | name = node.content.strip |
| 58 | name.remove! %r{\A(?:module|data|newtype|class|type family m|type)\s+} | 58 | name.remove! %r{\A(?:module|data|newtype|class|type family m|type)\s+} |
| @@ -75,7 +75,7 @@ module Docs · 16 unmodified lines | |||
| 75 | end | 75 | end |
| 76 | 76 | ||
| 77 | def include_default_entry? | 77 | def include_default_entry? |
| 78 | subpath.start_with?('users_guide') || at_css('#synopsis > ul > li') | 78 | subpath.start_with?('users_guide') || at_css('#synopsis > details > ul > li') |
| 79 | end | 79 | end |
| 80 | end | 80 | end |
| 81 | end | 81 | end |
| @@ -28,7 +28,7 @@ module Docs · 27 unmodified lines | |||
| 28 | 28 | ||
| 29 | def include_default_entry? | 29 | def include_default_entry? |
| 30 | return false if %w(Element/Heading_Elements).include?(slug) | 30 | return false if %w(Element/Heading_Elements).include?(slug) |
| 31 | (node = doc.at_css '.overheadIndicator').nil? || node.content.exclude?('not on a standards track') | 31 | (node = doc.at_css '.overheadIndicator, .blockIndicator').nil? || node.content.exclude?('not on a standards track') |
| 32 | end | 32 | end |
| 33 | 33 | ||
| 34 | def additional_entries | 34 | def additional_entries |
| @@ -11,12 +11,12 @@ module Docs · 10 unmodified lines | |||
| 11 | 11 | ||
| 12 | def other | 12 | def other |
| 13 | # Remove "style" attribute | 13 | # Remove "style" attribute |
| 14 | css('.inheritsbox', '.overheadIndicator').each do |node| | 14 | css('.inheritsbox', '.overheadIndicator', '.blockIndicator').each do |node| |
| 15 | node.remove_attribute 'style' | 15 | node.remove_attribute 'style' |
| 16 | end | 16 | end |
| 17 | 17 | ||
| 18 | # Remove <div> wrapping .overheadIndicator | 18 | # Remove <div> wrapping .overheadIndicator |
| 19 | css('div > .overheadIndicator:first-child:last-child').each do |node| | 19 | css('div > .overheadIndicator:first-child:last-child', 'div > .blockIndicator:first-child:last-child').each do |node| |
| 20 | node.parent.replace(node) | 20 | node.parent.replace(node) |
| 21 | end | 21 | end |
| 22 | end | 22 | end |
| @@ -88,7 +88,7 @@ module Docs · 87 unmodified lines | |||
| 88 | end | 88 | end |
| 89 | 89 | ||
| 90 | def include_default_entry? | 90 | def include_default_entry? |
| 91 | node = doc.at_css '.overheadIndicator, .warning' | 91 | node = doc.at_css '.blockIndicator, .warning' |
| 92 | 92 | ||
| 93 | # Can't use :first-child because #doc is a DocumentFragment | 93 | # Can't use :first-child because #doc is a DocumentFragment |
| 94 | return true unless node && node.parent == doc && !node.previous_element | 94 | return true unless node && node.parent == doc && !node.previous_element |
| @@ -14,6 +14,8 @@ module Docs · 13 unmodified lines | |||
| 14 | '#Quick_Links', | 14 | '#Quick_Links', |
| 15 | 'hr'] | 15 | 'hr'] |
| 16 | 16 | ||
| 17 | BROWSER_UNNECESSARY_CLASS_REGEX = /\s*bc-browser[\w_-]+/ | ||
| 18 | |||
| 17 | def call | 19 | def call |
| 18 | css(*REMOVE_NODES).remove | 20 | css(*REMOVE_NODES).remove |
| 19 | 21 | ||
| @@ -61,6 +63,94 @@ module Docs · 41 unmodified lines | |||
| 61 | node.previous_element << node | 63 | node.previous_element << node |
| 62 | end | 64 | end |
| 63 | 65 | ||
| 66 | # New compatibility tables | ||
| 67 | |||
| 68 | css('.bc-data #Legend + dl', '.bc-data #Legend', '.bc-data #Legend_2 + dl', '.bc-data #Legend_2', '.bc-browser-name').remove | ||
| 69 | |||
| 70 | css('abbr.only-icon[title="Full support"]', | ||
| 71 | 'abbr.only-icon[title="Partial support"]', | ||
| 72 | 'abbr.only-icon[title="No support"]', | ||
| 73 | 'abbr.only-icon[title="See implementation notes"]').remove | ||
| 74 | |||
| 75 | css('.bc-data .ic-altname', '.bc-data .ic-deprecated', '.bc-data .ic-non-standard', '.bc-data .ic-experimental').each do |node| | ||
| 76 | node.parent.remove | ||
| 77 | end | ||
| 78 | |||
| 79 | css('abbr.only-icon').each do |node| | ||
| 80 | node.replace(node.content) | ||
| 81 | end | ||
| 82 | |||
| 83 | css('.bc-table .bc-platforms td', '.bc-table .bc-browsers td').each do |node| | ||
| 84 | node.name = 'th' | ||
| 85 | end | ||
| 86 | |||
| 87 | css('.bc-data').each do |node| | ||
| 88 | link = node.at_css('.bc-github-link') | ||
| 89 | prev = node.previous_element | ||
| 90 | prev = prev.previous_element until prev.name == 'h2' | ||
| 91 | prev.add_child(link) | ||
| 92 | |||
| 93 | node.before(node.children).remove | ||
| 94 | end | ||
| 95 | |||
| 96 | css('.bc-table').each do |node| | ||
| 97 | desktop_table = node | ||
| 98 | |||
| 99 | mobile_table = node.dup | ||
| 100 | desktop_table.after(mobile_table) | ||
| 101 | |||
| 102 | if desktop_table.at_css('.bc-platform-server') | ||
| 103 | server_table = node.dup | ||
| 104 | mobile_table.after(server_table) | ||
| 105 | end | ||
| 106 | |||
| 107 | desktop_columns = desktop_table.at_css('th.bc-platform-desktop')['colspan'].to_i | ||
| 108 | mobile_columns = desktop_table.at_css('th.bc-platform-mobile')['colspan'].to_i | ||
| 109 | |||
| 110 | desktop_table.css('.bc-platform-mobile').remove | ||
| 111 | desktop_table.css('.bc-platform-server').remove | ||
| 112 | desktop_table.css('.bc-browsers th').to_a[(desktop_columns + 1)..-1].each(&:remove) | ||
| 113 | desktop_table.css('tr:not(.bc-platforms):not(.bc-browsers)').each do |line| | ||
| 114 | line.css('td').to_a[(desktop_columns)..-1].each(&:remove) | ||
| 115 | end | ||
| 116 | |||
| 117 | mobile_table.css('.bc-platform-desktop').remove | ||
| 118 | mobile_table.css('.bc-platform-server').remove | ||
| 119 | mobile_table.css('.bc-browsers th').to_a[1..(desktop_columns)].each(&:remove) | ||
| 120 | mobile_table.css('.bc-browsers th').to_a[(mobile_columns + 1)..-1].each(&:remove) | ||
| 121 | mobile_table.css('tr:not(.bc-platforms):not(.bc-browsers)').each do |line| | ||
| 122 | line.css('td').to_a[0..(desktop_columns - 1)].each(&:remove) | ||
| 123 | line.css('td').to_a[(mobile_columns)..-1].each(&:remove) | ||
| 124 | end | ||
| 125 | |||
| 126 | if server_table | ||
| 127 | server_table.css('.bc-platform-desktop').remove | ||
| 128 | server_table.css('.bc-platform-mobile').remove | ||
| 129 | server_table.css('.bc-browsers th').to_a[1..(desktop_columns + mobile_columns)].each(&:remove) | ||
| 130 | server_table.css('tr:not(.bc-platforms):not(.bc-browsers)').each do |line| | ||
| 131 | line.css('td').to_a[0..(desktop_columns + mobile_columns - 1)].each(&:remove) | ||
| 132 | end | ||
| 133 | end | ||
| 134 | end | ||
| 135 | |||
| 136 | # Reduce page size to make the offline bundle smaller. | ||
| 137 | css('.bc-supports-unknown').remove_attr('class') | ||
| 138 | css('td[class*="bc-platform"], th[class*="bc-platform"]').remove_attr('class') | ||
| 139 | css('td[class*="bc-browser"], th[class*="bc-browser"]').each do |node| | ||
| 140 | class_name = node['class'] | ||
| 141 | class_name.remove!(BROWSER_UNNECESSARY_CLASS_REGEX) | ||
| 142 | |||
| 143 | if class_name.present? | ||
| 144 | node['class'] = class_name | ||
| 145 | else | ||
| 146 | node.remove_attribute('class') | ||
| 147 | end | ||
| 148 | end | ||
| 149 | |||
| 150 | css('abbr[title*="Compatibility unknown"]').each do |node| | ||
| 151 | node.before(node.children).remove | ||
| 152 | end | ||
| 153 | |||
| 64 | doc | 154 | doc |
| 65 | end | 155 | end |
| 66 | end | 156 | end |
| @@ -16,7 +16,7 @@ module Docs · 15 unmodified lines | |||
| 16 | 16 | ||
| 17 | css('pre').each do |node| | 17 | css('pre').each do |node| |
| 18 | if lang = node.at_css('code')['class'] | 18 | if lang = node.at_css('code')['class'] |
| 19 | node['data-language'] = lang.remove('lang-') | 19 | node['data-language'] = lang.remove(%r{lang(uage)?-}) |
| 20 | end | 20 | end |
| 21 | 21 | ||
| 22 | node.content = node.content | 22 | node.content = node.content |
| @@ -26,6 +26,7 @@ module Docs · 25 unmodified lines | |||
| 26 | 26 | ||
| 27 | def get_type | 27 | def get_type |
| 28 | type = at_css('h1').content.strip | 28 | type = at_css('h1').content.strip |
| 29 | type.remove! %r{\[.*\]} | ||
| 29 | REPLACE_TYPES[type] || "#{type.first.upcase}#{type[1..-1]}" | 30 | REPLACE_TYPES[type] || "#{type.first.upcase}#{type[1..-1]}" |
| 30 | end | 31 | end |
| 31 | 32 | ||
| @@ -40,6 +41,7 @@ module Docs · 8 unmodified lines | |||
| 40 | 41 | ||
| 41 | klass = nil if node.name == 'h2' | 42 | klass = nil if node.name == 'h2' |
| 42 | name = node.content.strip | 43 | name = node.content.strip |
| 44 | name.remove! %r{\s*\[src\]} | ||
| 43 | 45 | ||
| 44 | # Skip constructors | 46 | # Skip constructors |
| 45 | if name.start_with? 'new ' | 47 | if name.start_with? 'new ' |
| @@ -37,8 +37,10 @@ module Docs · 36 unmodified lines | |||
| 37 | end | 37 | end |
| 38 | 38 | ||
| 39 | # Add class to differentiate Ruby code from C code | 39 | # Add class to differentiate Ruby code from C code |
| 40 | css('.method-source-code > pre').each do |node| | 40 | css('.method-source-code').each do |node| |
| 41 | node['class'] = node.at_css('.ruby-keyword') ? 'ruby' : 'c' | 41 | node.parent.prepend_child(node) |
| 42 | pre = node.at_css('pre') | ||
| 43 | pre['class'] = pre.at_css('.ruby-keyword') ? 'ruby' : 'c' | ||
| 42 | end | 44 | end |
| 43 | 45 | ||
| 44 | # Remove code highlighting | 46 | # Remove code highlighting |
| @@ -6,9 +6,11 @@ module Docs · 5 unmodified lines | |||
| 6 | end | 6 | end |
| 7 | 7 | ||
| 8 | def get_type | 8 | def get_type |
| 9 | link = at_css("nav a[href='#{result[:path].split('/').last}']") | 9 | link = css("nav a[href='#{result[:path].split('/').last}']").last |
| 10 | return 'Miscellaneous' unless link | 10 | return 'Miscellaneous' unless link |
| 11 | link.ancestors('ul').last.previous_element.content | 11 | type = link.ancestors('ul').last.previous_element.content |
| 12 | type.remove! %r{\s*\(.*\)} | ||
| 13 | type | ||
| 12 | end | 14 | end |
| 13 | 15 | ||
| 14 | def additional_entries | 16 | def additional_entries |
| @@ -25,6 +27,8 @@ module Docs · 10 unmodified lines | |||
| 25 | 'Reference: Component' | 27 | 'Reference: Component' |
| 26 | elsif slug == 'react-api' | 28 | elsif slug == 'react-api' |
| 27 | 'Reference: React' | 29 | 'Reference: React' |
| 30 | elsif slug == 'hooks-reference' | ||
| 31 | 'Hooks' | ||
| 28 | else | 32 | else |
| 29 | 'Reference' | 33 | 'Reference' |
| 30 | end | 34 | end |
| @@ -21,7 +21,7 @@ module Docs · 20 unmodified lines | |||
| 21 | when 'PFADD' then 'HyperLogLog' | 21 | when 'PFADD' then 'HyperLogLog' |
| 22 | when 'CLUSTER ADDSLOTS' then 'Cluster' | 22 | when 'CLUSTER ADDSLOTS' then 'Cluster' |
| 23 | when 'GEOADD' then 'Geo' | 23 | when 'GEOADD' then 'Geo' |
| 24 | when 'XADD' then 'Stream' | 24 | when 'XACK' then 'Stream' |
| 25 | else 'Miscellaneous' | 25 | else 'Miscellaneous' |
| 26 | end | 26 | end |
| 27 | end | 27 | end |
| @@ -1,3 +1,5 @@ | |||
| 1 | # frozen_string_literal: true | ||
| 2 | |||
| 1 | module Docs | 3 | module Docs |
| 2 | class Rust | 4 | class Rust |
| 3 | class CleanHtmlFilter < Filter | 5 | class CleanHtmlFilter < Filter |
| @@ -74,10 +76,10 @@ module Docs · 70 unmodified lines | |||
| 74 | node.remove | 76 | node.remove |
| 75 | end | 77 | end |
| 76 | 78 | ||
| 77 | css('h2 .important-traits', 'h3 .important-traits', 'h4 .important-traits').each do |node| | 79 | css('.important-traits').to_a.each_with_index do |node, index| |
| 78 | content = node.at_css('.content.hidden .content') | 80 | content = node.at_css('.content.hidden .content') |
| 79 | node.at_css('.content.hidden').replace(content) if content | 81 | node.at_css('.content.hidden').replace(content) if content |
| 80 | node.parent.after(node) | 82 | node.parent.after(node) if node.parent.name.in?(%(h2 h3 h4)) |
| 81 | end | 83 | end |
| 82 | 84 | ||
| 83 | css('code.content').each do |node| | 85 | css('code.content').each do |node| |
| @@ -43,13 +43,12 @@ module Docs · 42 unmodified lines | |||
| 43 | end | 43 | end |
| 44 | else | 44 | else |
| 45 | css('.method') | 45 | css('.method') |
| 46 | .select {|node| !node.at_css('.fnname').nil?} | 46 | .each_with_object({}) { |node, entries| |
| 47 | .map {|node| | 47 | name = node.at_css('.fnname').try(:content) |
| 48 | name = node.at_css('.fnname').content | 48 | next unless name |
| 49 | name.prepend "#{self.name}::" | 49 | name.prepend "#{self.name}::" |
| 50 | [name, node['id']] | 50 | entries[name] ||= [name, node['id']] |
| 51 | } | 51 | }.values |
| 52 | .uniq {|item| item[0]} | ||
| 53 | end | 52 | end |
| 54 | end | 53 | end |
| 55 | end | 54 | end |
| @@ -34,7 +34,8 @@ module Docs · 33 unmodified lines | |||
| 34 | 'rtree' => 'R*Tree Module', | 34 | 'rtree' => 'R*Tree Module', |
| 35 | 'rbu' => 'RBU Extension', | 35 | 'rbu' => 'RBU Extension', |
| 36 | 'limits' => 'Limits', | 36 | 'limits' => 'Limits', |
| 37 | 'howtocorrupt' => 'How To Corrupt' | 37 | 'howtocorrupt' => 'How To Corrupt', |
| 38 | 'geopoly' => 'Geopoly' | ||
| 38 | } | 39 | } |
| 39 | 40 | ||
| 40 | def get_type | 41 | def get_type |
| @@ -15,8 +15,28 @@ module Docs · 14 unmodified lines | |||
| 15 | Licensed under the GNU General Public License version 3. | 15 | Licensed under the GNU General Public License version 3. |
| 16 | HTML | 16 | HTML |
| 17 | 17 | ||
| 18 | version '2.7' do | ||
| 19 | self.release = '2.7.1' | ||
| 20 | self.base_url = 'https://docs.ansible.com/ansible/2.7/' | ||
| 21 | |||
| 22 | options[:skip] = %w( | ||
| 23 | installation_guide/index.html | ||
| 24 | reference_appendices/glossary.html | ||
| 25 | reference_appendices/faq.html | ||
| 26 | reference_appendices/tower.html | ||
| 27 | user_guide/quickstart.html | ||
| 28 | modules/modules_by_category.html | ||
| 29 | modules/list_of_all_modules.html) | ||
| 30 | |||
| 31 | options[:skip_patterns] = [ | ||
| 32 | /\Acommunity.*/i, | ||
| 33 | /\Adev_guide.*/i, | ||
| 34 | /\Aroadmap.*/i, | ||
| 35 | ] | ||
| 36 | end | ||
| 37 | |||
| 18 | version '2.6' do | 38 | version '2.6' do |
| 19 | self.release = '2.6.1' | 39 | self.release = '2.6.7' |
| 20 | self.base_url = 'https://docs.ansible.com/ansible/2.6/' | 40 | self.base_url = 'https://docs.ansible.com/ansible/2.6/' |
| 21 | 41 | ||
| 22 | options[:skip] = %w( | 42 | options[:skip] = %w( |
| @@ -3,7 +3,7 @@ module Docs · 2 unmodified lines | |||
| 3 | self.name = 'Apache HTTP Server' | 3 | self.name = 'Apache HTTP Server' |
| 4 | self.slug = 'apache_http_server' | 4 | self.slug = 'apache_http_server' |
| 5 | self.type = 'apache' | 5 | self.type = 'apache' |
| 6 | self.release = '2.4.34' | 6 | self.release = '2.4.37' |
| 7 | self.base_url = 'https://httpd.apache.org/docs/2.4/en/' | 7 | self.base_url = 'https://httpd.apache.org/docs/2.4/en/' |
| 8 | self.links = { | 8 | self.links = { |
| 9 | home: 'https://httpd.apache.org/' | 9 | home: 'https://httpd.apache.org/' |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Async < UrlScraper | 2 | class Async < UrlScraper |
| 3 | self.type = 'async' | 3 | self.type = 'async' |
| 4 | self.release = '2.6.0' | 4 | self.release = '2.6.1' |
| 5 | self.base_url = 'https://caolan.github.io/async/' | 5 | self.base_url = 'https://caolan.github.io/async/' |
| 6 | self.root_path = 'docs.html' | 6 | self.root_path = 'docs.html' |
| 7 | self.links = { | 7 | self.links = { |
| @@ -14,7 +14,7 @@ module Docs · 6 unmodified lines | |||
| 14 | options[:skip_links] = true | 14 | options[:skip_links] = true |
| 15 | 15 | ||
| 16 | options[:attribution] = <<-HTML | 16 | options[:attribution] = <<-HTML |
| 17 | © 2010–2017 Caolan McMahon<br> | 17 | © 2010–2018 Caolan McMahon<br> |
| 18 | Licensed under the MIT License. | 18 | Licensed under the MIT License. |
| 19 | HTML | 19 | HTML |
| 20 | end | 20 | end |
| @@ -1,7 +1,6 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class C < FileScraper | 2 | class C < FileScraper |
| 3 | self.type = 'c' | 3 | self.type = 'c' |
| 4 | self.dir = '/Users/Thibaut/DevDocs/Docs/c' | ||
| 5 | self.base_url = 'http://en.cppreference.com/w/c/' | 4 | self.base_url = 'http://en.cppreference.com/w/c/' |
| 6 | self.root_path = 'header.html' | 5 | self.root_path = 'header.html' |
| 7 | 6 | ||
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Codeception < UrlScraper | 2 | class Codeception < UrlScraper |
| 3 | self.name = 'Codeception' | 3 | self.name = 'Codeception' |
| 4 | self.type = 'codeception' | 4 | self.type = 'codeception' |
| 5 | self.release = '2.4.0' | 5 | self.release = '2.5.1' |
| 6 | self.base_url = 'https://codeception.com/docs/' | 6 | self.base_url = 'https://codeception.com/docs/' |
| 7 | self.root_path = 'index.html' | 7 | self.root_path = 'index.html' |
| 8 | self.links = { | 8 | self.links = { |
| @@ -3,7 +3,7 @@ module Docs · 2 unmodified lines | |||
| 3 | self.name = 'CodeceptJS' | 3 | self.name = 'CodeceptJS' |
| 4 | self.type = 'simple' | 4 | self.type = 'simple' |
| 5 | self.root_path = 'index.html' | 5 | self.root_path = 'index.html' |
| 6 | self.release = '1.3.1' | 6 | self.release = '1.4.4' |
| 7 | self.base_url = 'https://codecept.io/' | 7 | self.base_url = 'https://codecept.io/' |
| 8 | self.links = { | 8 | self.links = { |
| 9 | home: 'https://codecept.io/', | 9 | home: 'https://codecept.io/', |
| @@ -24,10 +24,15 @@ module Docs · 23 unmodified lines | |||
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | options[:attribution] = <<-HTML | 26 | options[:attribution] = <<-HTML |
| 27 | © 2012–2017 The Apache Software Foundation<br> | 27 | © 2012–2018 The Apache Software Foundation<br> |
| 28 | Licensed under the Apache License 2.0. | 28 | Licensed under the Apache License 2.0. |
| 29 | HTML | 29 | HTML |
| 30 | 30 | ||
| 31 | version '8' do | ||
| 32 | self.release = '8.1.2' | ||
| 33 | self.base_url = 'https://cordova.apache.org/docs/en/8.x/' | ||
| 34 | end | ||
| 35 | |||
| 31 | version '7' do | 36 | version '7' do |
| 32 | self.release = '7.1.0' | 37 | self.release = '7.1.0' |
| 33 | self.base_url = 'https://cordova.apache.org/docs/en/7.x/' | 38 | self.base_url = 'https://cordova.apache.org/docs/en/7.x/' |
| @@ -3,7 +3,6 @@ module Docs · 2 unmodified lines | |||
| 3 | self.name = 'C++' | 3 | self.name = 'C++' |
| 4 | self.slug = 'cpp' | 4 | self.slug = 'cpp' |
| 5 | self.type = 'c' | 5 | self.type = 'c' |
| 6 | self.dir = '/Users/Thibaut/DevDocs/Docs/cpp' | ||
| 7 | self.base_url = 'http://en.cppreference.com/w/cpp/' | 6 | self.base_url = 'http://en.cppreference.com/w/cpp/' |
| 8 | self.root_path = 'header.html' | 7 | self.root_path = 'header.html' |
| 9 | 8 | ||
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Crystal < UrlScraper | 2 | class Crystal < UrlScraper |
| 3 | self.type = 'crystal' | 3 | self.type = 'crystal' |
| 4 | self.release = '0.26.0' | 4 | self.release = '0.27.0' |
| 5 | self.base_url = 'https://crystal-lang.org/' | 5 | self.base_url = 'https://crystal-lang.org/' |
| 6 | self.root_path = "api/#{release}/index.html" | 6 | self.root_path = "api/#{release}/index.html" |
| 7 | self.initial_paths = %w(docs/index.html) | 7 | self.initial_paths = %w(docs/index.html) |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class D < UrlScraper | 2 | class D < UrlScraper |
| 3 | include MultipleBaseUrls | 3 | include MultipleBaseUrls |
| 4 | 4 | ||
| 5 | self.release = '2.081.0' | 5 | self.release = '2.083.0' |
| 6 | self.type = 'd' | 6 | self.type = 'd' |
| 7 | self.base_urls = ['https://dlang.org/phobos/', 'https://dlang.org/spec/'] | 7 | self.base_urls = ['https://dlang.org/phobos/', 'https://dlang.org/spec/'] |
| 8 | self.root_path = 'index.html' | 8 | self.root_path = 'index.html' |
| @@ -17,7 +17,7 @@ module Docs · 16 unmodified lines | |||
| 17 | HTML | 17 | HTML |
| 18 | 18 | ||
| 19 | version '5' do | 19 | version '5' do |
| 20 | self.release = '5.4.0' | 20 | self.release = '5.7.0' |
| 21 | self.base_url = 'https://github.com/d3/' | 21 | self.base_url = 'https://github.com/d3/' |
| 22 | self.root_path = 'd3/blob/master/API.md' | 22 | self.root_path = 'd3/blob/master/API.md' |
| 23 | 23 | ||
| @@ -24,13 +24,11 @@ module Docs · 23 unmodified lines | |||
| 24 | 24 | ||
| 25 | version '2' do | 25 | version '2' do |
| 26 | self.release = '2.0.0' | 26 | self.release = '2.0.0' |
| 27 | self.dir = '/Users/Thibaut/DevDocs/Docs/Dart2' | ||
| 28 | self.base_url = "https://api.dartlang.org/stable/#{release}/" | 27 | self.base_url = "https://api.dartlang.org/stable/#{release}/" |
| 29 | end | 28 | end |
| 30 | 29 | ||
| 31 | version '1' do | 30 | version '1' do |
| 32 | self.release = '1.24.3' | 31 | self.release = '1.24.3' |
| 33 | self.dir = '/Users/Thibaut/DevDocs/Docs/Dart1' | ||
| 34 | self.base_url = "https://api.dartlang.org/stable/#{release}/" | 32 | self.base_url = "https://api.dartlang.org/stable/#{release}/" |
| 35 | end | 33 | end |
| 36 | end | 34 | end |
| @@ -36,37 +36,31 @@ module Docs · 35 unmodified lines | |||
| 36 | 36 | ||
| 37 | version '2.1' do | 37 | version '2.1' do |
| 38 | self.release = '2.1.0' | 38 | self.release = '2.1.0' |
| 39 | self.dir = '/Users/Thibaut/DevDocs/Docs/Django21' | ||
| 40 | self.base_url = 'https://docs.djangoproject.com/en/2.1/' | 39 | self.base_url = 'https://docs.djangoproject.com/en/2.1/' |
| 41 | end | 40 | end |
| 42 | 41 | ||
| 43 | version '2.0' do | 42 | version '2.0' do |
| 44 | self.release = '2.0.7' | 43 | self.release = '2.0.7' |
| 45 | self.dir = '/Users/Thibaut/DevDocs/Docs/Django20' | ||
| 46 | self.base_url = 'https://docs.djangoproject.com/en/2.0/' | 44 | self.base_url = 'https://docs.djangoproject.com/en/2.0/' |
| 47 | end | 45 | end |
| 48 | 46 | ||
| 49 | version '1.11' do | 47 | version '1.11' do |
| 50 | self.release = '1.11.9' | 48 | self.release = '1.11.9' |
| 51 | self.dir = '/Users/Thibaut/DevDocs/Docs/Django111' | ||
| 52 | self.base_url = 'https://docs.djangoproject.com/en/1.11/' | 49 | self.base_url = 'https://docs.djangoproject.com/en/1.11/' |
| 53 | end | 50 | end |
| 54 | 51 | ||
| 55 | version '1.10' do | 52 | version '1.10' do |
| 56 | self.release = '1.10.8' | 53 | self.release = '1.10.8' |
| 57 | self.dir = '/Users/Thibaut/DevDocs/Docs/Django110' | ||
| 58 | self.base_url = 'https://docs.djangoproject.com/en/1.10/' | 54 | self.base_url = 'https://docs.djangoproject.com/en/1.10/' |
| 59 | end | 55 | end |
| 60 | 56 | ||
| 61 | version '1.9' do | 57 | version '1.9' do |
| 62 | self.release = '1.9.13' | 58 | self.release = '1.9.13' |
| 63 | self.dir = '/Users/Thibaut/DevDocs/Docs/Django19' | ||
| 64 | self.base_url = 'https://docs.djangoproject.com/en/1.9/' | 59 | self.base_url = 'https://docs.djangoproject.com/en/1.9/' |
| 65 | end | 60 | end |
| 66 | 61 | ||
| 67 | version '1.8' do | 62 | version '1.8' do |
| 68 | self.release = '1.8.18' | 63 | self.release = '1.8.18' |
| 69 | self.dir = '/Users/Thibaut/DevDocs/Docs/Django18' | ||
| 70 | self.base_url = 'https://docs.djangoproject.com/en/1.8/' | 64 | self.base_url = 'https://docs.djangoproject.com/en/1.8/' |
| 71 | end | 65 | end |
| 72 | end | 66 | end |
| @@ -42,22 +42,18 @@ module Docs · 41 unmodified lines | |||
| 42 | 42 | ||
| 43 | version '21' do | 43 | version '21' do |
| 44 | self.release = '21.0' | 44 | self.release = '21.0' |
| 45 | self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang21' | ||
| 46 | end | 45 | end |
| 47 | 46 | ||
| 48 | version '20' do | 47 | version '20' do |
| 49 | self.release = '20.3' | 48 | self.release = '20.3' |
| 50 | self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang20' | ||
| 51 | end | 49 | end |
| 52 | 50 | ||
| 53 | version '19' do | 51 | version '19' do |
| 54 | self.release = '19.3' | 52 | self.release = '19.3' |
| 55 | self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang19' | ||
| 56 | end | 53 | end |
| 57 | 54 | ||
| 58 | version '18' do | 55 | version '18' do |
| 59 | self.release = '18.3' | 56 | self.release = '18.3' |
| 60 | self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang18' | ||
| 61 | end | 57 | end |
| 62 | end | 58 | end |
| 63 | end | 59 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Eslint < UrlScraper | 2 | class Eslint < UrlScraper |
| 3 | self.name = 'ESLint' | 3 | self.name = 'ESLint' |
| 4 | self.type = 'simple' | 4 | self.type = 'simple' |
| 5 | self.release = '4.19.0' | 5 | self.release = '5.8.0' |
| 6 | self.base_url = 'https://eslint.org/docs/' | 6 | self.base_url = 'https://eslint.org/docs/' |
| 7 | self.root_path = 'user-guide/getting-started' | 7 | self.root_path = 'user-guide/getting-started' |
| 8 | self.links = { | 8 | self.links = { |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Flow < UrlScraper | 2 | class Flow < UrlScraper |
| 3 | self.type = 'simple' | 3 | self.type = 'simple' |
| 4 | self.release = '0.79.1' | 4 | self.release = '0.85.0' |
| 5 | self.base_url = 'https://flow.org/en/docs/' | 5 | self.base_url = 'https://flow.org/en/docs/' |
| 6 | self.links = { | 6 | self.links = { |
| 7 | home: 'https://flow.org/', | 7 | home: 'https://flow.org/', |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Git < UrlScraper | 2 | class Git < UrlScraper |
| 3 | self.type = 'git' | 3 | self.type = 'git' |
| 4 | self.release = '2.17.0' | 4 | self.release = '2.19.1' |
| 5 | self.base_url = 'https://git-scm.com/docs' | 5 | self.base_url = 'https://git-scm.com/docs' |
| 6 | self.initial_paths = %w(/git.html) | 6 | self.initial_paths = %w(/git.html) |
| 7 | self.links = { | 7 | self.links = { |
| @@ -48,13 +48,11 @@ module Docs · 47 unmodified lines | |||
| 48 | 48 | ||
| 49 | version '7' do | 49 | version '7' do |
| 50 | self.release = '7.3.0' | 50 | self.release = '7.3.0' |
| 51 | self.dir = '/Users/Thibaut/DevDocs/Docs/gcc7' | ||
| 52 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" | 51 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" |
| 53 | end | 52 | end |
| 54 | 53 | ||
| 55 | version '7 CPP' do | 54 | version '7 CPP' do |
| 56 | self.release = '7.3.0' | 55 | self.release = '7.3.0' |
| 57 | self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp7' | ||
| 58 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" | 56 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" |
| 59 | 57 | ||
| 60 | options[:replace_paths] = CPP_PATHS | 58 | options[:replace_paths] = CPP_PATHS |
| @@ -62,7 +60,6 @@ module Docs · 1 unmodified line | |||
| 62 | 60 | ||
| 63 | version '6' do | 61 | version '6' do |
| 64 | self.release = '6.4.0' | 62 | self.release = '6.4.0' |
| 65 | self.dir = '/Users/Thibaut/DevDocs/Docs/gcc6' | ||
| 66 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" | 63 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" |
| 67 | 64 | ||
| 68 | options[:root_title] = 'Using the GNU Compiler Collection (GCC)' | 65 | options[:root_title] = 'Using the GNU Compiler Collection (GCC)' |
| @@ -70,7 +67,6 @@ module Docs · 1 unmodified line | |||
| 70 | 67 | ||
| 71 | version '6 CPP' do | 68 | version '6 CPP' do |
| 72 | self.release = '6.4.0' | 69 | self.release = '6.4.0' |
| 73 | self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp6' | ||
| 74 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" | 70 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" |
| 75 | 71 | ||
| 76 | options[:replace_paths] = CPP_PATHS | 72 | options[:replace_paths] = CPP_PATHS |
| @@ -78,7 +74,6 @@ module Docs · 1 unmodified line | |||
| 78 | 74 | ||
| 79 | version '5' do | 75 | version '5' do |
| 80 | self.release = '5.4.0' | 76 | self.release = '5.4.0' |
| 81 | self.dir = '/Users/Thibaut/DevDocs/Docs/gcc5' | ||
| 82 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" | 77 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" |
| 83 | 78 | ||
| 84 | options[:root_title] = 'Using the GNU Compiler Collection (GCC)' | 79 | options[:root_title] = 'Using the GNU Compiler Collection (GCC)' |
| @@ -86,7 +81,6 @@ module Docs · 1 unmodified line | |||
| 86 | 81 | ||
| 87 | version '5 CPP' do | 82 | version '5 CPP' do |
| 88 | self.release = '5.4.0' | 83 | self.release = '5.4.0' |
| 89 | self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp5' | ||
| 90 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" | 84 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" |
| 91 | 85 | ||
| 92 | options[:replace_paths] = CPP_PATHS | 86 | options[:replace_paths] = CPP_PATHS |
| @@ -94,7 +88,6 @@ module Docs · 1 unmodified line | |||
| 94 | 88 | ||
| 95 | version '4' do | 89 | version '4' do |
| 96 | self.release = '4.9.3' | 90 | self.release = '4.9.3' |
| 97 | self.dir = '/Users/Thibaut/DevDocs/Docs/gcc4' | ||
| 98 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" | 91 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" |
| 99 | 92 | ||
| 100 | options[:root_title] = 'Using the GNU Compiler Collection (GCC)' | 93 | options[:root_title] = 'Using the GNU Compiler Collection (GCC)' |
| @@ -102,7 +95,6 @@ module Docs · 1 unmodified line | |||
| 102 | 95 | ||
| 103 | version '4 CPP' do | 96 | version '4 CPP' do |
| 104 | self.release = '4.9.3' | 97 | self.release = '4.9.3' |
| 105 | self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp4' | ||
| 106 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" | 98 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" |
| 107 | 99 | ||
| 108 | options[:replace_paths] = CPP_PATHS | 100 | options[:replace_paths] = CPP_PATHS |
| @@ -8,25 +8,21 @@ module Docs · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | version '7' do | 9 | version '7' do |
| 10 | self.release = '7.3.0' | 10 | self.release = '7.3.0' |
| 11 | self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran7' | ||
| 12 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" | 11 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" |
| 13 | end | 12 | end |
| 14 | 13 | ||
| 15 | version '6' do | 14 | version '6' do |
| 16 | self.release = '6.4.0' | 15 | self.release = '6.4.0' |
| 17 | self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran6' | ||
| 18 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" | 16 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" |
| 19 | end | 17 | end |
| 20 | 18 | ||
| 21 | version '5' do | 19 | version '5' do |
| 22 | self.release = '5.4.0' | 20 | self.release = '5.4.0' |
| 23 | self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran5' | ||
| 24 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" | 21 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" |
| 25 | end | 22 | end |
| 26 | 23 | ||
| 27 | version '4' do | 24 | version '4' do |
| 28 | self.release = '4.9.3' | 25 | self.release = '4.9.3' |
| 29 | self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran4' | ||
| 30 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" | 26 | self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" |
| 31 | end | 27 | end |
| 32 | end | 28 | end |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Go < UrlScraper | 2 | class Go < UrlScraper |
| 3 | self.type = 'go' | 3 | self.type = 'go' |
| 4 | self.release = '1.10.1' | 4 | self.release = '1.11.2' |
| 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/', |
| @@ -29,7 +29,7 @@ module Docs · 28 unmodified lines | |||
| 29 | end | 29 | end |
| 30 | 30 | ||
| 31 | version '3.0' do | 31 | version '3.0' do |
| 32 | self.release = '3.0' | 32 | self.release = '3.0.6' |
| 33 | self.base_url = "http://docs.godotengine.org/en/#{self.version}/" | 33 | self.base_url = "http://docs.godotengine.org/en/#{self.version}/" |
| 34 | end | 34 | end |
| 35 | 35 | ||
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Graphite < UrlScraper | 2 | class Graphite < UrlScraper |
| 3 | self.type = 'graphite' | 3 | self.type = 'graphite' |
| 4 | self.release = '1.1.3' | 4 | self.release = '1.1.4' |
| 5 | self.base_url = 'https://graphite.readthedocs.io/en/latest/' | 5 | self.base_url = 'https://graphite.readthedocs.io/en/latest/' |
| 6 | self.links = { | 6 | self.links = { |
| 7 | code: 'https://github.com/graphite-project/graphite-web' | 7 | code: 'https://github.com/graphite-project/graphite-web' |
| @@ -57,7 +57,7 @@ module Docs · 56 unmodified lines | |||
| 57 | end | 57 | end |
| 58 | 58 | ||
| 59 | version '8' do | 59 | version '8' do |
| 60 | self.release = '8.2.1' | 60 | self.release = '8.6.1' |
| 61 | self.base_url = "https://downloads.haskell.org/~ghc/#{release}/docs/html/" | 61 | self.base_url = "https://downloads.haskell.org/~ghc/#{release}/docs/html/" |
| 62 | end | 62 | end |
| 63 | 63 | ||
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Homebrew < UrlScraper | 2 | class Homebrew < UrlScraper |
| 3 | self.name = 'Homebrew' | 3 | self.name = 'Homebrew' |
| 4 | self.type = 'simple' | 4 | self.type = 'simple' |
| 5 | self.release = '1.4.2' | 5 | self.release = '1.8.1' |
| 6 | self.base_url = 'https://docs.brew.sh/' | 6 | self.base_url = 'https://docs.brew.sh/' |
| 7 | self.links = { | 7 | self.links = { |
| 8 | home: 'https://brew.sh', | 8 | home: 'https://brew.sh', |
| @@ -13,8 +13,7 @@ module Docs · 4 unmodified lines | |||
| 13 | 13 | ||
| 14 | options[:container] = ->(filter) { filter.root_page? ? '#home' : '#page' } | 14 | options[:container] = ->(filter) { filter.root_page? ? '#home' : '#page' } |
| 15 | 15 | ||
| 16 | options[:skip_patterns] = [/maintainer/i, /core\-contributor/i] | 16 | options[:skip_patterns] = [/maintainer/i, /core\-contributor/i, /kickstarter/i] |
| 17 | options[:skip] = %w(Kickstarter-Supporters.html) | ||
| 18 | 17 | ||
| 19 | options[:attribution] = <<-HTML | 18 | options[:attribution] = <<-HTML |
| 20 | © 2009–present Homebrew contributors<br> | 19 | © 2009–present Homebrew contributors<br> |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Jasmine < UrlScraper | 2 | class Jasmine < UrlScraper |
| 3 | self.type = 'simple' | 3 | self.type = 'simple' |
| 4 | self.release = '3.2.1' | 4 | self.release = '3.3.0' |
| 5 | self.base_url = 'https://jasmine.github.io/api/3.2/' | 5 | self.base_url = 'https://jasmine.github.io/api/3.2/' |
| 6 | self.root_path = 'index.html' | 6 | self.root_path = 'index.html' |
| 7 | self.links = { | 7 | self.links = { |
| @@ -8,12 +8,12 @@ module Docs · 7 unmodified lines | |||
| 8 | options[:only_patterns] = [/\Amanual\//, /\Astdlib\//] | 8 | options[:only_patterns] = [/\Amanual\//, /\Astdlib\//] |
| 9 | 9 | ||
| 10 | options[:attribution] = <<-HTML | 10 | options[:attribution] = <<-HTML |
| 11 | © 2009–2016 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors<br> | 11 | © 2009–2018 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors<br> |
| 12 | Licensed under the MIT License. | 12 | Licensed under the MIT License. |
| 13 | HTML | 13 | HTML |
| 14 | 14 | ||
| 15 | version '1.0' do | 15 | version '1.0' do |
| 16 | self.release = '1.0.0' | 16 | self.release = '1.0.1' |
| 17 | self.base_url = "https://docs.julialang.org/en/v#{release}/" | 17 | self.base_url = "https://docs.julialang.org/en/v#{release}/" |
| 18 | self.type = 'julia' | 18 | self.type = 'julia' |
| 19 | 19 | ||
| @@ -3,7 +3,7 @@ · 2 unmodified lines | |||
| 3 | module Docs | 3 | module Docs |
| 4 | class Koa < Github | 4 | class Koa < Github |
| 5 | self.base_url = 'https://github.com/koajs/koa/blob/master/docs/' | 5 | self.base_url = 'https://github.com/koajs/koa/blob/master/docs/' |
| 6 | self.release = '2.5.1' | 6 | self.release = '2.6.1' |
| 7 | 7 | ||
| 8 | self.root_path = 'api/index.md' | 8 | self.root_path = 'api/index.md' |
| 9 | self.initial_paths = %w[ | 9 | self.initial_paths = %w[ |
| @@ -20,7 +20,7 @@ module Docs · 19 unmodified lines | |||
| 20 | HTML | 20 | HTML |
| 21 | 21 | ||
| 22 | version '1.3' do | 22 | version '1.3' do |
| 23 | self.release = '1.3.0' | 23 | self.release = '1.3.4' |
| 24 | self.base_url = "https://leafletjs.com/reference-#{release}.html" | 24 | self.base_url = "https://leafletjs.com/reference-#{release}.html" |
| 25 | end | 25 | end |
| 26 | 26 | ||
| @@ -6,7 +6,7 @@ module Docs · 5 unmodified lines | |||
| 6 | self.type = 'sphinx' | 6 | self.type = 'sphinx' |
| 7 | self.root_path = 'index.html' | 7 | self.root_path = 'index.html' |
| 8 | self.links = { | 8 | self.links = { |
| 9 | home: 'http://matplotlib.org/', | 9 | home: 'https://matplotlib.org/', |
| 10 | code: 'https://github.com/matplotlib/matplotlib' | 10 | code: 'https://github.com/matplotlib/matplotlib' |
| 11 | } | 11 | } |
| 12 | 12 | ||
| @@ -16,34 +16,52 @@ module Docs · 3 unmodified lines | |||
| 16 | options[:skip] = %w(api_changes.html tutorial.html faq.html) | 16 | options[:skip] = %w(api_changes.html tutorial.html faq.html) |
| 17 | 17 | ||
| 18 | options[:attribution] = <<-HTML | 18 | options[:attribution] = <<-HTML |
| 19 | © 2012–2017 Matplotlib Development Team. All rights reserved.<br> | 19 | © 2012–2018 Matplotlib Development Team. All rights reserved.<br> |
| 20 | Licensed under the Matplotlib License Agreement. | 20 | Licensed under the Matplotlib License Agreement. |
| 21 | HTML | 21 | HTML |
| 22 | 22 | ||
| 23 | version '3.0' do | ||
| 24 | self.release = '3.0.0' | ||
| 25 | self.base_urls = [ | ||
| 26 | "https://matplotlib.org/#{release}/api/", | ||
| 27 | "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", | ||
| 28 | "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" | ||
| 29 | ] | ||
| 30 | end | ||
| 31 | |||
| 32 | version '2.2' do | ||
| 33 | self.release = '2.2.3' | ||
| 34 | self.base_urls = [ | ||
| 35 | "https://matplotlib.org/#{release}/api/", | ||
| 36 | "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", | ||
| 37 | "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" | ||
| 38 | ] | ||
| 39 | end | ||
| 40 | |||
| 23 | version '2.1' do | 41 | version '2.1' do |
| 24 | self.release = '2.1.0' | 42 | self.release = '2.1.0' |
| 25 | self.base_urls = [ | 43 | self.base_urls = [ |
| 26 | "http://matplotlib.org/#{release}/api/", | 44 | "https://matplotlib.org/#{release}/api/", |
| 27 | "http://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", | 45 | "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", |
| 28 | "http://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" | 46 | "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" |
| 29 | ] | 47 | ] |
| 30 | end | 48 | end |
| 31 | 49 | ||
| 32 | version '2.0' do | 50 | version '2.0' do |
| 33 | self.release = '2.0.2' | 51 | self.release = '2.0.2' |
| 34 | self.base_urls = [ | 52 | self.base_urls = [ |
| 35 | "http://matplotlib.org/#{release}/api/", | 53 | "https://matplotlib.org/#{release}/api/", |
| 36 | "http://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", | 54 | "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", |
| 37 | "http://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" | 55 | "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" |
| 38 | ] | 56 | ] |
| 39 | end | 57 | end |
| 40 | 58 | ||
| 41 | version '1.5' do | 59 | version '1.5' do |
| 42 | self.release = '1.5.3' | 60 | self.release = '1.5.3' |
| 43 | self.base_urls = [ | 61 | self.base_urls = [ |
| 44 | "http://matplotlib.org/#{release}/api/", | 62 | "https://matplotlib.org/#{release}/api/", |
| 45 | "http://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", | 63 | "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/", |
| 46 | "http://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" | 64 | "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/" |
| 47 | ] | 65 | ] |
| 48 | end | 66 | end |
| 49 | end | 67 | end |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Mocha < UrlScraper | 2 | class Mocha < UrlScraper |
| 3 | self.type = 'simple' | 3 | self.type = 'simple' |
| 4 | self.release = '5.0.1' | 4 | self.release = '5.2.0' |
| 5 | self.base_url = 'https://mochajs.org/' | 5 | self.base_url = 'https://mochajs.org/' |
| 6 | self.links = { | 6 | self.links = { |
| 7 | home: 'https://mochajs.org/', | 7 | home: 'https://mochajs.org/', |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Nginx < UrlScraper | 2 | class Nginx < UrlScraper |
| 3 | self.name = 'nginx' | 3 | self.name = 'nginx' |
| 4 | self.type = 'nginx' | 4 | self.type = 'nginx' |
| 5 | self.release = '1.15.0' | 5 | self.release = '1.15.5' |
| 6 | self.base_url = 'https://nginx.org/en/docs/' | 6 | self.base_url = 'https://nginx.org/en/docs/' |
| 7 | self.links = { | 7 | self.links = { |
| 8 | home: 'https://nginx.org/', | 8 | home: 'https://nginx.org/', |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Nim < UrlScraper | 2 | class Nim < UrlScraper |
| 3 | self.type = 'simple' | 3 | self.type = 'simple' |
| 4 | self.release = '0.18.0' | 4 | self.release = '0.19.0' |
| 5 | self.base_url = 'https://nim-lang.org/docs/' | 5 | self.base_url = 'https://nim-lang.org/docs/' |
| 6 | self.root_path = 'overview.html' | 6 | self.root_path = 'overview.html' |
| 7 | self.links = { | 7 | self.links = { |
| @@ -14,7 +14,7 @@ module Docs · 6 unmodified lines | |||
| 14 | options[:skip] = %w(theindex.html docgen.txt) | 14 | options[:skip] = %w(theindex.html docgen.txt) |
| 15 | 15 | ||
| 16 | options[:attribution] = <<-HTML | 16 | options[:attribution] = <<-HTML |
| 17 | © 2006–2017 Andreas Rumpf<br> | 17 | © 2006–2018 Andreas Rumpf<br> |
| 18 | Licensed under the MIT License. | 18 | Licensed under the MIT License. |
| 19 | HTML | 19 | HTML |
| 20 | end | 20 | end |
| @@ -23,12 +23,17 @@ module Docs · 22 unmodified lines | |||
| 23 | HTML | 23 | HTML |
| 24 | 24 | ||
| 25 | version do | 25 | version do |
| 26 | self.release = '10.9.0' | 26 | self.release = '11.1.0' |
| 27 | self.base_url = 'https://nodejs.org/dist/latest-v11.x/docs/api/' | ||
| 28 | end | ||
| 29 | |||
| 30 | version '10 LTS' do | ||
| 31 | self.release = '10.13.0' | ||
| 27 | self.base_url = 'https://nodejs.org/dist/latest-v10.x/docs/api/' | 32 | self.base_url = 'https://nodejs.org/dist/latest-v10.x/docs/api/' |
| 28 | end | 33 | end |
| 29 | 34 | ||
| 30 | version '8 LTS' do | 35 | version '8 LTS' do |
| 31 | self.release = '8.11.4' | 36 | self.release = '8.12.0' |
| 32 | self.base_url = 'https://nodejs.org/dist/latest-v8.x/docs/api/' | 37 | self.base_url = 'https://nodejs.org/dist/latest-v8.x/docs/api/' |
| 33 | end | 38 | end |
| 34 | 39 | ||
| @@ -1,9 +1,13 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Nokogiri2 < Rdoc | 2 | class Nokogiri2 < Rdoc |
| 3 | # Instructions: | ||
| 4 | # 1. Download the latest release at https://github.com/sparklemotion/nokogiri/releases | ||
| 5 | # 2. Run "bundle install && bundle exec rake docs" (in the Nokogiri directory) | ||
| 6 | # 4. Copy the "doc" directory to "docs/nokgiri" | ||
| 7 | |||
| 3 | self.name = 'Nokogiri' | 8 | self.name = 'Nokogiri' |
| 4 | self.slug = 'nokogiri' | 9 | self.slug = 'nokogiri' |
| 5 | self.release = '1.8.1' | 10 | self.release = '1.9.0' |
| 6 | self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Nokogiri' | ||
| 7 | 11 | ||
| 8 | html_filters.replace 'rdoc/entries', 'nokogiri2/entries' | 12 | html_filters.replace 'rdoc/entries', 'nokogiri2/entries' |
| 9 | 13 | ||
| @@ -11,8 +15,8 @@ module Docs · 1 unmodified line | |||
| 11 | options[:only_patterns] = [/\ANokogiri/, /\AXSD/] | 15 | options[:only_patterns] = [/\ANokogiri/, /\AXSD/] |
| 12 | 16 | ||
| 13 | options[:attribution] = <<-HTML | 17 | options[:attribution] = <<-HTML |
| 14 | © 2008–2017 Aaron Patterson, Mike Dalessio, Charles Nutter, Sergio Arbeo<br> | 18 | © 2008–2018 Aaron Patterson, Mike Dalessio, Charles Nutter, Sergio Arbeo,<br> |
| 15 | Patrick Mahoney, Yoko Harada, Akinori Musha, John Shahid<br> | 19 | Patrick Mahoney, Yoko Harada, Akinori Musha, John Shahid, Lars Kanis<br> |
| 16 | Licensed under the MIT License. | 20 | Licensed under the MIT License. |
| 17 | HTML | 21 | HTML |
| 18 | end | 22 | end |
| @@ -2,7 +2,6 @@ module Docs · 1 unmodified line | |||
| 2 | class Numpy < FileScraper | 2 | class Numpy < FileScraper |
| 3 | self.name = 'NumPy' | 3 | self.name = 'NumPy' |
| 4 | self.type = 'sphinx' | 4 | self.type = 'sphinx' |
| 5 | self.dir = '/Users/Thibaut/DevDocs/Docs/numpy/reference/' | ||
| 6 | self.root_path = 'index.html' | 5 | self.root_path = 'index.html' |
| 7 | self.links = { | 6 | self.links = { |
| 8 | home: 'http://www.numpy.org/', | 7 | home: 'http://www.numpy.org/', |
| @@ -1,11 +1,10 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Openjdk < FileScraper | 2 | class Openjdk < FileScraper |
| 3 | # Downloaded from packages.debian.org/sid/openjdk-8-doc | ||
| 4 | # Extracting subdirectory /usr/share/doc/openjdk-8-jre-headless/api | ||
| 3 | self.name = 'OpenJDK' | 5 | self.name = 'OpenJDK' |
| 4 | self.type = 'openjdk' | 6 | self.type = 'openjdk' |
| 5 | self.root_path = 'overview-summary.html' | 7 | self.root_path = 'overview-summary.html' |
| 6 | # Downloaded from packages.debian.org/sid/openjdk-8-doc | ||
| 7 | # Extracting subdirectory /usr/share/doc/openjdk-8-jre-headless/api | ||
| 8 | self.dir = '/Users/Thibaut/DevDocs/Docs/OpenJDK' | ||
| 9 | 8 | ||
| 10 | html_filters.insert_after 'internal_urls', 'openjdk/clean_urls' | 9 | html_filters.insert_after 'internal_urls', 'openjdk/clean_urls' |
| 11 | html_filters.push 'openjdk/entries', 'openjdk/clean_html' | 10 | html_filters.push 'openjdk/entries', 'openjdk/clean_html' |
| @@ -20,6 +20,11 @@ module Docs · 19 unmodified lines | |||
| 20 | Licensed under the 3-clause BSD License. | 20 | Licensed under the 3-clause BSD License. |
| 21 | HTML | 21 | HTML |
| 22 | 22 | ||
| 23 | version '0.23' do | ||
| 24 | self.release = '0.23.4' | ||
| 25 | self.base_url = "http://pandas.pydata.org/pandas-docs/version/#{self.release}/" | ||
| 26 | end | ||
| 27 | |||
| 23 | version '0.22' do | 28 | version '0.22' do |
| 24 | self.release = '0.22.0' | 29 | self.release = '0.22.0' |
| 25 | self.base_url = "http://pandas.pydata.org/pandas-docs/version/#{self.release}/" | 30 | self.base_url = "http://pandas.pydata.org/pandas-docs/version/#{self.release}/" |
| @@ -2,7 +2,6 @@ module Docs · 1 unmodified line | |||
| 2 | class Perl < FileScraper | 2 | class Perl < FileScraper |
| 3 | self.name = 'Perl' | 3 | self.name = 'Perl' |
| 4 | self.type = 'perl' | 4 | self.type = 'perl' |
| 5 | self.dir = '/Users/Thibaut/DevDocs/Docs/Perl' | ||
| 6 | self.root_path = 'index.html' | 5 | self.root_path = 'index.html' |
| 7 | self.links = { | 6 | self.links = { |
| 8 | home: 'https://www.perl.org/' | 7 | home: 'https://www.perl.org/' |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Phoenix < UrlScraper | 2 | class Phoenix < UrlScraper |
| 3 | self.type = 'elixir' | 3 | self.type = 'elixir' |
| 4 | self.release = '1.3.2' | 4 | self.release = '1.3.4' |
| 5 | self.base_url = 'https://hexdocs.pm/' | 5 | self.base_url = 'https://hexdocs.pm/' |
| 6 | self.root_path = 'phoenix/Phoenix.html' | 6 | self.root_path = 'phoenix/Phoenix.html' |
| 7 | self.initial_paths = %w( | 7 | self.initial_paths = %w( |
| @@ -1,5 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Php < FileScraper | 2 | class Php < FileScraper |
| 3 | # Downloaded from php.net/download-docs.php | ||
| 4 | |||
| 3 | include FixInternalUrlsBehavior | 5 | include FixInternalUrlsBehavior |
| 4 | 6 | ||
| 5 | self.name = 'PHP' | 7 | self.name = 'PHP' |
| @@ -23,9 +25,6 @@ module Docs · 17 unmodified lines | |||
| 23 | code: 'https://git.php.net/?p=php-src.git;a=summary' | 25 | code: 'https://git.php.net/?p=php-src.git;a=summary' |
| 24 | } | 26 | } |
| 25 | 27 | ||
| 26 | # Downloaded from php.net/download-docs.php | ||
| 27 | self.dir = '/Users/Thibaut/DevDocs/Docs/PHP' | ||
| 28 | |||
| 29 | html_filters.push 'php/internal_urls', 'php/entries', 'php/clean_html', 'title' | 28 | html_filters.push 'php/internal_urls', 'php/entries', 'php/clean_html', 'title' |
| 30 | text_filters.push 'php/fix_urls' | 29 | text_filters.push 'php/fix_urls' |
| 31 | 30 | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Puppeteer < Github | 2 | class Puppeteer < Github |
| 3 | self.release = '1.8.0' | 3 | self.release = '1.10.0' |
| 4 | self.base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.8.0/docs/api.md' | 4 | self.base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.8.0/docs/api.md' |
| 5 | self.links = { | 5 | self.links = { |
| 6 | code: 'https://github.com/GoogleChrome/puppeteer' | 6 | code: 'https://github.com/GoogleChrome/puppeteer' |
| @@ -23,33 +23,29 @@ module Docs · 22 unmodified lines | |||
| 23 | Licensed under the PSF License. | 23 | Licensed under the PSF License. |
| 24 | HTML | 24 | HTML |
| 25 | 25 | ||
| 26 | version '3.7' do | 26 | version '3.7' do # docs.python.org/3.7/download.html |
| 27 | self.release = '3.7.0' | 27 | self.release = '3.7.0' |
| 28 | self.dir = '/Users/Thibaut/DevDocs/Docs/Python37' # docs.python.org/3.7/download.html | ||
| 29 | self.base_url = 'https://docs.python.org/3.7/' | 28 | self.base_url = 'https://docs.python.org/3.7/' |
| 30 | 29 | ||
| 31 | html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html' | 30 | html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html' |
| 32 | end | 31 | end |
| 33 | 32 | ||
| 34 | version '3.6' do | 33 | version '3.6' do # docs.python.org/3.6/download.html |
| 35 | self.release = '3.6.6' | 34 | self.release = '3.6.6' |
| 36 | self.dir = '/Users/Thibaut/DevDocs/Docs/Python36' # docs.python.org/3.6/download.html | ||
| 37 | self.base_url = 'https://docs.python.org/3.6/' | 35 | self.base_url = 'https://docs.python.org/3.6/' |
| 38 | 36 | ||
| 39 | html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html' | 37 | html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html' |
| 40 | end | 38 | end |
| 41 | 39 | ||
| 42 | version '3.5' do | 40 | version '3.5' do # docs.python.org/3.5/download.html |
| 43 | self.release = '3.5.3' | 41 | self.release = '3.5.3' |
| 44 | self.dir = '/Users/Thibaut/DevDocs/Docs/Python35' # docs.python.org/3.5/download.html | ||
| 45 | self.base_url = 'https://docs.python.org/3.5/' | 42 | self.base_url = 'https://docs.python.org/3.5/' |
| 46 | 43 | ||
| 47 | html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html' | 44 | html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html' |
| 48 | end | 45 | end |
| 49 | 46 | ||
| 50 | version '2.7' do | 47 | version '2.7' do # docs.python.org/2.7/download.html |
| 51 | self.release = '2.7.13' | 48 | self.release = '2.7.13' |
| 52 | self.dir = '/Users/Thibaut/DevDocs/Docs/Python27' # docs.python.org/2.7/download.html | ||
| 53 | self.base_url = 'https://docs.python.org/2.7/' | 49 | self.base_url = 'https://docs.python.org/2.7/' |
| 54 | 50 | ||
| 55 | html_filters.push 'python/entries_v2', 'sphinx/clean_html', 'python/clean_html' | 51 | html_filters.push 'python/entries_v2', 'sphinx/clean_html', 'python/clean_html' |
| @@ -1,9 +1,14 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Minitest < Rdoc | 2 | class Minitest < Rdoc |
| 3 | # Instructions: | ||
| 4 | # 1. Run "gem update rdoc hoe" | ||
| 5 | # 2. Download the source code at https://github.com/seattlerb/minitest | ||
| 6 | # 3. Run "rake docs" (in the Minitest directory) | ||
| 7 | # 4. Copy the "docs" directory to "docs/minitest" | ||
| 8 | |||
| 3 | self.name = 'Ruby / Minitest' | 9 | self.name = 'Ruby / Minitest' |
| 4 | self.slug = 'minitest' | 10 | self.slug = 'minitest' |
| 5 | self.release = '5.10.3' | 11 | self.release = '5.11.3' |
| 6 | self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Minitest' # rake docs | ||
| 7 | self.links = { | 12 | self.links = { |
| 8 | code: 'https://github.com/seattlerb/minitest' | 13 | code: 'https://github.com/seattlerb/minitest' |
| 9 | } | 14 | } |
| @@ -1,10 +1,17 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Rails < Rdoc | 2 | class Rails < Rdoc |
| 3 | # Instructions: | ||
| 4 | # 1. Download a release at https://github.com/rails/rails/releases | ||
| 5 | # 2. Open "railties/lib/rails/api/task.rb" and comment out any code related to sdoc ("configure_sdoc") | ||
| 6 | # 3. Run "bundle install --without db && bundle exec rake rdoc" (in the Rails directory) | ||
| 7 | # 4. Run "cd guides && bundle exec rake guides:generate:html" | ||
| 8 | # 5. Copy the "guides/output" directory to "html/guides" | ||
| 9 | # 6. Copy the "html" directory to "docs/rails~[version]" | ||
| 10 | |||
| 3 | include FixInternalUrlsBehavior | 11 | include FixInternalUrlsBehavior |
| 4 | 12 | ||
| 5 | self.name = 'Ruby on Rails' | 13 | self.name = 'Ruby on Rails' |
| 6 | self.slug = 'rails' | 14 | self.slug = 'rails' |
| 7 | self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Rails' | ||
| 8 | self.initial_paths = %w(guides/index.html) | 15 | self.initial_paths = %w(guides/index.html) |
| 9 | self.links = { | 16 | self.links = { |
| 10 | home: 'http://rubyonrails.org/', | 17 | home: 'http://rubyonrails.org/', |
| @@ -68,7 +75,7 @@ module Docs · 57 unmodified lines | |||
| 68 | end | 75 | end |
| 69 | 76 | ||
| 70 | version '5.2' do | 77 | version '5.2' do |
| 71 | self.release = '5.2.0' | 78 | self.release = '5.2.2' |
| 72 | end | 79 | end |
| 73 | 80 | ||
| 74 | version '5.1' do | 81 | version '5.1' do |
| @@ -80,7 +87,7 @@ module Docs · 5 unmodified lines | |||
| 80 | end | 87 | end |
| 81 | 88 | ||
| 82 | version '4.2' do | 89 | version '4.2' do |
| 83 | self.release = '4.2.10' | 90 | self.release = '4.2.11' |
| 84 | end | 91 | end |
| 85 | 92 | ||
| 86 | version '4.1' do | 93 | version '4.1' do |
| @@ -1,16 +1,9 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Ruby < Rdoc | 2 | class Ruby < Rdoc |
| 3 | # Generated with: | 3 | # Instructions: |
| 4 | # ./configure && make html | 4 | # 1. Download Ruby's source code |
| 5 | # or: | 5 | # 2. Run "./configure && make html" (in the Ruby directory) |
| 6 | # rdoc \ | 6 | # 3. Copy the ".ext/html" directory to "docs/ruby~[version]" |
| 7 | # --root . \ | ||
| 8 | # --page-dir doc \ | ||
| 9 | # --encoding=UTF-8 \ | ||
| 10 | # --visibility=public \ | ||
| 11 | # --format=darkfish \ | ||
| 12 | # --no-line-numbers \ | ||
| 13 | # --op html . | ||
| 14 | 7 | ||
| 15 | include FixInternalUrlsBehavior | 8 | include FixInternalUrlsBehavior |
| 16 | 9 | ||
| @@ -77,23 +70,19 @@ module Docs · 60 unmodified lines | |||
| 77 | HTML | 70 | HTML |
| 78 | 71 | ||
| 79 | version '2.5' do | 72 | version '2.5' do |
| 80 | self.release = '2.5.0' | 73 | self.release = '2.5.3' |
| 81 | self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Ruby25' | ||
| 82 | end | 74 | end |
| 83 | 75 | ||
| 84 | version '2.4' do | 76 | version '2.4' do |
| 85 | self.release = '2.4.3' | 77 | self.release = '2.4.5' |
| 86 | self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Ruby24' | ||
| 87 | end | 78 | end |
| 88 | 79 | ||
| 89 | version '2.3' do | 80 | version '2.3' do |
| 90 | self.release = '2.3.6' | 81 | self.release = '2.3.8' |
| 91 | self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Ruby23' | ||
| 92 | end | 82 | end |
| 93 | 83 | ||
| 94 | version '2.2' do | 84 | version '2.2' do |
| 95 | self.release = '2.2.9' | 85 | self.release = '2.2.10' |
| 96 | self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Ruby22' | ||
| 97 | end | 86 | end |
| 98 | end | 87 | end |
| 99 | end | 88 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class React < UrlScraper | 2 | class React < UrlScraper |
| 3 | self.name = 'React' | 3 | self.name = 'React' |
| 4 | self.type = 'simple' | 4 | self.type = 'simple' |
| 5 | self.release = '16.4.0' | 5 | self.release = '16.6.0' |
| 6 | self.base_url = 'https://reactjs.org/docs/' | 6 | self.base_url = 'https://reactjs.org/docs/' |
| 7 | self.root_path = 'hello-world.html' | 7 | self.root_path = 'hello-world.html' |
| 8 | self.links = { | 8 | self.links = { |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Redis < UrlScraper | 2 | class Redis < UrlScraper |
| 3 | self.type = 'redis' | 3 | self.type = 'redis' |
| 4 | self.release = '4.0.11' | 4 | self.release = '5.0.0' |
| 5 | self.base_url = 'https://redis.io/commands' | 5 | self.base_url = 'https://redis.io/commands' |
| 6 | self.links = { | 6 | self.links = { |
| 7 | home: 'https://redis.io/', | 7 | home: 'https://redis.io/', |
| @@ -1,7 +1,9 @@ | |||
| 1 | # frozen_string_literal: true | ||
| 2 | |||
| 1 | module Docs | 3 | module Docs |
| 2 | class Rust < UrlScraper | 4 | class Rust < UrlScraper |
| 3 | self.type = 'rust' | 5 | self.type = 'rust' |
| 4 | self.release = '1.29.1' | 6 | self.release = '1.30.1' |
| 5 | self.base_url = 'https://doc.rust-lang.org/' | 7 | self.base_url = 'https://doc.rust-lang.org/' |
| 6 | self.root_path = 'book/second-edition/index.html' | 8 | self.root_path = 'book/second-edition/index.html' |
| 7 | self.initial_paths = %w( | 9 | self.initial_paths = %w( |
| @@ -28,6 +30,7 @@ module Docs · 20 unmodified lines | |||
| 28 | options[:fix_urls] = ->(url) do | 30 | options[:fix_urls] = ->(url) do |
| 29 | url.sub! %r{(#{Rust.base_url}.+/)\z}, '\1index.html' | 31 | url.sub! %r{(#{Rust.base_url}.+/)\z}, '\1index.html' |
| 30 | url.sub! '/unicode/u_str', '/unicode/str/' | 32 | url.sub! '/unicode/u_str', '/unicode/str/' |
| 33 | url.sub! '/std/std/', '/std/' | ||
| 31 | url | 34 | url |
| 32 | end | 35 | end |
| 33 | 36 | ||
| @@ -3,8 +3,8 @@ module Docs · 2 unmodified lines | |||
| 3 | self.name = 'scikit-image' | 3 | self.name = 'scikit-image' |
| 4 | self.slug = 'scikit_image' | 4 | self.slug = 'scikit_image' |
| 5 | self.type = 'sphinx' | 5 | self.type = 'sphinx' |
| 6 | self.release = '0.13.1' | 6 | self.release = '0.14.1' |
| 7 | self.base_url = 'http://scikit-image.org/docs/0.13.x/' | 7 | self.base_url = 'http://scikit-image.org/docs/0.14.x/' |
| 8 | self.links = { | 8 | self.links = { |
| 9 | home: 'http://scikit-image.org/', | 9 | home: 'http://scikit-image.org/', |
| 10 | code: 'https://github.com/scikit-image/scikit-image' | 10 | code: 'https://github.com/scikit-image/scikit-image' |
| @@ -3,7 +3,7 @@ module Docs · 2 unmodified lines | |||
| 3 | self.name = 'scikit-learn' | 3 | self.name = 'scikit-learn' |
| 4 | self.slug = 'scikit_learn' | 4 | self.slug = 'scikit_learn' |
| 5 | self.type = 'sphinx' | 5 | self.type = 'sphinx' |
| 6 | self.release = '0.19.1' | 6 | self.release = '0.20.0' |
| 7 | self.base_url = 'http://scikit-learn.org/stable/' | 7 | self.base_url = 'http://scikit-learn.org/stable/' |
| 8 | self.root_path = 'documentation.html' | 8 | self.root_path = 'documentation.html' |
| 9 | self.force_gzip = true | 9 | self.force_gzip = true |
| @@ -21,7 +21,7 @@ module Docs · 11 unmodified lines | |||
| 21 | options[:max_image_size] = 256_000 | 21 | options[:max_image_size] = 256_000 |
| 22 | 22 | ||
| 23 | options[:attribution] = <<-HTML | 23 | options[:attribution] = <<-HTML |
| 24 | © 2007–2017 The scikit-learn developers<br> | 24 | © 2007–2018 The scikit-learn developers<br> |
| 25 | Licensed under the 3-clause BSD License. | 25 | Licensed under the 3-clause BSD License. |
| 26 | HTML | 26 | HTML |
| 27 | 27 | ||
| @@ -4,7 +4,7 @@ module Docs · 3 unmodified lines | |||
| 4 | self.slug = 'sinon' | 4 | self.slug = 'sinon' |
| 5 | self.type = 'sinon' | 5 | self.type = 'sinon' |
| 6 | self.links = { | 6 | self.links = { |
| 7 | home: 'http://sinonjs.org/', | 7 | home: 'https://sinonjs.org/', |
| 8 | code: 'https://github.com/sinonjs/sinon' | 8 | code: 'https://github.com/sinonjs/sinon' |
| 9 | } | 9 | } |
| 10 | 10 | ||
| @@ -18,34 +18,39 @@ module Docs · 7 unmodified lines | |||
| 18 | Licensed under the BSD License. | 18 | Licensed under the BSD License. |
| 19 | HTML | 19 | HTML |
| 20 | 20 | ||
| 21 | version '7' do | ||
| 22 | self.release = '7.1.1' | ||
| 23 | self.base_url = "https://sinonjs.org/releases/v#{release}/" | ||
| 24 | end | ||
| 25 | |||
| 21 | version '6' do | 26 | version '6' do |
| 22 | self.release = '6.1.3' | 27 | self.release = '6.3.5' |
| 23 | self.base_url = "http://sinonjs.org/releases/v#{release}/" | 28 | self.base_url = "https://sinonjs.org/releases/v#{release}/" |
| 24 | end | 29 | end |
| 25 | 30 | ||
| 26 | version '5' do | 31 | version '5' do |
| 27 | self.release = '5.1.0' | 32 | self.release = '5.1.0' |
| 28 | self.base_url = "http://sinonjs.org/releases/v#{release}/" | 33 | self.base_url = "https://sinonjs.org/releases/v#{release}/" |
| 29 | end | 34 | end |
| 30 | 35 | ||
| 31 | version '4' do | 36 | version '4' do |
| 32 | self.release = '4.5.0' | 37 | self.release = '4.5.0' |
| 33 | self.base_url = "http://sinonjs.org/releases/v#{release}/" | 38 | self.base_url = "https://sinonjs.org/releases/v#{release}/" |
| 34 | end | 39 | end |
| 35 | 40 | ||
| 36 | version '3' do | 41 | version '3' do |
| 37 | self.release = '3.3.0' | 42 | self.release = '3.3.0' |
| 38 | self.base_url = "http://sinonjs.org/releases/v#{release}/" | 43 | self.base_url = "https://sinonjs.org/releases/v#{release}/" |
| 39 | end | 44 | end |
| 40 | 45 | ||
| 41 | version '2' do | 46 | version '2' do |
| 42 | self.release = '2.4.1' | 47 | self.release = '2.4.1' |
| 43 | self.base_url = "http://sinonjs.org/releases/v#{release}/" | 48 | self.base_url = "https://sinonjs.org/releases/v#{release}/" |
| 44 | end | 49 | end |
| 45 | 50 | ||
| 46 | version '1' do | 51 | version '1' do |
| 47 | self.release = '1.17.7' | 52 | self.release = '1.17.7' |
| 48 | self.base_url = "http://sinonjs.org/releases/v#{release}/" | 53 | self.base_url = "https://sinonjs.org/releases/v#{release}/" |
| 49 | end | 54 | end |
| 50 | end | 55 | end |
| 51 | end | 56 | end |
| @@ -2,8 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Sqlite < FileScraper | 2 | class Sqlite < FileScraper |
| 3 | self.name = 'SQLite' | 3 | self.name = 'SQLite' |
| 4 | self.type = 'sqlite' | 4 | self.type = 'sqlite' |
| 5 | self.release = '3.23.1' | 5 | self.release = '3.25.2' |
| 6 | self.dir = '/Users/Thibaut/DevDocs/Docs/sqlite/' | ||
| 7 | self.base_url = 'https://sqlite.org/' | 6 | self.base_url = 'https://sqlite.org/' |
| 8 | self.root_path = 'docs.html' | 7 | self.root_path = 'docs.html' |
| 9 | self.initial_paths = %w(keyword_index.html) | 8 | self.initial_paths = %w(keyword_index.html) |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Statsmodels < UrlScraper | 2 | class Statsmodels < UrlScraper |
| 3 | self.type = 'sphinx' | 3 | self.type = 'sphinx' |
| 4 | self.release = '0.8.0' | 4 | self.release = '0.9.0' |
| 5 | self.base_url = 'http://www.statsmodels.org/stable/' | 5 | self.base_url = 'http://www.statsmodels.org/stable/' |
| 6 | self.root_path = 'index.html' | 6 | self.root_path = 'index.html' |
| 7 | self.links = { | 7 | self.links = { |
| @@ -26,44 +26,49 @@ module Docs · 25 unmodified lines | |||
| 26 | Licensed under the MIT License. | 26 | Licensed under the MIT License. |
| 27 | HTML | 27 | HTML |
| 28 | 28 | ||
| 29 | version '4.1' do | ||
| 30 | self.release = '4.1.7' | ||
| 31 | self.base_url = "https://api.symfony.com/#{version}/" | ||
| 32 | end | ||
| 33 | |||
| 29 | version '4.0' do | 34 | version '4.0' do |
| 30 | self.release = '4.0.3' | 35 | self.release = '4.0.3' |
| 31 | self.base_url = "http://api.symfony.com/#{version}/" | 36 | self.base_url = "https://api.symfony.com/#{version}/" |
| 32 | end | 37 | end |
| 33 | 38 | ||
| 34 | version '3.4' do | 39 | version '3.4' do |
| 35 | self.release = '3.4.3' | 40 | self.release = '3.4.3' |
| 36 | self.base_url = "http://api.symfony.com/#{version}/" | 41 | self.base_url = "https://api.symfony.com/#{version}/" |
| 37 | end | 42 | end |
| 38 | 43 | ||
| 39 | version '3.3' do | 44 | version '3.3' do |
| 40 | self.release = '3.3.15' | 45 | self.release = '3.3.15' |
| 41 | self.base_url = "http://api.symfony.com/#{version}/" | 46 | self.base_url = "https://api.symfony.com/#{version}/" |
| 42 | end | 47 | end |
| 43 | 48 | ||
| 44 | version '3.2' do | 49 | version '3.2' do |
| 45 | self.release = '3.2.13' | 50 | self.release = '3.2.13' |
| 46 | self.base_url = "http://api.symfony.com/#{version}/" | 51 | self.base_url = "https://api.symfony.com/#{version}/" |
| 47 | end | 52 | end |
| 48 | 53 | ||
| 49 | version '3.1' do | 54 | version '3.1' do |
| 50 | self.release = '3.1.8' | 55 | self.release = '3.1.8' |
| 51 | self.base_url = "http://api.symfony.com/#{version}/" | 56 | self.base_url = "https://api.symfony.com/#{version}/" |
| 52 | end | 57 | end |
| 53 | 58 | ||
| 54 | version '3.0' do | 59 | version '3.0' do |
| 55 | self.release = '3.0.1' | 60 | self.release = '3.0.1' |
| 56 | self.base_url = "http://api.symfony.com/#{version}/" | 61 | self.base_url = "https://api.symfony.com/#{version}/" |
| 57 | end | 62 | end |
| 58 | 63 | ||
| 59 | version '2.8' do | 64 | version '2.8' do |
| 60 | self.release = '2.8.28' | 65 | self.release = '2.8.28' |
| 61 | self.base_url = "http://api.symfony.com/#{version}/" | 66 | self.base_url = "https://api.symfony.com/#{version}/" |
| 62 | end | 67 | end |
| 63 | 68 | ||
| 64 | version '2.7' do | 69 | version '2.7' do |
| 65 | self.release = '2.7.35' | 70 | self.release = '2.7.35' |
| 66 | self.base_url = "http://api.symfony.com/#{version}/" | 71 | self.base_url = "https://api.symfony.com/#{version}/" |
| 67 | end | 72 | end |
| 68 | end | 73 | end |
| 69 | end | 74 | end |
| @@ -4,14 +4,14 @@ module Docs · 3 unmodified lines | |||
| 4 | self.root_path = 'index.html' | 4 | self.root_path = 'index.html' |
| 5 | self.initial_paths = %w(extensions/index.html) | 5 | self.initial_paths = %w(extensions/index.html) |
| 6 | self.links = { | 6 | self.links = { |
| 7 | home: 'https://twig.sensiolabs.org/', | 7 | home: 'https://twig.symfony.com/', |
| 8 | code: 'https://github.com/twigphp/Twig' | 8 | code: 'https://github.com/twigphp/Twig' |
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | options[:attribution] = <<-HTML | 11 | options[:attribution] = <<-HTML |
| 12 | © 2009–2017 by the Twig Team<br> | 12 | © 2009–2018 by the Twig Team<br> |
| 13 | Licensed under the three clause BSD license.<br> | 13 | Licensed under the three clause BSD license.<br> |
| 14 | The Twig logo is © 2010–2017 SensioLabs | 14 | The Twig logo is © 2010–2018 Symfony |
| 15 | HTML | 15 | HTML |
| 16 | 16 | ||
| 17 | html_filters.push 'twig/clean_html', 'twig/entries' | 17 | html_filters.push 'twig/clean_html', 'twig/entries' |
| @@ -20,13 +20,13 @@ module Docs · 2 unmodified lines | |||
| 20 | options[:skip] = %w(deprecated.html advanced_legacy.html) | 20 | options[:skip] = %w(deprecated.html advanced_legacy.html) |
| 21 | 21 | ||
| 22 | version '2' do | 22 | version '2' do |
| 23 | self.release = '2.4.3' | 23 | self.release = '2.5.0' |
| 24 | self.base_url = 'https://twig.sensiolabs.org/doc/2.x/' | 24 | self.base_url = 'https://twig.symfony.com/doc/2.x/' |
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | version '1' do | 27 | version '1' do |
| 28 | self.release = '1.34.3' | 28 | self.release = '1.34.3' |
| 29 | self.base_url = 'https://twig.sensiolabs.org/doc/1.x/' | 29 | self.base_url = 'https://twig.symfony.com/doc/1.x/' |
| 30 | end | 30 | end |
| 31 | end | 31 | end |
| 32 | end | 32 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Typescript < UrlScraper | 2 | class Typescript < UrlScraper |
| 3 | self.name = 'TypeScript' | 3 | self.name = 'TypeScript' |
| 4 | self.type = 'simple' | 4 | self.type = 'simple' |
| 5 | self.release = '3.0.1' | 5 | self.release = '3.1.6' |
| 6 | self.base_url = 'https://www.typescriptlang.org/docs/' | 6 | self.base_url = 'https://www.typescriptlang.org/docs/' |
| 7 | self.root_path = 'tutorial.html' | 7 | self.root_path = 'tutorial.html' |
| 8 | self.links = { | 8 | self.links = { |
| @@ -3,10 +3,10 @@ module Docs · 2 unmodified lines | |||
| 3 | self.name = 'Underscore.js' | 3 | self.name = 'Underscore.js' |
| 4 | self.slug = 'underscore' | 4 | self.slug = 'underscore' |
| 5 | self.type = 'underscore' | 5 | self.type = 'underscore' |
| 6 | self.release = '1.9.0' | 6 | self.release = '1.9.1' |
| 7 | self.base_url = 'http://underscorejs.org' | 7 | self.base_url = 'https://underscorejs.org' |
| 8 | self.links = { | 8 | self.links = { |
| 9 | home: 'http://underscorejs.org', | 9 | home: 'https://underscorejs.org', |
| 10 | code: 'https://github.com/jashkenas/underscore' | 10 | code: 'https://github.com/jashkenas/underscore' |
| 11 | } | 11 | } |
| 12 | 12 | ||
| @@ -17,7 +17,7 @@ module Docs · 4 unmodified lines | |||
| 17 | options[:skip_links] = true | 17 | options[:skip_links] = true |
| 18 | 18 | ||
| 19 | options[:attribution] = <<-HTML | 19 | options[:attribution] = <<-HTML |
| 20 | © 2009–2017 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors<br> | 20 | © 2009–2018 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors<br> |
| 21 | Licensed under the MIT License. | 21 | Licensed under the MIT License. |
| 22 | HTML | 22 | HTML |
| 23 | end | 23 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Vagrant < UrlScraper | 2 | class Vagrant < UrlScraper |
| 3 | self.name = 'Vagrant' | 3 | self.name = 'Vagrant' |
| 4 | self.type = 'simple' | 4 | self.type = 'simple' |
| 5 | self.release = '2.1.1' | 5 | self.release = '2.2.0' |
| 6 | self.base_url = 'https://www.vagrantup.com/docs/' | 6 | self.base_url = 'https://www.vagrantup.com/docs/' |
| 7 | self.root_path = 'index.html' | 7 | self.root_path = 'index.html' |
| 8 | self.links = { | 8 | self.links = { |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Yarn < UrlScraper | 2 | class Yarn < UrlScraper |
| 3 | self.type = 'simple' | 3 | self.type = 'simple' |
| 4 | self.release = '1.9.4' | 4 | self.release = '1.12.1' |
| 5 | self.base_url = 'https://yarnpkg.com/en/docs/' | 5 | self.base_url = 'https://yarnpkg.com/en/docs/' |
| 6 | self.links = { | 6 | self.links = { |
| 7 | home: 'https://yarnpkg.com/', | 7 | home: 'https://yarnpkg.com/', |
| @@ -0,0 +1,13 @@ | |||
| 1 | # frozen_string_literal: true | ||
| 2 | |||
| 3 | module Docs | ||
| 4 | class RequesterSubscriber < Subscriber | ||
| 5 | self.namespace = 'requester' | ||
| 6 | |||
| 7 | def handle_response(event) | ||
| 8 | if event.duration > 10_000 | ||
| 9 | log "WARN: #{format_url event.payload[:url]} was slow to process (#{(event.duration / 1000).round}s)" | ||
| 10 | end | ||
| 11 | end | ||
| 12 | end | ||
| 13 | end | ||
| @@ -12,15 +12,29 @@ class DocsCLI < Thor · 11 unmodified lines | |||
| 12 | end | 12 | end |
| 13 | 13 | ||
| 14 | desc 'list', 'List available documentations' | 14 | desc 'list', 'List available documentations' |
| 15 | option :packaged, type: :boolean | ||
| 15 | def list | 16 | def list |
| 16 | output = Docs.all.flat_map do |doc| | 17 | if options[:packaged] |
| 17 | name = doc.to_s.demodulize.underscore | 18 | slugs = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') } |
| 18 | if doc.versioned? | 19 | names = find_docs_by_slugs(slugs).map do |doc| |
| 19 | doc.versions.map { |_doc| "#{name}@#{_doc.version}" } | 20 | name = if doc.version? |
| 20 | else | 21 | "#{doc.superclass.to_s.demodulize.underscore}@#{doc.version}" |
| 21 | name | 22 | else |
| 23 | doc.to_s.demodulize.underscore | ||
| 24 | end | ||
| 25 | end | ||
| 26 | else | ||
| 27 | names = Docs.all.flat_map do |doc| | ||
| 28 | name = doc.to_s.demodulize.underscore | ||
| 29 | if doc.versioned? | ||
| 30 | doc.versions.map { |_doc| "#{name}@#{_doc.version}" } | ||
| 31 | else | ||
| 32 | name | ||
| 33 | end | ||
| 22 | end | 34 | end |
| 23 | end.join("\n") | 35 | end |
| 36 | |||
| 37 | output = names.join("\n") | ||
| 24 | 38 | ||
| 25 | require 'tty-pager' | 39 | require 'tty-pager' |
| 26 | TTY::Pager.new.page(output) | 40 | TTY::Pager.new.page(output) |
| @@ -39,7 +53,7 @@ class DocsCLI < Thor · 12 unmodified lines | |||
| 39 | Docs.install_report :store if options[:verbose] | 53 | Docs.install_report :store if options[:verbose] |
| 40 | if options[:debug] | 54 | if options[:debug] |
| 41 | GC.disable | 55 | GC.disable |
| 42 | Docs.install_report :filter, :request | 56 | Docs.install_report :filter, :request, :doc |
| 43 | end | 57 | end |
| 44 | 58 | ||
| 45 | if Docs.generate_page(name, options[:version], path) | 59 | if Docs.generate_page(name, options[:version], path) |
| @@ -62,7 +76,7 @@ class DocsCLI < Thor · 16 unmodified lines | |||
| 62 | Docs.rescue_errors = true | 76 | Docs.rescue_errors = true |
| 63 | Docs.install_report :store if options[:verbose] | 77 | Docs.install_report :store if options[:verbose] |
| 64 | Docs.install_report :scraper if options[:debug] | 78 | Docs.install_report :scraper if options[:debug] |
| 65 | Docs.install_report :progress_bar, :doc, :image if $stdout.tty? | 79 | Docs.install_report :progress_bar, :doc, :image, :requester if $stdout.tty? |
| 66 | 80 | ||
| 67 | require 'unix_utils' if options[:package] | 81 | require 'unix_utils' if options[:package] |
| 68 | 82 | ||
| @@ -149,15 +163,55 @@ class DocsCLI < Thor · 80 unmodified lines | |||
| 149 | option :dryrun, type: :boolean | 163 | option :dryrun, type: :boolean |
| 150 | option :packaged, type: :boolean | 164 | option :packaged, type: :boolean |
| 151 | def upload(*names) | 165 | def upload(*names) |
| 152 | names = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') } if options[:packaged] | 166 | require 'net/sftp' |
| 153 | docs = find_docs(names) | 167 | |
| 168 | if options[:packaged] | ||
| 169 | slugs = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') } | ||
| 170 | docs = find_docs_by_slugs(slugs) | ||
| 171 | else | ||
| 172 | docs = find_docs(names) | ||
| 173 | end | ||
| 174 | |||
| 154 | assert_docs(docs) | 175 | assert_docs(docs) |
| 176 | |||
| 177 | # Verify files are present | ||
| 155 | docs.each do |doc| | 178 | docs.each do |doc| |
| 156 | puts "Syncing #{doc.path}..." | 179 | unless Dir.exists?(File.join(Docs.store_path, doc.path)) |
| 157 | cmd = "aws s3 sync #{File.join(Docs.store_path, doc.path)} s3://docs.devdocs.io/#{doc.path} --delete" | 180 | puts "ERROR: directory #{File.join(Docs.store_path, doc.path)} not found." |
| 181 | return | ||
| 182 | end | ||
| 183 | |||
| 184 | unless File.exists?(File.join(Docs.store_path, "#{doc.path}.tar.gz")) | ||
| 185 | puts "ERROR: package for '#{doc.slug}' documentation not found. Run 'thor docs:package #{doc.slug}' to create it." | ||
| 186 | return | ||
| 187 | end | ||
| 188 | end | ||
| 189 | |||
| 190 | # Sync files with S3 (used by the web app) | ||
| 191 | puts '[S3] Begin syncing.' | ||
| 192 | docs.each do |doc| | ||
| 193 | puts "[S3] Syncing #{doc.path}..." | ||
| 194 | cmd = "aws s3 sync #{File.join(Docs.store_path, doc.path)} s3://devdocs-assets/#{doc.path} --delete --profile devdocs" | ||
| 158 | cmd << ' --dryrun' if options[:dryrun] | 195 | cmd << ' --dryrun' if options[:dryrun] |
| 159 | system(cmd) | 196 | system(cmd) |
| 160 | end | 197 | end |
| 198 | puts '[S3] Done syncing.' | ||
| 199 | |||
| 200 | # Upload packages to dl.devdocs.io (used by the "thor docs:download" command) | ||
| 201 | puts '[MaxCDN] Begin uploading.' | ||
| 202 | Net::SFTP.start('ftp.devdocs-dl.devdocs.netdna-cdn.com', ENV['DEVDOCS_DL_USERNAME'], password: ENV['DEVDOCS_DL_PASSWORD']) do |sftp| | ||
| 203 | docs.each do |doc| | ||
| 204 | filename = "#{doc.path}.tar.gz" | ||
| 205 | print "[MaxCDN] Uploading #{filename}..." | ||
| 206 | if options[:dryrun] | ||
| 207 | print "\n" | ||
| 208 | else | ||
| 209 | sftp.upload! File.join(Docs.store_path, filename), File.join('', 'public_html', filename) | ||
| 210 | print " OK\n" | ||
| 211 | end | ||
| 212 | end | ||
| 213 | end | ||
| 214 | puts '[MaxCDN] Done uploading.' | ||
| 161 | end | 215 | end |
| 162 | 216 | ||
| 163 | desc 'commit', '[private]' | 217 | desc 'commit', '[private]' |
| @@ -172,6 +226,43 @@ class DocsCLI < Thor · 8 unmodified lines | |||
| 172 | handle_doc_not_found_error(error) | 226 | handle_doc_not_found_error(error) |
| 173 | end | 227 | end |
| 174 | 228 | ||
| 229 | desc 'prepare_deploy', 'Internal task executed before deployment' | ||
| 230 | def prepare_deploy | ||
| 231 | puts 'Docs -- BEGIN' | ||
| 232 | |||
| 233 | require 'open-uri' | ||
| 234 | require 'thread' | ||
| 235 | |||
| 236 | docs = Docs.all_versions | ||
| 237 | time = Time.now.to_i | ||
| 238 | mutex = Mutex.new | ||
| 239 | |||
| 240 | (1..6).map do | ||
| 241 | Thread.new do | ||
| 242 | while doc = docs.shift | ||
| 243 | dir = File.join(Docs.store_path, doc.path) | ||
| 244 | FileUtils.mkpath(dir) | ||
| 245 | |||
| 246 | ['index.json', 'meta.json'].each do |filename| | ||
| 247 | open("https://docs.devdocs.io/#{doc.path}/#{filename}?#{time}") do |file| | ||
| 248 | mutex.synchronize do | ||
| 249 | path = File.join(dir, filename) | ||
| 250 | File.write(path, file.read) | ||
| 251 | end | ||
| 252 | end | ||
| 253 | end | ||
| 254 | |||
| 255 | puts "Docs -- Downloaded #{doc.slug}" | ||
| 256 | end | ||
| 257 | end | ||
| 258 | end.map(&:join) | ||
| 259 | |||
| 260 | puts 'Docs -- Generating manifest...' | ||
| 261 | generate_manifest | ||
| 262 | |||
| 263 | puts 'Docs -- DONE' | ||
| 264 | end | ||
| 265 | |||
| 175 | private | 266 | private |
| 176 | 267 | ||
| 177 | def find_docs(names) | 268 | def find_docs(names) |
| @@ -185,6 +276,13 @@ class DocsCLI < Thor · 7 unmodified lines | |||
| 185 | end | 276 | end |
| 186 | end | 277 | end |
| 187 | 278 | ||
| 279 | def find_docs_by_slugs(slugs) | ||
| 280 | slugs.flat_map do |slug| | ||
| 281 | slug, version = slug.split(/~/) | ||
| 282 | Docs.find_by_slug(slug, version) | ||
| 283 | end | ||
| 284 | end | ||
| 285 | |||
| 188 | def assert_docs(docs) | 286 | def assert_docs(docs) |
| 189 | if docs.empty? | 287 | if docs.empty? |
| 190 | puts 'ERROR: called with no arguments.' | 288 | puts 'ERROR: called with no arguments.' |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file added.
| @@ -0,0 +1 @@ | |||
| 1 | 10 | ||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file added.
| @@ -0,0 +1 @@ | |||
| 1 | 10 | ||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file added.
| @@ -0,0 +1 @@ | |||
| 1 | 10 | ||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file added.
| @@ -0,0 +1 @@ | |||
| 1 | 10 | ||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file added.
| @@ -0,0 +1,14 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | <plist version="1.0"> | ||
| 4 | <dict> | ||
| 5 | <key>app</key> | ||
| 6 | <string>com.bohemiancoding.sketch</string> | ||
| 7 | <key>build</key> | ||
| 8 | <integer>5302</integer> | ||
| 9 | <key>commit</key> | ||
| 10 | <string>9460a4bc62af5e9ba50dd4143578fd9401710ce5</string> | ||
| 11 | <key>version</key> | ||
| 12 | <integer>18</integer> | ||
| 13 | </dict> | ||
| 14 | </plist> | ||
| @@ -0,0 +1 @@ | |||
| 1 | 18 | ||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,18 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | <plist version="1.0"> | ||
| 4 | <dict> | ||
| 5 | <key>app</key> | ||
| 6 | <string>com.bohemiancoding.sketch</string> | ||
| 7 | <key>build</key> | ||
| 8 | <integer>5355</integer> | ||
| 9 | <key>commit</key> | ||
| 10 | <string>b7d299b0a34651d1a0e066786b75aa36168d5809</string> | ||
| 11 | <key>fonts</key> | ||
| 12 | <array/> | ||
| 13 | <key>length</key> | ||
| 14 | <integer>22373</integer> | ||
| 15 | <key>version</key> | ||
| 16 | <integer>18</integer> | ||
| 17 | </dict> | ||
| 18 | </plist> | ||
| @@ -0,0 +1 @@ | |||
| 1 | 18 | ||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -21,6 +21,11 @@ class AppTest < MiniTest::Spec · 20 unmodified lines | |||
| 21 | assert_equal 'https://example.com/test?q=1', last_response['Location'] | 21 | assert_equal 'https://example.com/test?q=1', last_response['Location'] |
| 22 | end | 22 | end |
| 23 | 23 | ||
| 24 | it 'returns HSTS header' do | ||
| 25 | get 'https://example.com/test' | ||
| 26 | assert_equal 'max-age=31536000; includeSubDomains', last_response['Strict-Transport-Security'] | ||
| 27 | end | ||
| 28 | |||
| 24 | describe "/" do | 29 | describe "/" do |
| 25 | it "works" do | 30 | it "works" do |
| 26 | get '/' | 31 | get '/' |
| @@ -2,16 +2,23 @@ require 'test_helper' · 1 unmodified line | |||
| 2 | require 'docs' | 2 | require 'docs' |
| 3 | 3 | ||
| 4 | class FileScraperTest < MiniTest::Spec | 4 | class FileScraperTest < MiniTest::Spec |
| 5 | ROOT_PATH = File.expand_path('../../../../../../', __FILE__) | ||
| 6 | |||
| 5 | class Scraper < Docs::FileScraper | 7 | class Scraper < Docs::FileScraper |
| 6 | self.dir = '/' | ||
| 7 | self.html_filters = Docs::FilterStack.new | 8 | self.html_filters = Docs::FilterStack.new |
| 8 | self.text_filters = Docs::FilterStack.new | 9 | self.text_filters = Docs::FilterStack.new |
| 10 | |||
| 11 | version 'version' do; end | ||
| 9 | end | 12 | end |
| 10 | 13 | ||
| 11 | let :scraper do | 14 | let :scraper do |
| 12 | Scraper.new | 15 | Scraper.new |
| 13 | end | 16 | end |
| 14 | 17 | ||
| 18 | let :versioned_scraper do | ||
| 19 | Scraper.versions.first.new | ||
| 20 | end | ||
| 21 | |||
| 15 | let :response do | 22 | let :response do |
| 16 | OpenStruct.new body: 'body', url: Docs::URL.parse(Scraper.base_url) | 23 | OpenStruct.new body: 'body', url: Docs::URL.parse(Scraper.base_url) |
| 17 | end | 24 | end |
| @@ -22,9 +29,16 @@ class FileScraperTest < MiniTest::Spec · 4 unmodified lines | |||
| 22 | end | 29 | end |
| 23 | end | 30 | end |
| 24 | 31 | ||
| 32 | describe "#source_directory" do | ||
| 33 | it "returns the directory at docs/[slug]" do | ||
| 34 | assert_equal File.join(ROOT_PATH, 'docs', 'scraper'), scraper.source_directory | ||
| 35 | assert_equal File.join(ROOT_PATH, 'docs', 'scraper~version'), versioned_scraper.source_directory | ||
| 36 | end | ||
| 37 | end | ||
| 38 | |||
| 25 | describe "#request_one" do | 39 | describe "#request_one" do |
| 26 | let :path do | 40 | let :path do |
| 27 | File.join(Scraper.dir, 'path') | 41 | 'path' |
| 28 | end | 42 | end |
| 29 | 43 | ||
| 30 | let :result do | 44 | let :result do |
| @@ -35,20 +49,34 @@ class FileScraperTest < MiniTest::Spec · 4 unmodified lines | |||
| 35 | stub(scraper).read_file | 49 | stub(scraper).read_file |
| 36 | end | 50 | end |
| 37 | 51 | ||
| 38 | it "reads a file" do | 52 | context "when the source directory doesn't exist" do |
| 39 | mock(scraper).read_file(path) | 53 | it "raises an error" do |
| 40 | result | 54 | assert_raises Docs::SetupError do |
| 55 | result | ||
| 56 | end | ||
| 57 | end | ||
| 41 | end | 58 | end |
| 42 | 59 | ||
| 43 | describe "the returned response object" do | 60 | context "when the source directory exists" do |
| 44 | it "has a #body" do | 61 | before do |
| 45 | stub(scraper).read_file { 'body' } | 62 | stub(scraper).assert_source_directory_exists |
| 46 | assert_equal 'body', result.body | 63 | end |
| 64 | |||
| 65 | it "reads a file" do | ||
| 66 | mock(scraper).read_file(path) | ||
| 67 | result | ||
| 47 | end | 68 | end |
| 48 | 69 | ||
| 49 | it "has a #url" do | 70 | describe "the returned response object" do |
| 50 | assert_equal path, result.url.to_s | 71 | it "has a #body" do |
| 51 | assert_instance_of Docs::URL, result.url | 72 | stub(scraper).read_file { 'body' } |
| 73 | assert_equal 'body', result.body | ||
| 74 | end | ||
| 75 | |||
| 76 | it "has a #url" do | ||
| 77 | assert_equal path, result.url.to_s | ||
| 78 | assert_instance_of Docs::URL, result.url | ||
| 79 | end | ||
| 52 | end | 80 | end |
| 53 | end | 81 | end |
| 54 | end | 82 | end |
| @@ -58,49 +86,63 @@ class FileScraperTest < MiniTest::Spec · 3 unmodified lines | |||
| 58 | %w(one two) | 86 | %w(one two) |
| 59 | end | 87 | end |
| 60 | 88 | ||
| 61 | it "requests the given url" do | 89 | context "when the source directory doesn't exist" do |
| 62 | mock(scraper).request_one('url') | 90 | it "raises an error" do |
| 63 | scraper.send(:request_all, 'url') {} | 91 | assert_raises Docs::SetupError do |
| 64 | end | 92 | scraper.send(:request_all, urls) {} |
| 65 | 93 | end | |
| 66 | it "requests the given urls" do | 94 | end |
| 67 | requests = [] | ||
| 68 | stub(scraper).request_one { |url| requests << url; nil } | ||
| 69 | scraper.send(:request_all, urls) {} | ||
| 70 | assert_equal urls, requests | ||
| 71 | end | ||
| 72 | |||
| 73 | it "yields the responses" do | ||
| 74 | responses = [] | ||
| 75 | stub(scraper).request_one { |url| urls.index(url) } | ||
| 76 | scraper.send(:request_all, urls) { |response| responses << response; nil } | ||
| 77 | assert_equal (0...urls.length).to_a, responses | ||
| 78 | end | 95 | end |
| 79 | 96 | ||
| 80 | context "when the block returns an array" do | 97 | context "when the source directory exists" do |
| 81 | let :next_urls do | 98 | before do |
| 82 | %w(three four) | 99 | stub(scraper).assert_source_directory_exists |
| 83 | end | 100 | end |
| 84 | 101 | ||
| 85 | let :all_urls do | 102 | it "requests the given url" do |
| 86 | urls + %w(three four) | 103 | mock(scraper).request_one('url') |
| 104 | scraper.send(:request_all, 'url') {} | ||
| 87 | end | 105 | end |
| 88 | 106 | ||
| 89 | it "requests the returned urls" do | 107 | it "requests the given urls" do |
| 90 | requests = [] | 108 | requests = [] |
| 91 | stub(scraper).request_one { |url| requests << url; url } | 109 | stub(scraper).request_one { |url| requests << url; nil } |
| 92 | scraper.send(:request_all, urls) { [next_urls.shift].compact } | 110 | scraper.send(:request_all, urls) {} |
| 93 | assert_equal all_urls, requests | 111 | assert_equal urls, requests |
| 94 | end | 112 | end |
| 95 | 113 | ||
| 96 | it "yields their responses" do | 114 | it "yields the responses" do |
| 97 | responses = [] | 115 | responses = [] |
| 98 | stub(scraper).request_one { |url| all_urls.index(url) } | 116 | stub(scraper).request_one { |url| urls.index(url) } |
| 99 | scraper.send :request_all, urls do |response| | 117 | scraper.send(:request_all, urls) { |response| responses << response; nil } |
| 100 | responses << response | 118 | assert_equal (0...urls.length).to_a, responses |
| 101 | [next_urls.shift].compact | 119 | end |
| 120 | |||
| 121 | context "when the block returns an array" do | ||
| 122 | let :next_urls do | ||
| 123 | %w(three four) | ||
| 124 | end | ||
| 125 | |||
| 126 | let :all_urls do | ||
| 127 | urls + %w(three four) | ||
| 128 | end | ||
| 129 | |||
| 130 | it "requests the returned urls" do | ||
| 131 | requests = [] | ||
| 132 | stub(scraper).request_one { |url| requests << url; url } | ||
| 133 | scraper.send(:request_all, urls) { [next_urls.shift].compact } | ||
| 134 | assert_equal all_urls, requests | ||
| 135 | end | ||
| 136 | |||
| 137 | it "yields their responses" do | ||
| 138 | responses = [] | ||
| 139 | stub(scraper).request_one { |url| all_urls.index(url) } | ||
| 140 | scraper.send :request_all, urls do |response| | ||
| 141 | responses << response | ||
| 142 | [next_urls.shift].compact | ||
| 143 | end | ||
| 144 | assert_equal (0...all_urls.length).to_a, responses | ||
| 102 | end | 145 | end |
| 103 | assert_equal (0...all_urls.length).to_a, responses | ||
| 104 | end | 146 | end |
| 105 | end | 147 | end |
| 106 | end | 148 | end |
| @@ -126,13 +168,13 @@ class FileScraperTest < MiniTest::Spec · 19 unmodified lines | |||
| 126 | scraper.send :read_file, 'file' | 168 | scraper.send :read_file, 'file' |
| 127 | end | 169 | end |
| 128 | 170 | ||
| 129 | it "returns the file's content when the file exists" do | 171 | it "returns the file's content when the file exists in the source directory" do |
| 130 | stub(File).read('file') { 'content' } | 172 | stub(File).read(File.join(ROOT_PATH, 'docs', 'scraper', 'file')) { 'content' } |
| 131 | assert_equal 'content', result | 173 | assert_equal 'content', result |
| 132 | end | 174 | end |
| 133 | 175 | ||
| 134 | it "returns nil when the file doesn't exist" do | 176 | it "returns nil when the file doesn't exist" do |
| 135 | stub(File).read('file') { raise } | 177 | stub(File).read(File.join(ROOT_PATH, 'docs', 'scraper', 'file')) { raise } |
| 136 | assert_nil result | 178 | assert_nil result |
| 137 | end | 179 | end |
| 138 | end | 180 | end |
| @@ -16,11 +16,11 @@ · 15 unmodified lines | |||
| 16 | <li>iOS 10+</li> | 16 | <li>iOS 10+</li> |
| 17 | </ul> | 17 | </ul> |
| 18 | <p class="_fail-text"> | 18 | <p class="_fail-text"> |
| 19 | If you're unable to upgrade, I apologize. | 19 | If you're unable to upgrade, we apologize. |
| 20 | I decided to prioritize speed and new features over support for older browsers. | 20 | We decided to prioritize speed and new features over support for older browsers. |
| 21 | </p> | 21 | </p> |
| 22 | <p class="_fail-text"> | 22 | <p class="_fail-text"> |
| 23 | — Thibaut <a href="https://twitter.com/DevDocs" class="_fail-link">@DevDocs</a> | 23 | — <a href="https://twitter.com/DevDocs">@DevDocs</a> |
| 24 | </p> | 24 | </p> |
| 25 | </div> | 25 | </div> |
| 26 | </body> | 26 | </body> |