Merge remote-tracking branch 'upstream/master' into add-koa

pull/800/head
Jed Fox 7 years ago
commit 3e67214584

@ -1 +1 @@
2.4.2
2.5.1

@ -0,0 +1,2 @@
public/icons
test

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

@ -24,7 +24,7 @@ Want to contribute? Great. Please review the following guidelines carefully and
## Requesting new features
1. Search for similar feature requests; someone may have already requested it.
2. Make sure your feature fits DevDocs's [vision](https://github.com/Thibaut/devdocs/blob/master/README.md#vision).
2. Make sure your feature fits DevDocs's [vision](https://github.com/freeCodeCamp/devdocs/blob/master/README.md#vision).
3. Provide a clear and detailed explanation of the feature and why it's important to add it.
For general feedback and ideas, please use the [mailing list](https://groups.google.com/d/forum/devdocs).
@ -46,7 +46,7 @@ Use the [Trello board](https://trello.com/b/6BmTulfx/devdocs-documentation) wher
## Contributing new documentations
See the [wiki](https://github.com/Thibaut/devdocs/wiki) to learn how to add new documentations.
See the [wiki](https://github.com/freeCodeCamp/devdocs/wiki) to learn how to add new documentations.
**Important:** the documentation's license must permit alteration, redistribution and commercial use, and the documented software must be released under an open source license. Feel free to get in touch if you're not sure if a documentation meets those requirements.

@ -1,4 +1,4 @@
Copyright 2013-2017 Thibaut Courouble and other contributors
Copyright 2013-2018 Thibaut Courouble and other contributors
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this

@ -1,4 +1,4 @@
FROM ruby:2.4.2
FROM ruby:2.5.1
WORKDIR /devdocs

@ -1,4 +1,4 @@
FROM ruby:2.4.2-alpine
FROM ruby:2.5.1-alpine
WORKDIR /devdocs

@ -1,10 +1,10 @@
source 'https://rubygems.org'
ruby '2.4.2'
ruby '2.5.1'
gem 'rake'
gem 'thor'
gem 'pry', '~> 0.11.0'
gem 'activesupport', '~> 5.1', require: false
gem 'activesupport', '~> 5.2', require: false
gem 'yajl-ruby', require: false
group :app do
@ -22,6 +22,7 @@ end
group :production do
gem 'uglifier'
gem 'newrelic_rpm'
end
group :development do

@ -1,95 +1,100 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.1.4)
activesupport (5.2.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
backports (3.9.1)
better_errors (2.3.0)
backports (3.11.3)
better_errors (2.4.0)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
browser (2.5.1)
browser (2.5.3)
coderay (1.1.2)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
daemons (1.2.4)
erubi (1.6.1)
ethon (0.10.1)
daemons (1.2.6)
erubi (1.7.1)
ethon (0.11.0)
ffi (>= 1.3.0)
eventmachine (1.2.5)
execjs (2.7.0)
exifr (1.3.2)
ffi (1.9.18)
exifr (1.3.3)
ffi (1.9.23)
fspath (3.1.0)
highline (1.7.8)
html-pipeline (2.7.1)
highline (1.7.10)
html-pipeline (2.7.2)
activesupport (>= 2)
nokogiri (>= 1.4)
i18n (0.8.6)
image_optim (0.25.0)
i18n (1.0.1)
concurrent-ruby (~> 1.0)
image_optim (0.26.1)
exifr (~> 1.2, >= 1.2.2)
fspath (~> 3.0)
image_size (~> 1.5)
in_threads (~> 1.3)
progress (~> 3.0, >= 3.0.1)
image_optim_pack (0.5.0.20171001)
image_optim_pack (0.5.0.20180419)
fspath (>= 2.1, < 4)
image_optim (~> 0.19)
image_size (1.5.0)
in_threads (1.4.0)
in_threads (1.5.0)
method_source (0.9.0)
mini_portile2 (2.3.0)
minitest (5.10.3)
multi_json (1.12.2)
mustermann (1.0.1)
nokogiri (1.8.1)
minitest (5.11.3)
multi_json (1.13.1)
mustermann (1.0.2)
newrelic_rpm (5.0.0.342)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
options (2.3.2)
progress (3.3.1)
progress_bar (1.1.0)
progress (3.4.0)
progress_bar (1.2.0)
highline (~> 1.6)
options (~> 2.3.0)
pry (0.11.1)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
rack (2.0.3)
rack-protection (2.0.0)
rack (2.0.5)
rack-protection (2.0.1)
rack
rack-test (0.7.0)
rack-test (1.0.0)
rack (>= 1.0, < 3)
rake (12.1.0)
rb-fsevent (0.10.2)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rr (1.2.1)
sass (3.5.2)
sass (3.5.6)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sinatra (2.0.0)
sinatra (2.0.1)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.0)
rack-protection (= 2.0.1)
tilt (~> 2.0)
sinatra-contrib (2.0.0)
sinatra-contrib (2.0.1)
backports (>= 2.0)
multi_json
mustermann (~> 1.0)
rack-protection (= 2.0.0)
sinatra (= 2.0.0)
rack-protection (= 2.0.1)
sinatra (= 2.0.1)
tilt (>= 1.3, < 3)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-helpers (1.2.1)
sprockets (>= 2.2)
strings (0.1.1)
unicode-display_width (~> 1.3.0)
unicode_utils (~> 1.4.0)
thin (1.7.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
@ -97,31 +102,28 @@ GEM
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
tty-pager (0.9.0)
tty-screen (~> 0.5.0)
tty-pager (0.11.0)
strings (~> 0.1.0)
tty-screen (~> 0.6.4)
tty-which (~> 0.3.0)
verse (~> 0.5.0)
tty-screen (0.5.0)
tty-screen (0.6.4)
tty-which (0.3.0)
typhoeus (1.3.0)
ethon (>= 0.9.0)
tzinfo (1.2.3)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (3.2.0)
uglifier (4.1.10)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.1.3)
unicode-display_width (1.3.2)
unicode_utils (1.4.0)
unix_utils (0.0.15)
verse (0.5.0)
unicode-display_width (~> 1.1.0)
unicode_utils (~> 1.4.0)
yajl-ruby (1.3.0)
yajl-ruby (1.4.0)
PLATFORMS
ruby
DEPENDENCIES
activesupport (~> 5.1)
activesupport (~> 5.2)
better_errors
browser
coffee-script
@ -130,6 +132,7 @@ DEPENDENCIES
image_optim
image_optim_pack
minitest
newrelic_rpm
nokogiri
progress_bar
pry (~> 0.11.0)
@ -151,7 +154,7 @@ DEPENDENCIES
yajl-ruby
RUBY VERSION
ruby 2.4.2p198
ruby 2.5.1p57
BUNDLED WITH
1.15.4
1.16.1

@ -1,6 +1,6 @@
<!--
Please read the contributing guidelines before opening an issue:
https://github.com/Thibaut/devdocs/blob/master/CONTRIBUTING.md
https://github.com/freeCodeCamp/devdocs/blob/master/CONTRIBUTING.md
To request a new documentation, or an update of an existing documentation, go here:
https://trello.com/b/6BmTulfx/devdocs-documentation

@ -0,0 +1 @@
web: bundle exec rackup config.ru -p $PORT

@ -1,4 +1,4 @@
# [DevDocs](http://devdocs.io) [![Build Status](https://travis-ci.org/Thibaut/devdocs.svg?branch=master)](https://travis-ci.org/Thibaut/devdocs)
# [DevDocs](https://devdocs.io) [![Build Status](https://travis-ci.org/freeCodeCamp/devdocs.svg?branch=master)](https://travis-ci.org/freeCodeCamp/devdocs)
DevDocs combines multiple API documentations in a fast, organized, and searchable interface.
@ -6,24 +6,23 @@ DevDocs combines multiple API documentations in a fast, organized, and searchabl
Keep track of development news:
* Watch the repository on [GitHub](https://github.com/Thibaut/devdocs/subscription)
* Join the contributor chat room on [Gitter](https://gitter.im/FreeCodeCamp/DevDocs)
* Watch the repository on [GitHub](https://github.com/freeCodeCamp/devdocs/subscription)
* Follow [@DevDocs](https://twitter.com/DevDocs) on Twitter
* Join the [mailing list](https://groups.google.com/d/forum/devdocs)
DevDocs is free and open source. If you like it, please consider supporting my work on [Gratipay](https://gratipay.com/devdocs/). Thanks!
**Table of Contents:** [Quick Start](#quick-start) · [Vision](#vision) · [App](#app) · [Scraper](#scraper) · [Commands](#available-commands) · [Contributing](#contributing) · [License](#copyright--license) · [Questions?](#questions)
## Quick Start
Unless you wish to contribute to the project, I recommend using the hosted version at [devdocs.io](http://devdocs.io). It's up-to-date and works offline out-of-the-box.
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.
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.
DevDocs requires Ruby 2.4.2, 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:
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:
```
git clone https://github.com/Thibaut/devdocs.git && cd devdocs
git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs
gem install bundler
bundle install
bundle exec thor docs:download --default
@ -34,13 +33,13 @@ Finally, point your browser at [localhost:9292](http://localhost:9292) (the firs
The `thor docs:download` command is used to download pre-generated documentations from DevDocs's servers (e.g. `thor docs:download html css`). You can see the list of available documentations and versions by running `thor docs:list`. To update all downloaded documentations, run `thor docs:download --installed`.
**Note:** there is currently no update mechanism other than `git pull origin master` to update the code and `thor docs:download --installed` to download the latest version of the docs. To stay informed about new releases, be sure to [watch](https://github.com/Thibaut/devdocs/subscription) this repository.
**Note:** there is currently no update mechanism other than `git pull origin master` to update the code and `thor docs:download --installed` to download the latest version of the docs. To stay informed about new releases, be sure to [watch](https://github.com/freeCodeCamp/devdocs/subscription) this repository.
Alternatively, DevDocs may be started as a Docker container:
```
# First, build the image
git clone https://github.com/Thibaut/devdocs.git && cd devdocs
git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs
docker build -t thibaut/devdocs .
# Finally, start a DevDocs container (access http://localhost:9292)
@ -94,7 +93,7 @@ These modifications are applied via a set of filters using the [HTML::Pipeline](
The end result is a set of normalized HTML partials and two JSON files (index + offline data). Because the index files are loaded separately by the [app](#app) following the user's preferences, the scraper also creates a JSON manifest file containing information about the documentations currently available on the system (such as their name, version, update date, etc.).
More information about scrapers and filters is available on the [wiki](https://github.com/Thibaut/devdocs/wiki).
More information about scrapers and filters is available on the [wiki](https://github.com/freeCodeCamp/devdocs/wiki).
## Available Commands
@ -134,15 +133,15 @@ If multiple versions of Ruby are installed on your system, commands must be run
## Contributing
Contributions are welcome. Please read the [contributing guidelines](https://github.com/Thibaut/devdocs/blob/master/CONTRIBUTING.md).
Contributions are welcome. Please read the [contributing guidelines](https://github.com/freeCodeCamp/devdocs/blob/master/CONTRIBUTING.md).
DevDocs's own documentation is available on the [wiki](https://github.com/Thibaut/devdocs/wiki).
DevDocs's own documentation is available on the [wiki](https://github.com/freeCodeCamp/devdocs/wiki).
## Copyright / License
Copyright 2013-2017 Thibaut Courouble and [other contributors](https://github.com/Thibaut/devdocs/graphs/contributors)
Copyright 2013-2018 Thibaut Courouble and [other contributors](https://github.com/freeCodeCamp/devdocs/graphs/contributors)
This software is licensed under the terms of the Mozilla Public License v2.0. See the [COPYRIGHT](https://github.com/Thibaut/devdocs/blob/master/COPYRIGHT) and [LICENSE](https://github.com/Thibaut/devdocs/blob/master/LICENSE) files.
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.
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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 40 KiB

@ -1,5 +1,5 @@
###
* Copyright 2013-2017 Thibaut Courouble and other contributors
* Copyright 2013-2018 Thibaut Courouble and other contributors
*
* This source code is licensed under the terms of the Mozilla
* Public License, v. 2.0, a copy of which may be obtained at:

@ -124,7 +124,7 @@ $.empty = (el) ->
return
# Calls the function while the element is off the DOM to avoid triggering
# unecessary reflows and repaints.
# unnecessary reflows and repaints.
$.batchUpdate = (el, fn) ->
parent = el.parentNode
sibling = el.nextSibling

@ -1,5 +1,17 @@
[
[
"2018-03-26",
"DevDocs is joining the freeCodeCamp community. Read the announcement <a href=\"https://medium.com/@quincylarson/devdocs-is-joining-the-freecodecamp-community-ae185a1c14a6\" target=\"_blank\">here</a>."
], [
"2018-02-04",
"New documentations: <a href=\"/babel/\">Babel</a>, <a href=\"/jekyll/\">Jekyll</a> and <a href=\"/jsdoc/\">JSDoc</a>"
], [
"2017-11-26",
"New documentations: <a href=\"/bluebird/\">Bluebird</a>, <a href=\"/eslint/\">ESLint</a> and <a href=\"/homebrew/\">Homebrew</a>"
], [
"2017-11-18",
"Added print & PDF stylesheet.\nFeedback welcome on <a href=\"https://twitter.com/DevDocs\" target=\"_blank\" rel=\"noopener\">Twitter</a> and <a href=\"https://github.com/freeCodeCamp/devdocs\" target=\"_blank\" rel=\"noopener\">GitHub</a>."
], [
"2017-09-10",
"<a href=\"/settings\">Preferences</a> can now be exported and imported."
], [
@ -110,7 +122,7 @@
"New documentations: <a href=\"/q/\">Q</a> and <a href=\"/opentsdb/\">OpenTSDB</a>"
], [
"2015-07-26",
"Added search aliases (e.g. <code class=\"_label\">$</code> is an alias for <code class=\"_label\">jQuery</code>).\n<a href=\"/help#aliases\">Click here</a> to see the full list. Feel free to suggest more on <a href=\"https://github.com/Thibaut/devdocs/issues/new\" target=\"_blank\" rel=\"noopener\">GitHub</a>.",
"Added search aliases (e.g. <code class=\"_label\">$</code> is an alias for <code class=\"_label\">jQuery</code>).\n<a href=\"/help#aliases\">Click here</a> to see the full list. Feel free to suggest more on <a href=\"https://github.com/freeCodeCamp/devdocs/issues/new\" target=\"_blank\" rel=\"noopener\">GitHub</a>.",
"Added <code class=\"_label\">shift + &darr;/&uarr;</code> shortcut for scrolling (same as <code class=\"_label\">alt + &darr;/&uarr;</code>)."
], [
"2015-07-05",
@ -151,7 +163,7 @@
"New <a href=\"/python2/\">Python 2</a> documentation"
], [
"2014-11-09",
"New design\nFeedback welcome on <a href=\"https://twitter.com/DevDocs\" target=\"_blank\" rel=\"noopener\">Twitter</a> and <a href=\"https://github.com/Thibaut/devdocs\" target=\"_blank\" rel=\"noopener\">GitHub</a>."
"New design\nFeedback welcome on <a href=\"https://twitter.com/DevDocs\" target=\"_blank\" rel=\"noopener\">Twitter</a> and <a href=\"https://github.com/freeCodeCamp/devdocs\" target=\"_blank\" rel=\"noopener\">GitHub</a>."
], [
"2014-10-19",
"New <a href=\"/svg/\">SVG</a>, <a href=\"/marionette/\">Marionette.js</a>, and <a href=\"/mongoose/\">Mongoose</a> documentations"
@ -236,7 +248,7 @@
"New <a href=\"/ruby/\">Ruby</a> documentation"
], [
"2013-10-24",
"DevDocs is now <a href=\"https://github.com/Thibaut/devdocs\">open source</a>."
"DevDocs is now <a href=\"https://github.com/freeCodeCamp/devdocs\">open source</a>."
], [
"2013-10-09",
"DevDocs is now available as a <a href=\"https://chrome.google.com/webstore/detail/devdocs/mnfehgbmkapmjnhcnbodoamcioleeooe\">Chrome web app</a>."

@ -37,10 +37,10 @@ app.templates.offlineError = (reason, exception) ->
""" Your browser appears to be running in private mode.<br>
This prevents DevDocs from caching documentations for offline access."""
when 'exception'
""" An error occured when trying to open the IndexedDB database:<br>
""" An error occurred when trying to open the IndexedDB database:<br>
<code class="_label">#{exception.name}: #{exception.message}</code> """
when 'cant_open'
""" An error occured when trying to open the IndexedDB database:<br>
""" An error occurred when trying to open the IndexedDB database:<br>
<code class="_label">#{exception.name}: #{exception.message}</code><br>
This could be because you're browsing in private mode or have disallowed offline storage on the domain. """
when 'version'

@ -2,7 +2,7 @@ notice = (text) -> """<p class="_notice-text">#{text}</p>"""
app.templates.singleDocNotice = (doc) ->
notice """ You're browsing the #{doc.fullName} documentation. To browse all docs, go to
<a href="http://#{app.config.production_host}" target="_top">#{app.config.production_host}</a> (or press <code>esc</code>). """
<a href="//#{app.config.production_host}" target="_top">#{app.config.production_host}</a> (or press <code>esc</code>). """
app.templates.disabledDocNotice = ->
notice """ <strong>This documentation is disabled.</strong>

@ -13,10 +13,10 @@ app.templates.notifUpdateReady = ->
"""<span data-behavior="reboot"><a href="#" data-behavior="reboot">Reload the page</a> to use the new version.</span>"""
app.templates.notifError = ->
textNotif """ Oops, an error occured. """,
textNotif """ Oops, an error occurred. """,
""" Try <a href="#" data-behavior="hard-reload">reloading</a>, and if the problem persists,
<a href="#" data-behavior="reset">resetting the app</a>.<br>
You can also report this issue on <a href="https://github.com/Thibaut/devdocs/issues/new" target="_blank" rel="noopener">GitHub</a>. """
You can also report this issue on <a href="https://github.com/freeCodeCamp/devdocs/issues/new" target="_blank" rel="noopener">GitHub</a>. """
app.templates.notifQuotaExceeded = ->
textNotif """ The offline database has exceeded its size limitation. """,
@ -31,7 +31,7 @@ app.templates.notifInvalidLocation = ->
""" Otherwise things are likely to break. """
app.templates.notifImportInvalid = ->
textNotif """ Oops, an error occured. """,
textNotif """ Oops, an error occurred. """,
""" The file you selected is invalid. """
app.templates.notifNews = (news) ->

@ -14,25 +14,23 @@ app.templates.aboutPage = -> """
<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.
<ul>
<li>Created and maintained by <a href="https://thibaut.me">Thibaut Courouble</a>
<li>Free and <a href="https://github.com/Thibaut/devdocs">open source</a>
<iframe class="_github-btn" src="https://ghbtns.com/github-btn.html?user=Thibaut&repo=devdocs&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20" tabindex="-1"></iframe>
<li>Free and <a href="https://github.com/freeCodeCamp/devdocs">open source</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>
</ul>
<p>To keep up-to-date with the latest news:
<ul>
<li>Follow <a href="https://twitter.com/DevDocs">@DevDocs</a> on Twitter
<li>Watch the repository on <a href="https://github.com/Thibaut/devdocs/subscription">GitHub</a>
<li>Watch the repository on <a href="https://github.com/freeCodeCamp/devdocs/subscription">GitHub</a>
<li>Join the <a href="https://groups.google.com/d/forum/devdocs">mailing list</a>
</ul>
<p class="_note _note-green">If you like DevDocs, please spread the word and consider supporting my work on
<a href="https://gratipay.com/devdocs/">Gratipay</a>. Thanks!<br>
<h2 class="_block-heading" id="copyright">Copyright and License</h2>
<p class="_note">
<strong>Copyright 2013&ndash;2017 Thibaut Courouble and <a href="https://github.com/Thibaut/devdocs/graphs/contributors">other contributors</a></strong><br>
<strong>Copyright 2013&ndash;2018 Thibaut Courouble and <a href="https://github.com/freeCodeCamp/devdocs/graphs/contributors">other contributors</a></strong><br>
This software is licensed under the terms of the Mozilla Public License v2.0.<br>
You may obtain a copy of the source code at <a href="https://github.com/Thibaut/devdocs">github.com/Thibaut/devdocs</a>.<br>
For more information, see the <a href="https://github.com/Thibaut/devdocs/blob/master/COPYRIGHT">COPYRIGHT</a>
and <a href="https://github.com/Thibaut/devdocs/blob/master/LICENSE">LICENSE</a> files.
You may obtain a copy of the source code at <a href="https://github.com/freeCodeCamp/devdocs">github.com/freeCodeCamp/devdocs</a>.<br>
For more information, see the <a href="https://github.com/freeCodeCamp/devdocs/blob/master/COPYRIGHT">COPYRIGHT</a>
and <a href="https://github.com/freeCodeCamp/devdocs/blob/master/LICENSE">LICENSE</a> files.
<h2 class="_block-heading" id="plugins">Plugins and Extensions</h2>
<ul>
@ -49,10 +47,10 @@ app.templates.aboutPage = -> """
<dl>
<dt>Where can I suggest new docs and features?
<dd>You can suggest and vote for new docs on the <a href="https://trello.com/b/6BmTulfx/devdocs-documentation">Trello board</a>.<br>
If you have a specific feature request, add it to the <a href="https://github.com/Thibaut/devdocs/issues">issue tracker</a>.<br>
If you have a specific feature request, add it to the <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a>.<br>
Otherwise use the <a href="https://groups.google.com/d/forum/devdocs">mailing list</a>.
<dt>Where can I report bugs?
<dd>In the <a href="https://github.com/Thibaut/devdocs/issues">issue tracker</a>. Thanks!
<dd>In the <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a>. Thanks!
</dl>
<p>For anything else, feel free to email me at <a href="mailto:thibaut@devdocs.io">thibaut@devdocs.io</a>.
@ -60,9 +58,9 @@ app.templates.aboutPage = -> """
<p><strong>Special thanks to:</strong>
<ul>
<li><a href="https://out.devdocs.io/s/maxcdn">MaxCDN</a>, <a href="https://sentry.io/">Sentry</a> and <a href="http://get.gaug.es/?utm_source=devdocs&utm_medium=referral&utm_campaign=sponsorships" title="Real Time Web Analytics">Gauges</a> for offering a free account to DevDocs
<li><a href="https://out.devdocs.io/s/maxcdn">MaxCDN</a>, <a href="https://sentry.io/">Sentry</a> and <a href="https://get.gaug.es/?utm_source=devdocs&utm_medium=referral&utm_campaign=sponsorships" title="Real Time Web Analytics">Gauges</a> for offering a free account to DevDocs
<li><a href="https://out.devdocs.io/s/maxcdn">MaxCDN</a>, <a href="https://out.devdocs.io/s/shopify">Shopify</a>, <a href="https://out.devdocs.io/s/jetbrains">JetBrains</a> and <a href="https://out.devdocs.io/s/code-school">Code School</a> for sponsoring DevDocs in the past
<li><a href="https://www.heroku.com">Heroku</a> and <a href="http://newrelic.com">New Relic</a> for providing awesome free service
<li><a href="https://www.heroku.com">Heroku</a> and <a href="https://newrelic.com/">New Relic</a> for providing awesome free service
<li><a href="https://www.jeremykratz.com/">Jeremy Kratz</a> for the C/C++ logo
</ul>
@ -78,7 +76,7 @@ app.templates.aboutPage = -> """
<h2 class="_block-heading" id="privacy">Privacy Policy</h2>
<ul>
<li><a href="http://devdocs.io">devdocs.io</a> ("App") is operated by Thibaut Courouble ("We").
<li><a href="https://devdocs.io">devdocs.io</a> ("App") is operated by Thibaut Courouble ("We").
<li>We do not collect personal information.
<li>We use Google Analytics, Gauges and Sentry to collect anonymous traffic information and improve the app.
<li>The app uses cookies to store user preferences.
@ -89,17 +87,17 @@ app.templates.aboutPage = -> """
credits = [
[ 'Angular<br>Angular.js',
'2010-2017 Google, Inc.',
'2010-2018 Google, Inc.',
'CC BY',
'https://creativecommons.org/licenses/by/4.0/'
], [
'Ansible',
'2012-2017 Michael DeHaan<br>&copy; 2017 Red Hat, Inc.',
'2012-2018 Michael DeHaan<br>&copy; 2018 Red Hat, Inc.',
'GPLv3',
'https://raw.githubusercontent.com/ansible/ansible/devel/COPYING'
], [
'Apache HTTP Server<br>Apache Pig',
'2017 The Apache Software Foundation<br>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.',
'2018 The Apache Software Foundation<br>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.',
'Apache',
'https://www.apache.org/licenses/LICENSE-2.0'
], [
@ -107,14 +105,24 @@ credits = [
'2010-2017 Caolan McMahon',
'MIT',
'https://raw.githubusercontent.com/caolan/async/master/LICENSE'
], [
'Babel',
'2018 Sebastian McKenzie',
'MIT',
'https://raw.githubusercontent.com/babel/website/master/LICENSE'
], [
'Backbone.js',
'2010-2016 Jeremy Ashkenas, DocumentCloud',
'MIT',
'https://raw.githubusercontent.com/jashkenas/backbone/master/LICENSE'
], [
'Bluebird',
'2013-2017 Petka Antonov',
'MIT',
'https://raw.githubusercontent.com/petkaantonov/bluebird/master/LICENSE'
], [
'Bootstrap',
'2011-2017 Twitter, Inc.<br>2011-2017 The Bootstrap Authors',
'2011-2018 Twitter, Inc.<br>2011-2018 The Bootstrap Authors',
'CC BY',
'https://creativecommons.org/licenses/by/3.0/'
], [
@ -124,7 +132,7 @@ credits = [
'https://raw.githubusercontent.com/bottlepy/bottle/master/LICENSE'
], [
'Bower',
'2017 Bower contributors',
'2018 Bower contributors',
'MIT',
'https://github.com/bower/bower.github.io/blob/1057905c18d899106f91372e6cca7ef54a91d60f/package.json#L20'
], [
@ -134,9 +142,9 @@ credits = [
'http://en.cppreference.com/w/Cppreference:Copyright/CC-BY-SA'
], [
'CakePHP',
'2005-2017 The Cake Software Foundation, Inc.',
'2005-2018 The Cake Software Foundation, Inc.',
'MIT',
'https://raw.githubusercontent.com/cakephp/cakephp/master/LICENSE.txt'
'https://raw.githubusercontent.com/cakephp/cakephp/master/LICENSE'
], [
'Chai',
'2016 Chai.js Assertion Library',
@ -159,7 +167,7 @@ credits = [
'https://cmake.org/licensing/'
], [
'Codeception',
'2011-2017 Michael Bodnarchuk and contributors',
'2011 Michael Bodnarchuk and contributors',
'MIT',
'https://raw.githubusercontent.com/Codeception/Codeception/master/LICENSE'
], [
@ -169,14 +177,14 @@ credits = [
'https://raw.githubusercontent.com/Codeception/CodeceptJS/master/LICENSE'
], [
'CodeIgniter',
'2014-2017 British Columbia Institute of Technology',
'2014-2018 British Columbia Institute of Technology',
'MIT',
'https://raw.githubusercontent.com/bcit-ci/CodeIgniter/develop/license.txt'
], [
'CoffeeScript',
'2009-2017 Jeremy Ashkenas',
'2009-2018 Jeremy Ashkenas',
'MIT',
'https://raw.githubusercontent.com/jashkenas/coffee-script/master/LICENSE'
'https://raw.githubusercontent.com/jashkenas/coffeescript/master/LICENSE'
], [
'Cordova',
'2012-2017 The Apache Software Foundation',
@ -194,12 +202,12 @@ credits = [
'https://raw.githubusercontent.com/crystal-lang/crystal/master/LICENSE'
], [
'D',
'1999-2017 The D Language Foundation',
'1999-2018 The D Language Foundation',
'Boost',
'https://raw.githubusercontent.com/dlang/phobos/master/LICENSE_1_0.txt'
], [
'D3.js',
'2010-2017 Michael Bostock',
'2010-2018 Michael Bostock',
'BSD',
'https://raw.githubusercontent.com/d3/d3/master/LICENSE'
], [
@ -224,12 +232,12 @@ credits = [
'https://api.drupal.org/api/drupal/LICENSE.txt'
], [
'Electron',
'2013-2017 GitHub Inc.',
'2013-2018 GitHub Inc.',
'MIT',
'https://raw.githubusercontent.com/electron/electron/master/LICENSE'
], [
'Elixir',
'2012-2017 Plataformatec',
'2012 Plataformatec',
'Apache',
'https://raw.githubusercontent.com/elixir-lang/elixir/master/LICENSE'
], [
@ -242,6 +250,11 @@ credits = [
'2010-2017 Ericsson AB',
'Apache',
'https://raw.githubusercontent.com/erlang/otp/maint/LICENSE.txt'
], [
'ESLint',
'JS Foundation and other contributors',
'MIT',
'https://raw.githubusercontent.com/eslint/eslint/master/LICENSE'
], [
'Express',
'2017 StrongLoop, IBM, and other expressjs.com contributors.',
@ -264,7 +277,7 @@ credits = [
'https://www.gnu.org/licenses/fdl-1.3.en.html'
], [
'Git',
'2005-2017 Linus Torvalds and others',
'2005-2018 Linus Torvalds and others',
'GPLv2',
'https://raw.githubusercontent.com/git/git/master/COPYING'
], [
@ -274,7 +287,7 @@ credits = [
'https://creativecommons.org/licenses/by/3.0/'
], [
'Godot',
'2014-2017 Juan Linietsky, Ariel Manzur, Godot Engine contributors',
'2014-2018 Juan Linietsky, Ariel Manzur, Godot Engine contributors',
'MIT',
'https://raw.githubusercontent.com/godotengine/godot/master/LICENSE.txt'
], [
@ -289,9 +302,14 @@ credits = [
'https://www.haskell.org/ghc/license'
], [
'Haxe',
'2005-2016 Haxe Foundation',
'2005-2018 Haxe Foundation',
'MIT',
'http://haxe.org/foundation/open-source.html'
'https://haxe.org/foundation/open-source.html'
], [
'Homebrew',
'2009-present Homebrew contributors',
'BSD',
'https://raw.githubusercontent.com/Homebrew/brew/master/LICENSE.txt'
], [
'Immutable.js',
'2014-2016 Facebook, Inc.',
@ -307,6 +325,11 @@ credits = [
'2008-2017 Pivotal Labs',
'MIT',
'https://raw.githubusercontent.com/jasmine/jasmine/master/MIT.LICENSE'
], [
'Jekyll',
'2008-2018 Tom Preston-Werner and Jekyll contributors',
'MIT',
'https://raw.githubusercontent.com/jekyll/jekyll/master/LICENSE'
], [
'Jest',
'2014-present Facebook Inc.',
@ -332,6 +355,11 @@ credits = [
'2009-2016 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors',
'MIT',
'https://raw.githubusercontent.com/JuliaLang/julia/master/LICENSE.md'
], [
'JSDoc',
'2011-2017 the contributors to the JSDoc 3 documentation project',
'CC BY-SA',
'https://raw.githubusercontent.com/jsdoc3/jsdoc3.github.com/master/LICENSE'
], [
'Knockout.js',
'Steven Sanderson, the Knockout.js team, and other contributors',
@ -339,7 +367,7 @@ credits = [
'https://raw.githubusercontent.com/knockout/knockout/master/LICENSE'
], [
'Kotlin',
'2010-2017 JetBrains s.r.o.',
'2010-2018 JetBrains s.r.o.',
'Apache',
'https://raw.githubusercontent.com/JetBrains/kotlin/master/license/LICENSE.txt'
], [
@ -359,9 +387,9 @@ credits = [
'https://raw.githubusercontent.com/Shopify/liquid/master/LICENSE'
], [
'Lo-Dash',
'2012-2016 The Dojo Foundation',
'JS Foundation and other contributors',
'MIT',
'https://raw.githubusercontent.com/lodash/lodash/master/LICENSE.txt'
'https://raw.githubusercontent.com/lodash/lodash/master/LICENSE'
], [
'Lua',
'19942017 Lua.org, PUC-Rio',
@ -399,7 +427,7 @@ credits = [
'https://github.com/seattlerb/minitest/blob/master/README.rdoc#license'
], [
'Mocha',
'2016 JS Foundation and contributors',
'2011-2018 JS Foundation and contributors',
'CC BY',
'https://creativecommons.org/licenses/by/4.0/'
], [
@ -419,12 +447,12 @@ credits = [
'https://github.com/LearnBoost/mongoose/blob/master/README.md#license'
], [
'nginx',
'2002-2017 Igor Sysoev<br>&copy; 2011-2017 Nginx, Inc.',
'2002-2018 Igor Sysoev<br>&copy; 2011-2018 Nginx, Inc.',
'BSD',
'http://nginx.org/LICENSE'
], [
'nginx / Lua Module',
'2009-2016 Xiaozhe Wang (chaoslawful)<br>&copy; 2009-2017 Yichun "agentzh" Zhang (章亦春), OpenResty Inc.',
'2009-2017 Xiaozhe Wang (chaoslawful)<br>&copy; 2009-2018 Yichun "agentzh" Zhang (章亦春), OpenResty Inc.',
'BSD',
'https://github.com/openresty/lua-nginx-module#copyright-and-license'
], [
@ -494,7 +522,7 @@ credits = [
'https://raw.githubusercontent.com/phoenixframework/phoenix/master/LICENSE.md'
], [
'PHP',
'1997-2017 The PHP Documentation Group',
'1997-2018 The PHP Documentation Group',
'CC BY',
'https://secure.php.net/manual/en/copyright.php'
], [
@ -504,12 +532,12 @@ credits = [
'https://creativecommons.org/licenses/by/3.0/'
], [
'PostgreSQL',
'1996-2017 The PostgreSQL Global Development Group<br>&copy; 1994 The Regents of the University of California',
'1996-2018 The PostgreSQL Global Development Group<br>&copy; 1994 The Regents of the University of California',
'PostgreSQL',
'https://www.postgresql.org/about/licence/'
], [
'Python',
'2001-2017 Python Software Foundation<br>Python is a trademark of the Python Software Foundation.',
'2001-2018 Python Software Foundation<br>Python is a trademark of the Python Software Foundation.',
'PSFL',
'https://docs.python.org/3/license.html'
], [
@ -524,12 +552,12 @@ credits = [
'https://raw.githubusercontent.com/ramda/ramda/master/LICENSE.txt'
], [
'React, React Native, Flow, Relay',
'2013-2017 Facebook Inc.',
'2013-present Facebook Inc.',
'CC BY',
'https://raw.githubusercontent.com/facebook/react/master/LICENSE-docs'
'https://raw.githubusercontent.com/reactjs/reactjs.org/master/LICENSE-DOCS.md'
], [
'Redis',
'2009-2017 Salvatore Sanfilippo',
'2009-2018 Salvatore Sanfilippo',
'CC BY-SA',
'https://creativecommons.org/licenses/by-sa/4.0/'
], [
@ -579,7 +607,7 @@ credits = [
'https://raw.githubusercontent.com/scikit-learn/scikit-learn/master/COPYING'
], [
'Sinon',
'2010-2017 Christian Johansen',
'2010-2018 Christian Johansen',
'BSD',
'https://raw.githubusercontent.com/sinonjs/sinon/master/LICENSE'
], [
@ -609,7 +637,7 @@ credits = [
'http://tcl.tk/software/tcltk/license.html'
], [
'TensorFlow',
'2017 The TensorFlow Authors',
'2018 The TensorFlow Authors',
'CC BY',
'https://creativecommons.org/licenses/by/3.0/'
], [
@ -624,17 +652,17 @@ credits = [
'https://raw.githubusercontent.com/Microsoft/TypeScript-Handbook/master/LICENSE'
], [
'Underscore.js',
'2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors',
'2009-2017 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors',
'MIT',
'https://raw.githubusercontent.com/jashkenas/underscore/master/LICENSE'
], [
'Vagrant',
'2010-2017 Mitchell Hashimoto',
'2010-2018 Mitchell Hashimoto',
'MPL',
'https://raw.githubusercontent.com/mitchellh/vagrant/master/website/LICENSE.md'
], [
'Vue.js',
'2013-2017 Evan You, Vue.js contributors',
'2013-2018 Evan You, Vue.js contributors',
'MIT',
'https://raw.githubusercontent.com/vuejs/vue/master/LICENSE'
], [
@ -649,7 +677,7 @@ credits = [
'https://creativecommons.org/licenses/by/4.0/'
], [
'Yarn',
'2016-2017 Yarn Contributors',
'2016-present Yarn Contributors',
'BSD',
'https://raw.githubusercontent.com/yarnpkg/yarn/master/LICENSE'
], [

@ -20,7 +20,7 @@ app.templates.helpPage = ->
</ul>
</nav>
<h1 class="_lined-heading">User Guide</h2>
<h1 class="_lined-heading">User Guide</h1>
<h2 class="_block-heading" id="managing-documentations">Managing Documentations</h2>
<p>
@ -57,9 +57,7 @@ app.templates.helpPage = ->
<ul>
<li>On Chrome, the setup is done automatically. Simply press <code class="_label">tab</code> when devdocs.io is autocompleted
in the omnibox (to set a custom keyword, click <em>Manage search engines\u2026</em> in Chrome's settings).
<li>On Firefox, open the search engine list (icon in the search bar) and click <em>Add "DevDocs Search"</em>.
DevDocs is now available in the search bar. You can also search from the location bar by following
<a href="https://support.mozilla.org/en-US/kb/how-search-from-address-bar">these instructions</a>.
<li>On Firefox, right-click the DevDocs search field and select <em>Add a Keyword for this Search</em>. Then, type the added keyword followed by a query in the address bar to search DevDocs.
</dl>
<p>
<i>Note: the above search features only work for documentations that are enabled.</i>
@ -153,5 +151,5 @@ app.templates.helpPage = ->
#{("<tr><td class=\"_code\">#{key}<td class=\"_code\">#{value}" for key, value of aliases_two).join('')}
</table>
</div>
<p>Feel free to suggest new aliases on <a href="https://github.com/Thibaut/devdocs/issues/new">GitHub</a>.
<p>Feel free to suggest new aliases on <a href="https://github.com/freeCodeCamp/devdocs/issues/new">GitHub</a>.
"""

@ -4,7 +4,7 @@ app.templates.newsPage = ->
""" <h1 class="_lined-heading">Changelog</h1>
<p class="_note">
For the latest news, follow <a href="https://twitter.com/DevDocs">@DevDocs</a>.<br>
For development updates, follow the project on <a href="https://github.com/Thibaut/devdocs">GitHub</a>.
For development updates, follow the project on <a href="https://github.com/freeCodeCamp/devdocs">GitHub</a>.
<div class="_news">#{app.templates.newsList app.news}</div> """
app.templates.newsList = (news, options = {}) ->

@ -32,7 +32,7 @@ app.templates.offlinePage = (docs) -> """
<dt>What if I don't update a documentation?
<dd>You'll see outdated content and some pages will be missing or broken, because the rest of the app (including data for the search and sidebar) uses a different caching mechanism that's updated automatically.
<dt>I found a bug, where do I report it?
<dd>In the <a href="https://github.com/Thibaut/devdocs/issues">issue tracker</a>. Thanks!
<dd>In the <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a>. Thanks!
<dt>How do I uninstall/reset the app?
<dd>Click <a href="#" data-behavior="reset">here</a>.
<dt>Why aren't all documentations listed above?

@ -8,18 +8,17 @@ app.templates.intro = """
<p>Thanks for downloading DevDocs. Here are a few things you should know:
<ol class="_intro-list">
<li>Your local version of DevDocs won't self-update. Unless you're modifying the code,
I&nbsp;recommend using the hosted version at <a href="http://devdocs.io">devdocs.io</a>.
I&nbsp;recommend using the hosted version at <a href="https://devdocs.io">devdocs.io</a>.
<li>Run <code>thor docs:list</code> to see all available documentations.
<li>Run <code>thor docs:download &lt;name&gt;</code> to download documentations.
<li>Run <code>thor docs:download --installed</code> to update all downloaded documentations.
<li>To be notified about new versions, don't forget to <a href="https://github.com/Thibaut/devdocs/subscription">watch the repository</a> on GitHub.
<li>The <a href="https://github.com/Thibaut/devdocs/issues">issue tracker</a> is the preferred channel for bug reports and
<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.
<li>The <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a> is the preferred channel for bug reports and
feature requests. For everything else, use the <a href="https://groups.google.com/d/forum/devdocs">mailing list</a>.
<li>Contributions are welcome. See the <a href="https://github.com/Thibaut/devdocs/blob/master/CONTRIBUTING.md">guidelines</a>.
<li>Contributions are welcome. See the <a href="https://github.com/freeCodeCamp/devdocs/blob/master/CONTRIBUTING.md">guidelines</a>.
<li>DevDocs is licensed under the terms of the Mozilla Public License v2.0. For more information,
see the <a href="https://github.com/Thibaut/devdocs/blob/master/COPYRIGHT">COPYRIGHT</a> and
<a href="https://github.com/Thibaut/devdocs/blob/master/LICENSE">LICENSE</a> files.
<li>If you like the app, please consider supporting the project on <a href="https://gratipay.com/devdocs/">Gratipay</a>. Thanks!
see the <a href="https://github.com/freeCodeCamp/devdocs/blob/master/COPYRIGHT">COPYRIGHT</a> and
<a href="https://github.com/freeCodeCamp/devdocs/blob/master/LICENSE">LICENSE</a> files.
</ol>
<p>Happy coding!
</div></div>
@ -39,9 +38,8 @@ app.templates.intro = """
<li>You can search using your browser's address bar &mdash; <a href="/help#browser_search">learn how</a>.
<li>DevDocs works <a href="/offline">offline</a>, on mobile, and can be installed on <a href="https://chrome.google.com/webstore/detail/devdocs/mnfehgbmkapmjnhcnbodoamcioleeooe">Chrome</a>.
<li>For the latest news, follow <a href="https://twitter.com/DevDocs">@DevDocs</a>.
<li>DevDocs is free and <a href="https://github.com/Thibaut/devdocs">open source</a>.
<iframe class="_github-btn" src="//ghbtns.com/github-btn.html?user=Thibaut&repo=devdocs&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
<li>If you like the app, please consider supporting the project on <a href="https://gratipay.com/devdocs/">Gratipay</a>. Thanks!
<li>DevDocs is free and <a href="https://github.com/freeCodeCamp/devdocs">open source</a>.
<iframe class="_github-btn" src="//ghbtns.com/github-btn.html?user=freeCodeCamp&repo=devdocs&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
<li>And if you're new to coding, check out <a href="https://www.freecodecamp.org/">freeCodeCamp's open source curriculum</a>.
</ol>
<p>Happy coding!
@ -59,7 +57,7 @@ app.templates.mobileIntro = """
<li>The search supports fuzzy matching.
<li>To search a specific documentation, type its name (or an abbr.), then Space.
<li>For the latest news, follow <a href="https://twitter.com/DevDocs">@DevDocs</a>.
<li>DevDocs is <a href="https://github.com/Thibaut/devdocs">open source</a>.
<li>DevDocs is <a href="https://github.com/freeCodeCamp/devdocs">open source</a>.
</ol>
<p>Happy coding!
<a class="_intro-hide" data-hide-intro>Stop showing this message</a>
@ -71,6 +69,17 @@ app.templates.androidWarning = """
<h2 class="_intro-title">Hi there</h2>
<p>DevDocs is running inside an Android WebView. Some features may not work properly.
<p>If you downloaded an app called DevDocs on the Play Store, please uninstall it — it's made by someone who is using (and profiting from) the name DevDocs without permission.
<p>To install DevDocs on your phone, visit <a href="http://devdocs.io" target="_blank" rel="noopener">devdocs.io</a> in Chrome and select "Add to home screen" in the menu.
<p>To install DevDocs on your phone, visit <a href="https://devdocs.io" target="_blank" rel="noopener">devdocs.io</a> in Chrome and select "Add to home screen" in the menu.
</div>
"""
app.templates.httpWarning = """
<div class="_intro"><div class="_intro-message">
<h2 class="_intro-title">Hi there!</h2>
<p>DevDocs is migrating to HTTPS.
<p>Please update your bookmarks to point to <a href="https://devdocs.io">https://devdocs.io</a>.
<p>When using the HTTPS version, your preferences will carry over automatically, but your offline data will be reset. Simply re-download documentation in the <a href="https://devdocs.io/offline">Offline area</a>, and you'll be all set to use DevDocs securely offline.
<p>Sorry for the inconvenience. This migration is needed because browsers are removing support for certain DOM APIs that power DevDocs's offline mode over non-secure origins.
<p>Thanks for using DevDocs, and happy coding!
</div></div>
"""

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -9,10 +9,21 @@ class app.views.RootPage extends app.View
render: ->
@empty()
if app.isAndroidWebview()
@append @tmpl('androidWarning')
tmpl = if app.isAndroidWebview()
'androidWarning'
else if @isHidden()
'splash'
else if app.isMobile()
'mobileIntro'
else
@append @tmpl if @isHidden() then 'splash' else if app.isMobile() then 'mobileIntro' else 'intro'
'intro'
# temporary
if location.host is 'devdocs.io' and location.protocol is 'http:'
tmpl = 'httpWarning'
@append @tmpl(tmpl)
return
hideIntro: ->

@ -50,7 +50,7 @@ class app.views.Resizer extends app.View
onDragEnd: (event) =>
$.off(window, 'dragover', @onDrag)
value = event.pageX or (event.screenX - window.screenX)
if @lastDragValue and not (@lastDragValue - 5 < value < @lastDragValue + 5) # https://github.com/Thibaut/devdocs/issues/265
if @lastDragValue and not (@lastDragValue - 5 < value < @lastDragValue + 5) # https://github.com/freeCodeCamp/devdocs/issues/265
value = @lastDragValue
@resize(value, true)
return

@ -127,7 +127,6 @@ class app.views.Search extends app.View
if event.target is @resetLink
$.stopEvent(event)
@reset()
app.document.onEscape()
return
onSubmit: (event) ->

@ -4,7 +4,7 @@
//= depend_on docs-2@2x.png
/*!
* Copyright 2013-2017 Thibaut Courouble and other contributors
* Copyright 2013-2018 Thibaut Courouble and other contributors
*
* This source code is licensed under the terms of the Mozilla
* Public License, v. 2.0, a copy of which may be obtained at:
@ -12,6 +12,7 @@
*/
@import 'global/variables-dark',
'global/mixins',
'global/icons',
'global/classes',
'global/base';
@ -54,6 +55,7 @@
'pages/github',
'pages/go',
'pages/haskell',
'pages/jekyll',
'pages/jquery',
'pages/julia',
'pages/knockout',

@ -4,7 +4,7 @@
//= depend_on docs-2@2x.png
/*!
* Copyright 2013-2017 Thibaut Courouble and other contributors
* Copyright 2013-2018 Thibaut Courouble and other contributors
*
* This source code is licensed under the terms of the Mozilla
* Public License, v. 2.0, a copy of which may be obtained at:
@ -12,6 +12,7 @@
*/
@import 'global/variables',
'global/mixins',
'global/icons',
'global/classes',
'global/base';
@ -54,6 +55,7 @@
'pages/github',
'pages/go',
'pages/haskell',
'pages/jekyll',
'pages/jquery',
'pages/julia',
'pages/knockout',

@ -382,6 +382,8 @@
._table { width: 100%; }
._mobile ._table { overflow-x: auto; }
._pre-heading { @extend %pre-heading; }
._pre-clip {
display: none;
position: absolute;

@ -4,6 +4,9 @@ html {
background: $documentBackground;
@media #{$mediumScreen} { font-size: 93.75%; }
@include print { background: none; }
@import 'global/print';
}
body {

@ -92,6 +92,7 @@
._icon-nginx_lua_module:before { background-position: -4rem -5rem; }
._icon-svg:before { background-position: -5rem -5rem; }
._icon-marionette:before { background-position: -6rem -5rem; }
._icon-jsdoc:before,
._icon-mongoose:before { background-position: -7rem -5rem; }
._icon-phpunit:before { background-position: -8rem -5rem; }
._icon-nokogiri:before { background-position: -9rem -5rem; @extend %darkIconFix !optional; }
@ -164,3 +165,8 @@
._icon-nim:before { background-position: -5rem -2rem; @extend %doc-icon-2; @extend %darkIconFix !optional; }
._icon-vulkan:before { background-position: -6rem -2rem; @extend %doc-icon-2; @extend %darkIconFix !optional; }
._icon-d:before { background-position: -7rem -2rem; @extend %doc-icon-2; }
._icon-bluebird:before { background-position: -8rem -2rem; @extend %doc-icon-2; }
._icon-eslint:before { background-position: -9rem -2rem; @extend %doc-icon-2; }
._icon-homebrew:before { background-position: 0 -3rem; @extend %doc-icon-2; }
._icon-jekyll:before { background-position: -1rem -3rem; @extend %doc-icon-2; }
._icon-babel:before { background-position: -2rem -3rem; @extend %doc-icon-2; }

@ -0,0 +1,9 @@
//
// Mixins
//
@mixin print {
@media print {
@content;
}
}

@ -0,0 +1,57 @@
@include print {
._header, ._sidebar, ._path, ._notif, ._toc, ._pre-clip, ._notice, ._links {
display: none !important;
}
body, ._app, ._container, ._content {
margin: 0;
padding: 0;
height: initial;
background: none;
&:after {
content: '';
clear: both;
}
}
::-webkit-scrollbar {
display: none;
}
%external-link:after {
display: none;
}
._attribution-p {
background: none;
border: 2px solid $boxBorder;
}
._attribution:last-child:after {
content: 'Exported from DevDocs \2014 https://devdocs.io';
display: block;
margin-top: 1rem;
font-weight: $bolderFontWeight;
}
._attribution {
page-break-inside: avoid;
}
h1, h2, h3, h4, h5, h6 {
page-break-inside: avoid;
page-break-after: avoid;
}
pre {
page-break-before: avoid;
orphans: 5;
widows: 5;
}
p {
orphans: 2;
widows: 2;
}
}

@ -46,6 +46,8 @@
+ div { margin-left: .5em; }
}
> table { margin: 0; }
}
.t-dcl-rev-aux > td:empty { padding: 0; }

@ -0,0 +1,7 @@
._jekyll {
@extend %simple;
.note.info { @extend %note-blue; }
.note.warning { @extend %note-red; }
.note.unreleased { @extend %note-orange; }
}

@ -1,19 +1,24 @@
._postgres {
padding-left: 1rem;
h1, h1 ~ p, h1 ~ pre, h1 ~ blockquote, h2, .NAVFOOTER { margin-left: -1rem; }
h1, h1 ~ p, h1 ~ pre, h1 ~ ul, h1 ~ blockquote, h2, .navfooter { margin-left: -1rem; }
h2 { @extend %block-heading; }
.VARIABLELIST dt { @extend %block-label, %label-blue; }
.variablelist dt { @extend %block-label, %label-blue; }
blockquote.NOTE, blockquote.IMPORTANT, blockquote.TIP, blockquote.CAUTION { @extend %note; }
blockquote.TIP { @extend %note-green; }
blockquote.CAUTION { @extend %note-orange; }
blockquote.note, blockquote.important, blockquote.tip, blockquote.caution { @extend %note; }
blockquote.tip { @extend %note-green; }
blockquote.caution { @extend %note-orange; }
blockquote > h3 {
font-size: .875rem;
margin: 0 0 .25rem;
}
p > code { @extend %label; }
p.c2 { font-weight: $boldFontWeight; }
.NAVFOOTER > table { width: 100%; }
.navfooter > table { width: 100%; }
td[align=center] { text-align: center; }
td[align=right] { text-align: right; }
}

@ -27,6 +27,10 @@
@extend %user-select-none;
&:hover { text-decoration: underline; }
@include print {
display: none;
}
}
.method-description { position: relative; }

@ -133,7 +133,7 @@ class App < Sinatra::Application
end
def canonical_origin
"http://#{request.host_with_port}"
"https://#{request.host_with_port}"
end
def browser
@ -253,7 +253,7 @@ class App < Sinatra::Application
before do
if request.host == OUT_HOST && !request.path.start_with?('/s/')
query_string = "?#{request.query_string}" unless request.query_string.empty?
redirect "http://devdocs.io#{request.path}#{query_string}", 302
redirect "https://devdocs.io#{request.path}#{query_string}", 302
end
end
@ -435,13 +435,13 @@ class App < Sinatra::Application
maker.channel.links.new_link do |link|
link.rel = 'self'
link.href = 'http://devdocs.io/feed.atom'
link.href = 'https://devdocs.io/feed.atom'
link.type = 'application/atom+xml'
end
maker.channel.links.new_link do |link|
link.rel = 'alternate'
link.href = 'http://devdocs.io/'
link.href = 'https://devdocs.io/'
link.type = 'text/html'
end
@ -450,14 +450,14 @@ class App < Sinatra::Application
item.id = "tag:devdocs.io,2014:News/#{settings.news.length - i}"
item.title = news[1].split("\n").first.gsub(/<\/?[^>]*>/, '')
item.description do |desc|
desc.content = news[1..-1].join.gsub("\n", '<br>').gsub('href="/', 'href="http://devdocs.io/')
desc.content = news[1..-1].join.gsub("\n", '<br>').gsub('href="/', 'href="https://devdocs.io/')
desc.type = 'html'
end
item.updated = "#{news.first}T14:00:00Z"
item.published = "#{news.first}T14:00:00Z"
item.links.new_link do |link|
link.rel = 'alternate'
link.href = 'http://devdocs.io/'
link.href = 'https://devdocs.io/'
link.type = 'text/html'
end
end

@ -2,6 +2,7 @@ module Docs
class Doc
INDEX_FILENAME = 'index.json'
DB_FILENAME = 'db.json'
META_FILENAME = 'meta.json'
class << self
include Instrumentable
@ -73,6 +74,10 @@ module Docs
File.join path, DB_FILENAME
end
def meta_path
File.join path, META_FILENAME
end
def as_json
json = { name: name, slug: slug, type: type }
json[:links] = links if links.present?
@ -107,6 +112,7 @@ module Docs
if index.present?
store_index(store, INDEX_FILENAME, index)
store_index(store, DB_FILENAME, pages)
store_meta(store)
true
else
false
@ -131,7 +137,15 @@ module Docs
instrument "#{filename.remove('.json')}.doc", before: old_json, after: new_json
store.write(filename, new_json)
end
def store_meta(store)
json = as_json
json[:mtime] = Time.now.to_i
json[:db_size] = store.size(DB_FILENAME)
store.write(META_FILENAME, json.to_json)
end
end
def initialize
raise NotImplementedError, "#{self.class} is an abstract class and cannot be instantiated." if self.class.abstract

@ -91,19 +91,10 @@ module Docs
super
end
def decode_cloudflare_email(str)
mask = "0x#{str[0..1]}".hex | 0
result = ''
str.chars.drop(2).each_slice(2) do |slice|
result += "%" + "0#{("0x#{slice.join}".hex ^ mask).to_s(16)}"[-2..-1]
end
URI.decode(result)
end
def clean_path(path)
path.gsub %r{[!;:]+}, '-'
path = path.gsub %r{[!;:]}, '-'
path = path.gsub %r{\+}, '_plus_'
path
end
end
end

@ -14,32 +14,14 @@ module Docs
end
def as_json
indexed_docs.map do |doc|
json = doc.as_json
json[:mtime] = doc_mtime(doc)
json[:db_size] = doc_db_size(doc)
json
@docs.each_with_object [] do |doc, result|
next unless @store.exist?(doc.meta_path)
result << JSON.parse(@store.read(doc.meta_path))
end
end
def to_json
JSON.generate(as_json)
end
private
def indexed_docs
@docs.select do |doc|
@store.exist?(doc.index_path) && @store.exist?(doc.db_path)
end
end
def doc_mtime(doc)
[@store.mtime(doc.index_path).to_i, @store.mtime(doc.db_path).to_i].max
end
def doc_db_size(doc)
@store.size(doc.db_path)
JSON.pretty_generate(as_json)
end
end
end

@ -41,7 +41,7 @@ module Docs
self.html_filters = FilterStack.new
self.text_filters = FilterStack.new
html_filters.push 'apply_base_url', 'container', 'clean_html', 'normalize_urls', 'internal_urls', 'normalize_paths'
html_filters.push 'apply_base_url', 'container', 'clean_html', 'normalize_urls', 'internal_urls', 'normalize_paths', 'parse_cf_email'
text_filters.push 'images' # ensure the images filter runs after all html filters
text_filters.push 'inner_html', 'clean_text', 'attribution'

@ -39,7 +39,10 @@ module Docs
end
def read_file(path)
File.read(path) rescue nil
File.read(path)
rescue
instrument 'warn.doc', msg: "Failed to open file: #{path}"
nil
end
end
end

@ -13,6 +13,8 @@ module Docs
end
end
@@rate_limiter = nil
self.params = {}
self.headers = { 'User-Agent' => 'DevDocs' }
self.force_gzip = false
@ -24,6 +26,15 @@ module Docs
end
def request_all(urls, &block)
if options[:rate_limit]
if @@rate_limiter
@@rate_limiter.limit = options[:rate_limit]
else
@@rate_limiter = RateLimiter.new(options[:rate_limit])
Typhoeus.before(&@@rate_limiter.to_proc)
end
end
Requester.run urls, request_options: request_options, &block
end
@ -35,7 +46,11 @@ module Docs
def process_response?(response)
if response.error?
raise "Error status code (#{response.code}): #{response.return_message}\n#{response.url}"
raise <<~ERROR
Error status code (#{response.code}): #{response.return_message}
#{response.url}
#{JSON.pretty_generate(response.headers).slice(2..-3)}
ERROR
elsif response.blank?
raise "Empty response body: #{response.url}"
end
@ -161,5 +176,35 @@ module Docs
super.merge! redirections: self.class.redirections
end
end
class RateLimiter
attr_accessor :limit
def initialize(limit)
@limit = limit
@minute = nil
@counter = 0
end
def call(*)
if @minute != Time.now.min
@minute = Time.now.min
@counter = 0
end
@counter += 1
if @counter >= @limit
wait = Time.now.end_of_minute.to_i - Time.now.to_i + 1
sleep wait
end
true
end
def to_proc
method(:call).to_proc
end
end
end
end

@ -4,10 +4,6 @@ module Docs
def call
@doc = at_css('#page-content')
css('.__cf_email__').each do |node|
node.replace(decode_cloudflare_email(node['data-cfemail']))
end
doc
end
end

@ -0,0 +1,38 @@
module Docs
class Babel
class CleanHtmlFilter < Filter
def call
if root_page?
doc.inner_html = '<h1>Babel</h1>'
return doc
end
header = at_css('.docs-header .col-md-12')
@doc = at_css('.docs-content')
doc.prepend_child(header)
css('.btn-clipboard', '.package-links').remove
css('.col-md-12', 'h1 a', 'h2 a', 'h3 a', 'h4 a', 'h5 a', 'h5 a').each do |node|
node.before(node.children).remove
end
css('div.highlighter-rouge').each do |node|
pre = node.at_css('pre')
lang = node['class'][/language-(\w+)/, 1]
lang = 'bash' if lang == 'sh'
pre['data-language'] = lang
pre.remove_attribute('class')
pre.content = pre.content
node.replace(pre)
end
css('code').remove_attr('class')
doc
end
end
end
end

@ -0,0 +1,40 @@
module Docs
class Babel
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('h1').content
end
def get_type
if subpath.start_with?('plugins/preset')
'Presets'
elsif subpath.start_with?('plugins/transform')
'Transform Plugins'
elsif subpath.start_with?('plugins/minify')
'Minification'
elsif subpath.start_with?('plugins/syntax')
'Syntax Plugins'
elsif subpath.start_with?('plugins')
'Plugins'
elsif subpath.start_with?('usage/')
'Usage'
elsif subpath.start_with?('core-packages/')
'Core Packages'
else
'Miscellaneous'
end
end
def additional_entries
return [] unless slug.include?('api')
css('h2').each_with_object [] do |node, entries|
name = node.content.strip
next unless name.start_with?('babel.')
name.sub! %r{\(.*}, '()'
entries << [name, node['id']]
end
end
end
end
end

@ -0,0 +1,36 @@
module Docs
class Bluebird
class CleanHtmlFilter < Filter
def call
@doc = at_css('.post')
css('hr').remove
css('.api-code-section').each do |node|
node.previous_element.remove
end
css('.post-header', '.post-content', '.api-reference-menu', '.api-code-section', 'markdown', '.highlight', 'code code').each do |node|
node.before(node.children).remove
end
at_css('> h2:first-child').name = 'h1' unless at_css('h1')
css('.header-anchor[name]').each do |node|
node.parent['id'] = node['name']
end
css('pre').each do |node|
node.content = node.content
node['data-language'] = 'javascript'
end
css('.info-box').each do |node|
node.name = 'blockquote'
end
doc
end
end
end
end

@ -0,0 +1,48 @@
module Docs
class Bluebird
class EntriesFilter < Docs::EntriesFilter
TYPE_MAP = {
Core: %w(new-promise then spread catch error finally bind promise.join
promise.try promise.method promise.resolve promise.reject core
promise.bind),
'Synchronous inspection': %w(promiseinspection isfulfilled isrejected
ispending iscancelled value reason),
Collections: %w(promise.all promise.props promise.any promise.some
promise.map promise.reduce promise.filter promise.each
promise.mapseries promise.race all props any some map reduce filter
each mapseries),
'Resource management': %w(promise.using disposer),
Promisification: %w(promise.promisify promise.promisifyall
promise.fromcallback ascallback),
Timers: %w(delay timeout promise.delay),
Cancellation: %w(cancel),
Generators: %w(promise.coroutine promise.coroutine.addyieldhandler),
Utility: %w(tap tapcatch call get return throw catchreturn catchthrow
reflect promise.getnewlibrarycopy promise.noconflict
promise.setscheduler),
'Built-in error types': %w(operationalerror timeouterror
cancellationerror aggregateerror),
Configuration: %w(global-rejection-events local-rejection-events
done promise.config suppressunhandledrejections
promise.onpossiblyunhandledrejection promise.bind
promise.onunhandledrejectionhandled),
}
def get_name
name = at_css('h1').content.strip
name << '()' if doc.to_html.include?("#{name}(")
name
end
def get_type
if slug.start_with?('api')
TYPE_MAP.each do |key, value|
return key.to_s if value.include?(slug.remove('api/'))
end
else
'Guides'
end
end
end
end
end

@ -27,7 +27,7 @@ module Docs
node.remove_attribute('data-example-id')
prev = node.previous_element
prev = prev.previous_element until prev['id']
node.inner_html = %(<a href="#{current_url}/##{prev['id']}">Open example on getbootstrap.com</a>)
node.inner_html = %(<a href="#{current_url}##{prev['id']}">Open example on getbootstrap.com</a>)
end
end
@ -39,10 +39,6 @@ module Docs
node['class'] = 'col'
end
css('.__cf_email__').each do |node|
node.replace(decode_cloudflare_email(node['data-cfemail']))
end
css('figure.highlight').each do |node|
code = node.at_css('code')
node['data-language'] = code['data-lang']

@ -17,6 +17,8 @@ module Docs
end
css('.bd-example', '.responsive-utilities-test').each do |node|
next unless node.previous_element
if node.previous_element['class'].try(:include?, 'bd-example')
node.remove
else
@ -26,7 +28,7 @@ module Docs
node.remove_attribute('data-example-id')
prev = node.previous_element
prev = prev.previous_element until prev['id']
node.inner_html = %(<a href="#{current_url}/##{prev['id']}">Open example on getbootstrap.com</a>)
node.inner_html = %(<a href="#{current_url}##{prev['id']}">Open example on getbootstrap.com</a>)
end
end
@ -38,10 +40,6 @@ module Docs
node['class'] = 'col'
end
css('.__cf_email__').each do |node|
node.replace(decode_cloudflare_email(node['data-cfemail']))
end
css('.highlight').each do |node|
code = node.at_css('code')
node['data-language'] = code['data-lang']

@ -4,12 +4,17 @@ module Docs
def call
css('h1').remove if root_page?
css('.t-dcl-rev-aux td[rowspan]').each do |node|
rowspan = node['rowspan'].to_i
node['rowspan'] = node.ancestors('tbody').css('tr').length if rowspan > 3
end
css('#siteSub', '#contentSub', '.printfooter', '.t-navbar', '.editsection', '#toc',
'.t-dsc-sep', '.t-dcl-sep', '#catlinks', '.ambox-notice', '.mw-cite-backlink',
'.t-sdsc-sep:first-child:last-child', '.t-example-live-link',
'.t-dcl-rev-num > .t-dcl-rev-aux ~ tr:not(.t-dcl-rev-aux) > td:nth-child(2)').remove
css('#bodyContent', '.mw-content-ltr', 'span[style]', 'div[class^="t-ref"]',
css('#bodyContent', '.mw-content-ltr', 'span[style]', 'div[class^="t-ref"]', '.t-image',
'th > div', 'td > div', '.t-dsc-see', '.mainpagediv', 'code > b', 'tbody').each do |node|
node.before(node.children).remove
end
@ -78,7 +83,7 @@ module Docs
end
node.inner_html = node.inner_html.strip
node << '.' if node.content =~ /[a-zA-Z0-9\)]\z/
node.remove if node.content.blank?
node.remove if node.content.blank? && !node.at_css('img')
end
css('pre').each do |node|
@ -100,6 +105,10 @@ module Docs
node.content = node.content
end
css('img').each do |node|
node['src'] = node['src'].sub! %r{http://en.cppreference.com/common/([^"']+?)\.svg}, 'http://upload.cppreference.com/mwiki/\1.svg'
end
doc
end
end

@ -4,6 +4,12 @@ module Docs
def call
@doc = doc.at_css('#page')
css('.algolia__search-content').remove
css('.algolia__initial-content').each do |node|
node.before(node.children).remove
end
while doc.element_children.length == 1
doc.first_element_child.before(doc.first_element_child.children).remove
end

@ -2,7 +2,7 @@ module Docs
class Codeception
class EntriesFilter < Docs::EntriesFilter
def get_name
name = (at_css('h1') || at_css('h2')).content
name = (at_css('.js-algolia__initial-content h1') || at_css('.js-algolia__initial-content h2')).content
if number = subpath[/\A\d+/]
name.prepend "#{number.to_i}. "

@ -0,0 +1,21 @@
# frozen_string_literal: true
module Docs
class ParseCfEmailFilter < Filter
def call
css('.__cf_email__').each do |node|
str = node['data-cfemail']
mask = "0x#{str[0..1]}".hex | 0
result = ''
str.chars.drop(2).each_slice(2) do |slice|
result += "%" + "0#{("0x#{slice.join}".hex ^ mask).to_s(16)}"[-2..-1]
end
node.replace(URI.decode(result))
end
doc
end
end
end

@ -4,7 +4,6 @@ module Docs
def call
html.gsub! File.join(Cpp.base_url, Cpp.root_path), Cpp.base_url[0..-2]
html.gsub! %r{#{Cpp.base_url}([^"']+?)\.html}, "#{Cpp.base_url}\\1"
html.gsub! %r{http://en.cppreference.com/common/([^"']+?)\.svg}, 'http://upload.cppreference.com/mwiki/\1.svg'
html
end
end

@ -7,8 +7,8 @@ module Docs
'CSS_Columns' => 'Multi-column Layout',
'CSS_Flexible_Box_Layout' => 'Flexible Box Layout',
'CSS_Grid_Layout' => 'Grid Layout',
'CSS_Images' => 'Image Values',
'CSS_Lists_and_Counters' => 'Lists & Counters',
'CSS_Images' => 'Images',
'CSS_Lists_and_Counters' => 'Lists',
'CSS_Transforms' => 'Transforms',
'Media_Queries' => 'Media Queries',
'transform-function' => 'Transforms',
@ -34,7 +34,7 @@ module Docs
"#{super}()"
elsif slug =~ /\A[a-z]+_/i
slug.to_s.gsub('_', ' ').gsub('/', ': ')
elsif slug.start_with?('transform-function')
elsif slug.start_with?('transform-function') || slug.start_with?('filter-function')
slug.split('/').last + '()'
else
super
@ -51,6 +51,7 @@ module Docs
type.remove! ' Module'
type.remove! %r{ Level \d\z}
type.remove! %r{\(.*\)}
type.remove! %r{ \d\z}
type.sub! 'and', '&'
type.strip!
type = 'Grid Layout' if type.include?('Grid Layout')
@ -74,9 +75,10 @@ module Docs
'spec-Living' => 0,
'spec-REC' => 1,
'spec-CR' => 2,
'spec-LC' => 3,
'spec-WD' => 4,
'spec-ED' => 5
'spec-PR' => 3,
'spec-LC' => 4,
'spec-WD' => 5,
'spec-ED' => 6
}
PRIORITY_STATUSES = %w(spec-REC spec-CR)
@ -89,6 +91,8 @@ module Docs
specs.map! { |node| [node.at_css('> td:nth-child(1) > a'), node.at_css('> td:nth-child(2) > span')] }
# ignore non-CSS specs
specs.select! { |pair| pair.first && pair.first['href'] =~ /css|fxtf|fullscreen|svg/i && !pair.first['href'].include?('compat.spec') }
# ignore specs with no status
specs.select! { |pair| pair.second }
# ["Spec", "spec-REC"]
specs.map! { |pair| [pair.first.child.content, pair.second['class']] }
# sort by status

@ -19,6 +19,8 @@ module Docs
name.split('.')[0..2].join('.')
elsif name.start_with?('ddmd')
'ddmd'
elsif name.start_with?('rt')
'rt'
else
name.split('.')[0..1].join('.')
end

@ -10,6 +10,8 @@ module Docs
'Audio' => 'Audio',
'Battery Status' => 'Battery Status',
'Canvas ' => 'Canvas',
'Clipboard' => 'Clipboard',
'Content Security' => 'Content Security Policy',
'Cooperative Scheduling' => 'Scheduling',
'CSS Font Loading' => 'CSS',
'CSS Object Model' => 'CSS',
@ -45,15 +47,19 @@ module Docs
'Stream API' => 'Media Streams',
'Streams' => 'Media Streams',
'Touch Events' => 'Touch Events',
'Visual Viewport' => 'Visual Viewport',
'Web Animations' => 'Animation',
'Web App Manifest' => 'Web App Manifest',
'Budget' => 'Budget',
'Web Authentication' => 'Authentication',
'Web Workers' => 'Web Workers',
'WebGL' => 'WebGL',
'WebRTC' => 'WebRTC',
'WebVR' => 'WebVR' }
TYPE_BY_NAME_STARTS_WITH = {
'AbortController' => 'Fetch',
'AbortSignal' => 'Fetch',
'Ambient' => 'Ambient Light',
'Attr' => 'Nodes',
'Audio' => 'Audio',
@ -61,6 +67,7 @@ module Docs
'Broadcast' => 'Broadcast Channel',
'Budget' => 'Budget',
'Canvas' => 'Canvas',
'Clipboard' => 'Clipboard',
'CSS' => 'CSS',
'CharacterData' => 'Nodes',
'ChildNode' => 'Nodes',
@ -69,6 +76,7 @@ module Docs
'CustomElement' => 'Custom Elements',
'DataTransfer' => 'Drag & Drop',
'document' => 'Document',
'Document Object' => 'DOM',
'DocumentFragment' => 'DocumentFragment',
'DocumentType' => 'Nodes',
'DOM' => 'DOM',
@ -105,6 +113,8 @@ module Docs
'screen' => 'Screen',
'Selection' => 'Selection',
'Shadow' => 'Shadow DOM',
'StaticRange' => 'Range',
'Streams' => 'Media Streams',
'StyleSheet' => 'CSS',
'Stylesheet' => 'CSS',
'SVG' => 'SVG',
@ -164,7 +174,6 @@ module Docs
CLEANUP_NAMES = %w(
CSS\ Object\ Model.
Document\ Object\ Model.
Tutorial.
XMLHttpRequest.
ANGLE\ instanced\ arrays.)
@ -172,6 +181,7 @@ module Docs
def get_name
name = super
CLEANUP_NAMES.each { |str| name.remove!(str) }
name.sub! %r{Document\ Object\ Model\.}i, 'Document Object Model: '
name.sub! 'Input.', 'HTMLInputElement.'
name.sub! 'window.navigator', 'navigator'
name.sub! 'API.', 'API: '

@ -4,7 +4,7 @@ module Docs
def call
css('.header-link', 'hr + .text-center', 'hr').remove
css('.grid', '.row', '.col-ms-12', 'ul.docs-list > ul.docs-list').each do |node|
css('.grid', '.row', '.col-ms-12', 'ul.docs-list > ul.docs-list', '.sub-section').each do |node|
node.before(node.children).remove
end
@ -16,18 +16,26 @@ module Docs
end
end
at_css('h2').name = 'h1' unless at_css('h1')
at_css('h2').name = 'h1' if !at_css('h1') && at_css('h2')
css('h3', 'h4', 'h5').each do |node|
node.name = node.name.sub(/\d/) { |i| i.to_i - 1 } unless node.name == 'h3' && node.at_css('code')
end if !at_css('h2') && at_css('h4')
css('h1 > a', 'h2 > a', 'h3 > a', 'h4 > a').each do |node|
node.before(node.children).remove
end
css('div.highlighter-rouge').each do |node|
node['data-language'] = node['class'][/language-(\w+)/, 1] if node['class']
node.content = node.content.strip
node.name = 'pre'
end
css('pre > code.hljs').each do |node|
node.parent['data-language'] = node['class'][/language-(\w+)/, 1]
end
css('.highlighter-rouge').remove_attr('class')
css('pre').each do |node|

@ -2,6 +2,8 @@ module Docs
class Electron
class EntriesFilter < Docs::EntriesFilter
def get_name
return 'API' if subpath == '/api'
name = at_css('h1, h2').content
name.remove! 'Class: '
name.remove! ' Object'
@ -12,11 +14,13 @@ module Docs
end
def get_type
if subpath.start_with?('tutorial') || slug.in?(%w(glossary/ faq/))
return 'API' if subpath == '/api'
if subpath.start_with?('/tutorial') || subpath.in?(%w(/glossary /faq))
'Guides'
elsif subpath.start_with?('development')
elsif subpath.start_with?('/development')
'Guides: Development'
elsif slug.in?(%w(api/synopsis/ api/chrome-command-line-switches/))
elsif subpath.in?(%w(/api/synopsis /api/chrome-command-line-switches))
'API'
elsif at_css('h1, h2').content.include?(' Object')
'API: Objects'
@ -26,7 +30,7 @@ module Docs
end
def additional_entries
return [] unless slug.start_with?('api/')
return [] unless subpath.start_with?('/api')
css('h3 > code', 'h4 > code').each_with_object [] do |node, entries|
next if node.previous.try(:content).present? || node.next.try(:content).present?
@ -37,10 +41,6 @@ module Docs
entries << [name, node.parent['id']] unless name == self.name
end
end
def include_default_entry?
slug != 'api/'
end
end
end
end

@ -0,0 +1,28 @@
module Docs
class Eslint
class CleanHtmlFilter < Filter
def call
@doc = at_css('.doc') if at_css('.doc')
css('.glyphicon').remove
css('hr', 'colgroup', 'td:empty').remove
css('.container').each do |node|
node.before(node.children).remove
end
css('div.highlighter-rouge').each do |node|
lang = node['class'][/language-(\w+)/, 1]
node['data-language'] = lang if lang
node.content = node.content.strip
node.name = 'pre'
node.remove_attribute('class')
end
css('code', 'p').remove_attr('class')
doc
end
end
end
end

@ -0,0 +1,25 @@
module Docs
class Eslint
class EntriesFilter < Docs::EntriesFilter
def get_name
name = at_css('h1').content.strip
if subpath.start_with?('rules/') && subpath != 'rules/'
name = name[/\(([\w\-]+?)\)\z/, 1] || name[/\A([\w\-]+?):/, 1]
end
name
end
def get_type
if subpath.include?('developer-guide')
'Developer Guide'
elsif subpath.include?('guide')
'Guide'
elsif subpath.start_with?('rules')
'Rules'
end
end
end
end
end

@ -45,10 +45,6 @@ module Docs
end
end
css('.__cf_email__').each do |node|
node.replace(decode_cloudflare_email(node['data-cfemail']))
end
css('.editor').each do |node|
pre = node.at_css('.editor-code > pre')
pre['data-language'] = 'javascript'

@ -6,6 +6,7 @@ module Docs
end
def get_type
return 'React' if slug.start_with?('react')
type = at_css('.guide-nav .nav-item').content.strip
type.remove! %r{ \(.*}
type

@ -0,0 +1,19 @@
module Docs
class Homebrew
class CleanHtmlFilter < Filter
def call
css('hr')
css('div.highlighter-rouge').each do |node|
lang = node['class'][/language-(\w+)/, 1]
node['data-language'] = lang if lang
node.content = node.content.strip
node.name = 'pre'
node.remove_attribute('class')
end
doc
end
end
end
end

@ -0,0 +1,32 @@
module Docs
class Homebrew
class EntriesFilter < Docs::EntriesFilter
def get_name
name = at_css('h1').content.strip
name.remove! %r{\(.*}
name
end
CONTRIBUTOR_SLUGS = %w(
How-To-Open-a-Homebrew-Pull-Request
Formula-Cookbook
Acceptable-Formulae
Versions
Node-for-Formula-Authors
Python-for-Formula-Authors
Migrating-A-Formula-To-A-Tap
Rename-A-Formula
How-to-Create-and-Maintain-a-Tap
Brew-Test-Bot
Prose-Style-Guidelines)
def get_type
if CONTRIBUTOR_SLUGS.include?(slug)
'Contributors'
else
'Users'
end
end
end
end
end

@ -2,7 +2,7 @@ module Docs
class Javascript
class EntriesFilter < Docs::EntriesFilter
TYPES = %w(Array ArrayBuffer Atomics Boolean DataView Date Function
Generator Intl JSON Map Math Number Object Promise Reflect RegExp
Generator Intl JSON Map Math Number Object PluralRules Promise Reflect RegExp
Set SharedArrayBuffer SIMD String Symbol TypedArray WeakMap WeakSet)
INTL_OBJECTS = %w(Collator DateTimeFormat NumberFormat)

@ -0,0 +1,43 @@
module Docs
class Jekyll
class CleanHtmlFilter < Filter
def call
@doc = at_css('article')
at_css('h1').content = 'Jekyll' if root_page?
css('.improve, .section-nav').remove
css('div.highlighter-rouge').each do |node|
pre = node.at_css('pre')
lang = node['class'][/language-(\w+)/, 1]
# HACK: Prism shell highlighting highlights `|`,
# which makes the tree on this page look terrible
unless slug.include?('structure') && lang == 'sh'
lang = 'bash' if lang == 'sh'
pre['data-language'] = lang
end
pre.remove_attribute('class')
pre.content = pre.content
node.replace(pre)
end
css('code').remove_attr('class')
css('.note').each do |node|
node.name = 'blockquote'
# <div class="note">...<br>...</div> -> <div class="note">...</div>
(node > 'br').each(&:remove)
# <div class="note">...<p>...<br><br>...</p>...</div> ->
# <div class="note">...<p>...<br>...</p>...</div>
node.css('br + br').each(&:remove)
end
doc
end
end
end
end

@ -0,0 +1,28 @@
module Docs
class Jekyll
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('h1').content
end
def get_type
if slug.include?('continuous-integration')
'Deployment'
else
nav_link = doc.document # document
.at_css('aside li.current') # item in navbar
if nav_link
nav_link
.parent # <ul> in navbar
.previous_element # header before <ul>
.content # category
else
'Miscellaneous'
end
end
end
end
end
end

@ -18,7 +18,7 @@ module Docs
end
css('pre').each do |node|
node['data-language'] = node['class'][/language-(\w+)/, 1]
node['data-language'] = node['class'][/language-(\w+)/, 1] if node['class']
node.content = node.content
end

@ -0,0 +1,26 @@
module Docs
class Jsdoc
class CleanHtmlFilter < Filter
def call
at_css('h1').content = 'JSDoc' if root_page?
css('.prettyprint').each do |node|
node.content = node.content
node['data-language'] = node['class'][/lang-(\w+)/, 1]
node.remove_attribute('class')
end
css('figcaption').each do |node|
node.name = 'div'
node['class'] = '_pre-heading'
end
css('figure').each do |node|
node.before(node.children).remove
end
doc
end
end
end
end

@ -0,0 +1,28 @@
module Docs
class Jsdoc
class EntriesFilter < Docs::EntriesFilter
def get_name
name = at_css('h1').content
name.prepend 'JSDoc: ' if !name.include?('@') && !name.include?('JSDoc')
name
end
def get_type
case slug
when /^about-/
'Getting Started'
when /^plugins-/
'Plugins'
when /^howto-/
'Examples'
when /^tags-inline-/
'Inline Tags'
when /^tags-/
'Tags'
else
'Miscellaneous' # Only shown if a new category gets added in the upstream docs
end
end
end
end
end

@ -8,10 +8,6 @@ module Docs
other
end
css('a.__cf_email__').each do |node|
node.replace(decode_cloudflare_email(node['data-cfemail']))
end
# Remove code highlighting
css('pre').each do |node|
node.content = node.content

@ -30,6 +30,10 @@ module Docs
node['data-language'] = 'nginx'
end
css('code code').each do |node|
node.before(node.children).remove
end
doc
end
end

@ -20,7 +20,7 @@ module Docs
def additional_entries
css('h1 + ul a').each_with_object [] do |node, entries|
name = node.content.strip
next if name =~ /\A[A-Z]/
next if name =~ /\A[A-Z]/ || name.start_with?('/')
id = node['href'].remove('#')
next if id.blank?

@ -22,10 +22,6 @@ module Docs
node.content = node.content
end
css('.__cf_email__').each do |node|
node.replace(decode_cloudflare_email(node['data-cfemail']))
end
doc
end
end

@ -9,7 +9,7 @@ module Docs
css('meta', '.colophon').remove
end
css('a.deep-link[id]').each do |node|
css('a.deep-link[id]', 'a.anchor[id]').each do |node|
node.parent['id'] = node['id']
node.remove
end

@ -28,11 +28,11 @@ module Docs
when 'files/package.json'
css('#page > h2').each_with_object [] do |node, entries|
next if node.content =~ /\A[A-Z]/
entries << ["package.json: #{node.content}", node.at_css('.deep-link')['id']]
entries << ["package.json: #{node.content}", node.at_css('.anchor')['id']]
end
when 'misc/config'
css('h2:contains("Config Settings") ~ h3').map do |node|
["config: #{node.content}", node.at_css('.deep-link')['id']]
["config: #{node.content}", node.at_css('.anchor')['id']]
end
else
[]

@ -13,18 +13,22 @@ module Docs
def other
@doc = at_css('#docContent')
css('.NAVHEADER', 'hr', '.NAVFOOTER a[accesskey="H"]').remove
css('.navheader', 'hr', '.navfooter a[accesskey="H"]').remove
unless at_css('h1')
at_css('.refnamediv h2, .titlepage h2').name = 'h1'
end
css('a[name]').each do |node|
node.parent['id'] = node['name']
node.before(node.children).remove
end
css('div.SECT1', 'pre > kbd', 'tt > code', 'h1 > tt', '> .CHAPTER', 'div.NOTE', '.APPENDIX').each do |node|
css('div.sect1', '.refentry', '.refnamediv', '.refentrytitle', '.refsynopsisdiv', 'pre > kbd', 'tt > code', 'h1 > tt', '> .chapter', '.appendix', '.titlepage', 'div:not([class]):not([id])', 'br', 'a.indexterm', 'acronym', '.productname', 'div.itemizedlist', 'span.sect2', 'span.application', 'em.replaceable', 'span.term').each do |node|
node.before(node.children).remove
end
css('div.CAUTION table.CAUTION').each do |node|
css('div.caution table.caution').each do |node|
parent = node.parent
title = node.at_css('.c2, .c3, .c4, .c5').content
node.replace(node.css('p'))
@ -43,11 +47,27 @@ module Docs
node.remove_attribute 'valign'
end
css('.sect2 > h3').each do |node|
node.name = 'h2'
end
css('.sect3 > h4').each do |node|
node.name = 'h3'
end
css('tt').each do |node|
node.name = 'code'
end
css('.REFSYNOPSISDIV > p').each do |node|
css('div.note', 'div.important', 'div.tip', 'div.caution').each do |node|
if node.at_css('blockquote')
node.before(node.children).remove
else
node.name = 'blockquote'
end
end
css('.refsynopsisdiv > p').each do |node|
node.name = 'pre'
node.content = node.content
end
@ -56,9 +76,18 @@ module Docs
node.before(node.children).remove
end
css('pre.SYNOPSIS', 'pre.PROGRAMLISTING').each do |node|
css('code').each do |node|
node.inner_html = node.inner_html.gsub(/\s*\n\s*/, ' ')
end
css('pre.synopsis', 'pre.programlisting').each do |node|
node['data-language'] = 'sql'
end
css('h1', 'ul', 'li', 'pre').each do |node|
node.remove_attribute 'class'
node.remove_attribute 'style'
end
end
end
end

@ -90,33 +90,33 @@ module Docs
return config_additional_entries if type && type.include?('Configuration')
return data_types_additional_entries if type == 'Data Types'
return command_additional_entries if type == 'Commands'
return get_heading_entries('h3[id]') if slug == 'functions-xml'
return get_heading_entries('h3[id], .sect3[id] > h3:first-child') if slug == 'functions-xml'
entries = get_heading_entries('h2[id]')
entries = get_heading_entries('h2[id], .sect2[id] > h2:first-child')
case slug
when 'queries-union'
entries.concat get_custom_entries('p > .LITERAL:first-child')
entries.concat get_custom_entries('p > .literal:first-child')
when 'queries-table-expressions'
entries.concat get_heading_entries('h3[id]')
entries.concat get_custom_entries('dt > .LITERAL:first-child')
entries.concat get_heading_entries('h3[id], .sect3[id] > h3:first-child')
entries.concat get_custom_entries('dt > .literal:first-child')
when 'functions-logical'
entries.concat get_custom_entries('> table td:first-child > code')
when 'functions-formatting'
entries.concat get_custom_entries('#FUNCTIONS-FORMATTING-TABLE td:first-child > code')
when 'functions-admin'
entries.concat get_custom_entries('.TABLE td:first-child > code')
entries.concat get_custom_entries('.table td:first-child > code')
when 'functions-string'
entries.concat get_custom_entries('> div[id^="FUNC"] td:first-child > code')
entries.concat get_custom_entries('> div[id^="FORMAT"] td:first-child > code')
else
if type && type.start_with?('Functions')
entries.concat get_custom_entries('> .TABLE td:first-child > code.LITERAL:first-child')
entries.concat get_custom_entries('> .TABLE td:first-child > code.FUNCTION:first-child')
entries.concat get_custom_entries('> .TABLE td:first-child > code:not(.LITERAL):first-child + code.LITERAL')
entries.concat get_custom_entries('> .TABLE td:first-child > p > code.LITERAL:first-child')
entries.concat get_custom_entries('> .TABLE td:first-child > p > code.FUNCTION:first-child')
entries.concat get_custom_entries('> .TABLE td:first-child > p > code:not(.LITERAL):first-child + code.LITERAL')
entries.concat get_custom_entries('> .table td:first-child > code.literal:first-child')
entries.concat get_custom_entries('> .table td:first-child > code.function:first-child')
entries.concat get_custom_entries('> .table td:first-child > code:not(.literal):first-child + code.literal')
entries.concat get_custom_entries('> .table td:first-child > p > code.literal:first-child')
entries.concat get_custom_entries('> .table td:first-child > p > code.function:first-child')
entries.concat get_custom_entries('> .table td:first-child > p > code:not(.literal):first-child + code.literal')
if slug == 'functions-comparison' && !at_css('#FUNCTIONS-COMPARISON-PRED-TABLE') # before 9.6
entries.concat %w(IS NULL BETWEEN DISTINCT\ FROM).map { |name| ["#{self.name}: #{name}"] }
end
@ -127,8 +127,8 @@ module Docs
end
def config_additional_entries
css('.VARIABLELIST dt[id]').map do |node|
name = node.at_css('.VARNAME').content
css('.variablelist dt[id]').map do |node|
name = node.at_css('.varname').content
["Config: #{name}", node['id']]
end
end
@ -136,27 +136,27 @@ module Docs
def data_types_additional_entries
selector = case slug
when 'rangetypes'
'li > p > .TYPE:first-child'
'li > p > .type:first-child'
when 'datatype-textsearch'
'.SECT2 > .TYPE'
'.title > .type, .sect2 > .type'
else
'.CALSTABLE td:first-child > .TYPE'
'.table-contents td:first-child > .type, .calstable td:first-child > .type'
end
get_custom_entries(selector)
end
def command_additional_entries
css('.REFSECT2[id^="SQL"]').each_with_object([]) do |node, entries|
css('.refsect2[id^="SQL"]').each_with_object([]) do |node, entries|
next unless heading = node.at_css('h3')
next unless heading.content.strip =~ /[A-Z_\-]+ Clause/
name = heading.at_css('.LITERAL').content
name = heading.at_css('.literal').content
name.prepend "#{self.name} ... "
entries << [name, node['id']]
end
end
def include_default_entry?
!initial_page? && !at_css('.TOC') && type
!initial_page? && (!at_css('.toc') || at_css('.sect2, .variablelist, .refsect1')) && type
end
SKIP_ENTRIES_SLUGS = [
@ -199,7 +199,9 @@ module Docs
css(selector).each_with_object([]) do |node, entries|
name = node.content
clean_heading_name(name)
entries << ["#{additional_entry_prefix}: #{name}", node['id']] unless skip_heading?(name)
id = node['id'] || node.parent['id']
raise "missing ids for selector #{selector}" unless id
entries << ["#{additional_entry_prefix}: #{name}", id] unless skip_heading?(name)
end
end

@ -8,13 +8,14 @@ module Docs
end
def extract_up_path
if node = at_css('.NAVHEADER a[accesskey="U"]')
if node = at_css('.navheader a[accesskey="u"], .navheader a[accesskey="U"]')
result[:pg_up_path] = node['href']
end
end
def extract_chapter
return unless text = at_css('.NAVHEADER td[align="center"]').content
css('.navheader td[align="center"], .navheader th[align="center"]').each do |node|
text = node.content.strip
if match = text.match(/\AChapter (\d+)\. (.+)\z/)
result[:pg_chapter] = match[1].to_i
result[:pg_chapter_name] = match[2].strip
@ -26,3 +27,4 @@ module Docs
end
end
end
end

@ -0,0 +1,13 @@
module Docs
class Postgresql
class NormalizeClassNamesFilter < Filter
def call
doc.css('*').each do |node|
node['class'] = node['class'].downcase if node['class'].present?
end
doc
end
end
end
end

@ -7,6 +7,7 @@ module Docs
def get_type
link = at_css("nav a[href='#{result[:path].split('/').last}']")
return 'Miscellaneous' unless link
link.ancestors('ul').last.previous_element.content
end

@ -27,6 +27,7 @@ module Docs
type = at_css('dt > .descclassname').content.strip
type.remove! 'sklearn.'
type.remove! %r{\.\z}
type = 'sklearn' if type.blank?
type
elsif subpath.start_with?('tutorial')
'Tutorials'

@ -29,6 +29,7 @@ module Docs
if node.name == 'h2'
h2 = node['id']
elsif h2 == 'available-settings' && (code = node.at_css('code')) && (name = code.content) && name.start_with?('config.')
name.sub! %r{\s+=.*}, '='
id = code.parent['id'] = name.parameterize
entries << [name, id, 'Config']
end

@ -9,10 +9,6 @@ module Docs
css('.demo', '.guide-links', '.footer', '#ad').remove
css('.__cf_email__').each do |node|
node.replace(decode_cloudflare_email(node['data-cfemail']))
end
# Remove code highlighting
css('figure').each do |node|
node.name = 'pre'

@ -26,9 +26,9 @@ module Docs
next if node.previous.try(:content).present?
entries << [node.content, node.parent['id']]
end
elsif slug.start_with?('api') && slug != 'api/plugins/parser'
elsif slug.start_with?('api') && slug != 'api/parser'
css('.header[id] code').each_with_object [] do |node, entries|
next if node.previous.try(:content).present?
next if node.previous.try(:content).present? || node.next.try(:content).present?
name = node.content.sub(/\(.*\)/, '()')
name.prepend "#{self.name.split(':').first}: "
entries << [name, node.parent['id']]

@ -43,10 +43,6 @@ module Docs
end
end
css('.__cf_email__').each do |node|
node.replace(decode_cloudflare_email(node['data-cfemail']))
end
css('div.highlighter-rouge').each do |node|
node['data-language'] = node['class'][/language-(\w+)/, 1] if node['class']
node.content = node.content.strip

@ -11,33 +11,17 @@ module Docs
options[:max_image_size] = 256_000
options[:attribution] = <<-HTML
&copy; 2010&ndash;2017 Google, Inc.<br>
&copy; 2010&ndash;2018 Google, Inc.<br>
Licensed under the Creative Commons Attribution License 4.0.
HTML
version do
self.release = '4.4.4'
self.base_url = 'https://angular.io/'
self.root_path = 'docs'
html_filters.push 'angular/clean_html', 'angular/entries'
options[:follow_links] = false
options[:only_patterns] = [/\Aguide/, /\Atutorial/, /\Aapi/]
options[:fix_urls_before_parse] = ->(url) do
url.sub! %r{\Aguide/}, '/guide/'
url.sub! %r{\Atutorial/}, '/tutorial/'
url.sub! %r{\Aapi/}, '/api/'
url.sub! %r{\Agenerated/}, '/generated/'
url
end
module Common
private
def initial_urls
initial_urls = []
Request.run 'https://angular.io/generated/navigation.json' do |response|
Request.run "#{self.class.base_url}generated/navigation.json" do |response|
data = JSON.parse(response.body)
dig = ->(entry) do
initial_urls << url_for("generated/docs/#{entry['url']}.json") if entry['url'] && entry['url'] != 'api'
@ -46,7 +30,7 @@ module Docs
data['SideNav'].each(&dig)
end
Request.run 'https://angular.io/generated/docs/api/api-list.json' do |response|
Request.run "#{self.class.base_url}generated/docs/api/api-list.json" do |response|
data = JSON.parse(response.body)
dig = ->(entry) do
initial_urls << url_for("generated/docs/#{entry['path']}.json") if entry['path']
@ -61,7 +45,11 @@ module Docs
def handle_response(response)
if response.mime_type.include?('json')
begin
response.options[:response_body] = JSON.parse(response.body)['contents']
rescue JSON::ParserError
response.options[:response_body] = ''
end
response.headers['Content-Type'] = 'text/html'
response.url.path = response.url.path.sub('/generated/docs/', '/').remove('.json')
response.effective_url.path = response.effective_url.path.sub('/generated/docs/', '/').remove('.json')
@ -70,6 +58,46 @@ module Docs
end
end
version do
self.release = '5.2.9'
self.base_url = 'https://angular.io/'
self.root_path = 'docs'
html_filters.push 'angular/clean_html', 'angular/entries'
options[:follow_links] = false
options[:only_patterns] = [/\Aguide/, /\Atutorial/, /\Aapi/]
options[:fix_urls_before_parse] = ->(url) do
url.sub! %r{\Aguide/}, '/guide/'
url.sub! %r{\Atutorial/}, '/tutorial/'
url.sub! %r{\Aapi/}, '/api/'
url.sub! %r{\Agenerated/}, '/generated/'
url
end
include Docs::Angular::Common
end
version '4' do
self.release = '4.4.6'
self.base_url = 'https://v4.angular.io/'
self.root_path = 'docs'
html_filters.push 'angular/clean_html', 'angular/entries'
options[:follow_links] = false
options[:only_patterns] = [/\Aguide/, /\Atutorial/, /\Aapi/]
options[:fix_urls_before_parse] = ->(url) do
url.sub! %r{\Aguide/}, '/guide/'
url.sub! %r{\Atutorial/}, '/tutorial/'
url.sub! %r{\Aapi/}, '/api/'
url.sub! %r{\Agenerated/}, '/generated/'
url
end
include Docs::Angular::Common
end
version '2' do
self.release = '2.4.10'
self.base_url = 'https://v2.angular.io/docs/ts/latest/'

@ -46,7 +46,7 @@ module Docs
end
version '1.6' do
self.release = '1.6.5'
self.release = '1.6.6'
self.base_url = "https://code.angularjs.org/#{release}/docs/partials/"
end

@ -2,14 +2,12 @@ module Docs
class Ansible < UrlScraper
self.name = 'Ansible'
self.type = 'sphinx'
self.release = '2.4.0'
self.base_url = 'https://docs.ansible.com/ansible/latest/'
self.links = {
home: 'https://www.ansible.com/',
code: 'https://github.com/ansible/ansible'
}
html_filters.push 'ansible/entries', 'ansible/clean_html', 'sphinx/clean_html'
html_filters.push 'ansible/entries', 'sphinx/clean_html'
options[:skip] = %w(
glossary.html
@ -20,9 +18,14 @@ module Docs
list_of_all_modules.html)
options[:attribution] = <<-HTML
&copy; 2012&ndash;2017 Michael DeHaan<br>
&copy; 2017 Red Hat, Inc.<br>
&copy; 2012&ndash;2018 Michael DeHaan<br>
&copy; 2018 Red Hat, Inc.<br>
Licensed under the GNU General Public License version 3.
HTML
version '2.4' do
self.release = '2.4.3'
self.base_url = 'https://docs.ansible.com/ansible/2.4/'
end
end
end

@ -3,7 +3,7 @@ module Docs
self.name = 'Apache HTTP Server'
self.slug = 'apache_http_server'
self.type = 'apache'
self.release = '2.4.27'
self.release = '2.4.33'
self.base_url = 'https://httpd.apache.org/docs/2.4/en/'
self.links = {
home: 'https://httpd.apache.org/'
@ -30,7 +30,7 @@ module Docs
/\Adeveloper\// ]
options[:attribution] = <<-HTML
&copy; 2017 The Apache Software Foundation<br>
&copy; 2018 The Apache Software Foundation<br>
Licensed under the Apache License, Version 2.0.
HTML
end

@ -1,7 +1,7 @@
module Docs
class Async < UrlScraper
self.type = 'async'
self.release = '2.5.0'
self.release = '2.6.0'
self.base_url = 'https://caolan.github.io/async/'
self.root_path = 'docs.html'
self.links = {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save