Fix merge conflict

pull/705/head
Jasper van Merle 6 years ago
commit 74323fda3e

@ -0,0 +1,11 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

@ -24,20 +24,18 @@ 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](../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).
## Requesting new documentations
Please don't open issues to request new documentations.
Please don't open issues to request new documentations.
Use the [Trello board](https://trello.com/b/6BmTulfx/devdocs-documentation) where everyone can vote.
## Contributing code and features
1. Search for existing issues; someone may already be working on a similar feature.
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.
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.
3. Follow the [coding conventions](#coding-conventions).
4. If you're modifying the Ruby code, include tests and ensure they pass.
5. Try to keep your pull request small and simple.
@ -46,7 +44,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 [`docs` folder](https://github.com/freeCodeCamp/devdocs/tree/master/docs) 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.
@ -57,20 +55,12 @@ In addition to the [guidelines for contributing code](#contributing-code-and-fea
* Remove as much content and HTML markup as possible, particularly content not associated with any entry (e.g. introduction, changelog, etc.).
* Names must be as short as possible and unique across the documentation.
* The number of types (categories) should ideally be less than 100.
* Don't modify the icon sprite. I'll do it after your pull request is merged.
## Updating existing documentations
Please don't submit a pull request updating the version number of a documentation, unless a change is required in the scraper and you've verified that it works.
To ask that an existing documentation be updated, please use the [Trello board](https://trello.com/c/2B0hmW7M/52-request-updates-here).
## Other contributions
Besides new docs and features, here are other ways you can contribute:
* **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.
* **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).
To ask that an existing documentation be updated, first check the last two [documentation versions reports](https://github.com/freeCodeCamp/devdocs/issues?utf8=%E2%9C%93&q=Documentation+versions+report+is%3Aissue+author%3Adevdocs-bot+sort%3Acreated-desc). Only create an issue if the documentation has been wrongly marked as up-to-date.
## Coding conventions
@ -80,4 +70,4 @@ Besides new docs and features, here are other ways you can contribute:
## Questions?
If you have any questions, please feel free to ask on the [mailing list](https://groups.google.com/d/forum/devdocs).
If you have any questions, please feel free to ask them on the contributor chat room on [Gitter](https://gitter.im/FreeCodeCamp/DevDocs).

@ -0,0 +1,7 @@
<!--
Please read the contributing guidelines before opening an issue:
https://github.com/freeCodeCamp/devdocs/blob/master/.github/CONTRIBUTING.md
Go here to request a new documentation:
https://trello.com/b/6BmTulfx/devdocs-documentation
-->

@ -0,0 +1,8 @@
daysUntilClose: 30
responseRequiredLabel: needs-info
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author. With only the
information thats currently in the issue, we dont have enough information
to take action. Please comment if you have or find the answer we need so we
can investigate further.

7
.gitignore vendored

@ -1,10 +1,9 @@
.DS_Store
.bundle
*.pxm
*.sketch
log
tmp
public/assets
public/fonts
public/docs/**/*
!public/docs/docs.json
!public/docs/**/index.json
docs/**/*
!docs/*.md

@ -1 +1 @@
2.4.2
2.6.3

@ -0,0 +1 @@
test

@ -1 +1,26 @@
language: ruby
addons:
apt:
packages:
- libcurl4-openssl-dev
cache: bundler
before_install:
- "echo 'gem: --no-document' > ~/.gemrc"
- gem update --system
- gem install bundler
script:
- if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then bundle exec rake; fi
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then bundle exec thor updates:check --github-token $GH_TOKEN --upload; fi
deploy:
provider: heroku
app: devdocs
on:
branch: master
condition: $TRAVIS_EVENT_TYPE != cron
api_key:
secure: "4p1klvWJZSOImzFcKOduILjP93hlOlAhceWlYMKS4tU+TCFE8qTBzdKdFPSCsCgjB+YR9pBss+L0lJpVVMjSwFHXqpKe6EeUSltO2k7DFHfW7kXLUM/L0AfqXz+YXk76XUyZMhvOEbldPfaMaj10e8vgDOQCSHABDyK/4CU+hnI="

@ -0,0 +1,2 @@
> Our Code of Conduct is available here: <https://code-of-conduct.freecodecamp.org/>

@ -1,13 +1,13 @@
Copyright 2013-2017 Thibaut Courouble and other contributors
Copyright 2013-2019 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
file, You can obtain one at http://mozilla.org/MPL/2.0/.
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.
derived from this software without the maintainers' permission, except
as may be necessary to comply with the notice/attribution requirements.
I also wish that any documentation file generated using this software
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.

@ -1,9 +1,12 @@
FROM ruby:2.4.2
FROM ruby:2.6.3
ENV LANG=C.UTF-8
ENV ENABLE_SERVICE_WORKER=true
WORKDIR /devdocs
RUN apt-get update && \
apt-get -y install git nodejs && \
apt-get -y install git nodejs libcurl4 && \
gem install bundler && \
rm -rf /var/lib/apt/lists/*

@ -1,10 +1,13 @@
FROM ruby:2.4.2-alpine
FROM ruby:2.6.3-alpine
ENV LANG=C.UTF-8
ENV ENABLE_SERVICE_WORKER=true
WORKDIR /devdocs
COPY . /devdocs
RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev && \
RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev libcurl && \
gem install bundler && \
bundle install --system --without test && \
thor docs:download --all && \

@ -1,16 +1,20 @@
source 'https://rubygems.org'
ruby '2.4.2'
ruby '2.6.3'
gem 'rake'
gem 'thor'
gem 'pry', '~> 0.11.0'
gem 'activesupport', '~> 5.1', require: false
gem 'pry', '~> 0.12.0'
gem 'activesupport', '~> 5.2', require: false
gem 'yajl-ruby', require: false
gem 'html-pipeline'
gem 'typhoeus'
gem 'nokogiri'
group :app do
gem 'rack'
gem 'sinatra'
gem 'sinatra-contrib'
gem 'rack-ssl-enforcer'
gem 'thin'
gem 'sprockets'
gem 'sprockets-helpers'
@ -18,10 +22,13 @@ group :app do
gem 'browser'
gem 'sass'
gem 'coffee-script'
gem 'chunky_png'
gem 'sprockets-sass'
end
group :production do
gem 'uglifier'
gem 'newrelic_rpm'
end
group :development do
@ -29,14 +36,13 @@ group :development do
end
group :docs do
gem 'typhoeus'
gem 'nokogiri'
gem 'html-pipeline'
gem 'image_optim'
gem 'image_optim_pack', platforms: :ruby
gem 'progress_bar', require: false
gem 'unix_utils', require: false
gem 'tty-pager', require: false
gem 'net-sftp', '>= 2.1.3.rc2', require: false
gem 'terminal-table', require: false
end
group :test do

@ -1,139 +1,156 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.1.4)
activesupport (5.2.3)
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.15.0)
better_errors (2.5.1)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
browser (2.5.1)
browser (2.6.1)
chunky_png (1.3.11)
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)
concurrent-ruby (1.1.5)
daemons (1.3.1)
erubi (1.8.0)
ethon (0.12.0)
ffi (>= 1.3.0)
eventmachine (1.2.5)
eventmachine (1.2.7)
execjs (2.7.0)
exifr (1.3.2)
ffi (1.9.18)
fspath (3.1.0)
highline (1.7.8)
html-pipeline (2.7.1)
exifr (1.3.6)
ffi (1.11.1)
fspath (3.1.2)
highline (2.0.2)
html-pipeline (2.11.1)
activesupport (>= 2)
nokogiri (>= 1.4)
i18n (0.8.6)
image_optim (0.25.0)
i18n (1.6.0)
concurrent-ruby (~> 1.0)
image_optim (0.26.5)
exifr (~> 1.2, >= 1.2.2)
fspath (~> 3.0)
image_size (~> 1.5)
image_size (>= 1.5, < 3)
in_threads (~> 1.3)
progress (~> 3.0, >= 3.0.1)
image_optim_pack (0.5.0.20171001)
image_optim_pack (0.5.6)
fspath (>= 2.1, < 4)
image_optim (~> 0.19)
image_size (1.5.0)
in_threads (1.4.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)
mini_portile2 (~> 2.3.0)
image_size (2.0.2)
in_threads (1.5.3)
method_source (0.9.2)
mini_portile2 (2.4.0)
minitest (5.11.3)
multi_json (1.13.1)
mustermann (1.0.3)
net-sftp (3.0.0.beta1)
net-ssh (>= 5.0.0, < 6.0.0)
net-ssh (5.2.0)
newrelic_rpm (6.5.0.357)
nokogiri (1.10.3)
mini_portile2 (~> 2.4.0)
options (2.3.2)
progress (3.3.1)
progress_bar (1.1.0)
highline (~> 1.6)
progress (3.5.2)
progress_bar (1.3.0)
highline (>= 1.6, < 3)
options (~> 2.3.0)
pry (0.11.1)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
rack (2.0.3)
rack-protection (2.0.0)
rack (2.0.7)
rack-protection (2.0.5)
rack
rack-test (0.7.0)
rack-ssl-enforcer (0.2.9)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rake (12.1.0)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rake (12.3.2)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rr (1.2.1)
sass (3.5.2)
sass (3.7.4)
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.5)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.0)
rack-protection (= 2.0.5)
tilt (~> 2.0)
sinatra-contrib (2.0.0)
backports (>= 2.0)
sinatra-contrib (2.0.5)
backports (>= 2.8.2)
multi_json
mustermann (~> 1.0)
rack-protection (= 2.0.0)
sinatra (= 2.0.0)
rack-protection (= 2.0.5)
sinatra (= 2.0.5)
tilt (>= 1.3, < 3)
sprockets (3.7.1)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-helpers (1.2.1)
sprockets (>= 2.2)
sprockets-sass (2.0.0.beta2)
sprockets (>= 2.0, < 4.0)
strings (0.1.5)
strings-ansi (~> 0.1)
unicode-display_width (~> 1.5)
unicode_utils (~> 1.4)
strings-ansi (0.1.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thin (1.7.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (0.20.0)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.8)
tty-pager (0.9.0)
tty-screen (~> 0.5.0)
tty-which (~> 0.3.0)
verse (~> 0.5.0)
tty-screen (0.5.0)
tty-which (0.3.0)
typhoeus (1.3.0)
tilt (2.0.9)
tty-pager (0.12.1)
strings (~> 0.1.4)
tty-screen (~> 0.6)
tty-which (~> 0.4)
tty-screen (0.7.0)
tty-which (0.4.1)
typhoeus (1.3.1)
ethon (>= 0.9.0)
tzinfo (1.2.3)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (3.2.0)
uglifier (4.1.20)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.1.3)
unicode-display_width (1.6.0)
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.1)
PLATFORMS
ruby
DEPENDENCIES
activesupport (~> 5.1)
activesupport (~> 5.2)
better_errors
browser
chunky_png
coffee-script
erubi
html-pipeline
image_optim
image_optim_pack
minitest
net-sftp (>= 2.1.3.rc2)
newrelic_rpm
nokogiri
progress_bar
pry (~> 0.11.0)
pry (~> 0.12.0)
rack
rack-ssl-enforcer
rack-test
rake
rr
@ -142,6 +159,8 @@ DEPENDENCIES
sinatra-contrib
sprockets
sprockets-helpers
sprockets-sass
terminal-table
thin
thor
tty-pager
@ -151,7 +170,7 @@ DEPENDENCIES
yajl-ruby
RUBY VERSION
ruby 2.4.2p198
ruby 2.6.3p62
BUNDLED WITH
1.15.4
2.0.2

@ -1,7 +0,0 @@
<!--
Please read the contributing guidelines before opening an issue:
https://github.com/Thibaut/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,11 @@
If youre adding a new scraper, please ensure that you have:
- [ ] Tested the scraper on a local copy of DevDocs
- [ ] Ensured that the docs are styled similarly to other docs on DevDocs
<!-- If the docs dont have an icon, delete the next four items: -->
- [ ] Added these files to the <code>public/icons/*your_scraper_name*/</code> directory:
- [ ] `16.png`: a 16×16 pixel icon for the doc
- [ ] `16@2x.png`: a 32×32 pixel icon for the doc
- [ ] `SOURCE`: A text file containing the URL to the page the image can be found on or the URL of the original image itself
<!-- Replace the `[ ]` with a `[x]` once youve completed each step. -->

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

@ -1,29 +1,27 @@
# [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) — API Documentation Browser [![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.
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.
* Created by [Thibaut Courouble](https://thibaut.me)
DevDocs was created by [Thibaut Courouble](https://thibaut.me) and is operated by [freeCodeCamp](https://www.freecodecamp.org).
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)
**Table of Contents:** [Quick Start](#quick-start) · [Vision](#vision) · [App](#app) · [Scraper](#scraper) · [Commands](#available-commands) · [Contributing](#contributing) · [Documentation](#documentation) · [Plugins and Extensions](#plugins-and-extensions) · [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, we 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.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:
```
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 +32,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)
@ -61,18 +59,14 @@ The web app is all client-side JavaScript, written in [CoffeeScript](http://coff
Many of the code's design decisions were driven by the fact that the app uses XHR to load content directly into the main frame. This includes stripping the original documents of most of their HTML markup (e.g. scripts and stylesheets) to avoid polluting the main frame, and prefixing all CSS class names with an underscore to prevent conflicts.
Another driving factor is performance and the fact that everything happens in the browser. `applicationCache` (which comes with its own set of constraints) and `localStorage` are used to speed up the boot time, while memory consumption is kept in check by allowing the user to pick his/her own set of documentations. The search algorithm is kept simple because it needs to be fast even searching through 100,000 strings.
Another driving factor is performance and the fact that everything happens in the browser. A service worker (which comes with its own set of constraints) and `localStorage` are used to speed up the boot time, while memory consumption is kept in check by allowing the user to pick his/her own set of documentations. The search algorithm is kept simple because it needs to be fast even searching through 100,000 strings.
DevDocs being a developer tool, the browser requirements are high:
1. On the desktop:
* Recent version of Chrome, Firefox, or Opera
* Safari 8+
* IE / Edge 10+
2. On mobile:
* iOS 8+
* Android 4.1+
* Windows Phone 8+
* Recent versions of Firefox, Chrome, or Opera
* Safari 11.1+
* Edge 17+
* iOS 11.3+
This allows the code to take advantage of the latest DOM and HTML5 APIs and make developing DevDocs a lot more fun!
@ -89,12 +83,13 @@ Modifications made to each document include:
* replacing all external (not scraped) URLs with their fully qualified counterpart
* replacing all internal (scraped) URLs with their unqualified and relative counterpart
* adding content, such as a title and link to the original document
* ensuring correct syntax highlighting using [Prism](http://prismjs.com/)
These modifications are applied via a set of filters using the [HTML::Pipeline](https://github.com/jch/html-pipeline) library. Each scraper includes filters specific to itself, one of which is tasked with figuring out the pages' metadata.
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](./docs/scraper-reference.md) and [filters](./docs/filter-reference.md) is available in the `docs` folder.
## Available Commands
@ -134,20 +129,45 @@ 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).
DevDocs's own documentation is available on the [wiki](https://github.com/Thibaut/devdocs/wiki).
Contributions are welcome. Please read the [contributing guidelines](./.github/CONTRIBUTING.md).
## Documentation
* [Adding documentations to DevDocs](./docs/adding-docs.md)
* [Scraper Reference](./docs/scraper-reference.md)
* [Filter Reference](./docs/filter-reference.md)
* [Maintainers Guide](./docs/maintainers.md)
## Plugins and Extensions
* [Chrome web app](https://chrome.google.com/webstore/detail/devdocs/mnfehgbmkapmjnhcnbodoamcioleeooe)
* [Ubuntu Touch app](https://uappexplorer.com/app/devdocsunofficial.berkes)
* [Sublime Text plugin](https://sublime.wbond.net/packages/DevDocs)
* [Atom plugin](https://atom.io/packages/devdocs)
* [Brackets extension](https://github.com/gruehle/dev-docs-viewer)
* [Fluid](http://fluidapp.com) for turning DevDocs into a real OS X app
* [GTK shell / Vim integration](https://github.com/naquad/devdocs-shell)
* [Emacs lookup](https://github.com/skeeto/devdocs-lookup)
* [Alfred Workflow](https://github.com/yannickglt/alfred-devdocs)
* [Vim search plugin with Devdocs in its defaults](https://github.com/waiting-for-dev/vim-www) Just set `let g:www_shortcut_engines = { 'devdocs': ['Devdocs', '<leader>dd'] }` to have a `:Devdocs` command and a `<leader>dd` mapping.
* [Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=akfish.vscode-devdocs ) (1)
* [Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=deibit.devdocs) (2)
* [Desktop application](https://github.com/egoist/devdocs-desktop)
* [Doc Browser](https://github.com/qwfy/doc-browser) is a native Linux app that supports DevDocs docsets
* [GNOME Application](https://github.com/hardpixel/devdocs-desktop) GTK3 application with search integrated in headerbar
* [macOS Application](https://github.com/dteoh/devdocs-macos)
* [Android Application](https://github.com/Merith-TK/devdocs_webapp_kotlin) is a fully working, advanced WebView
## Copyright / License
Copyright 2013-2017 Thibaut Courouble and [other contributors](https://github.com/Thibaut/devdocs/graphs/contributors)
Copyright 2013-2019 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](./COPYRIGHT) and [LICENSE](./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.
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.
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!
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!
## Questions?
If you have any questions, please feel free to ask them on the [mailing list](https://groups.google.com/d/forum/devdocs).
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 @@
require 'bundler/setup'
require 'thor'
Bundler.require :default
$LOAD_PATH.unshift 'lib'
task :default do
@ -13,6 +14,9 @@ end
namespace :assets do
desc 'Compile all assets'
task :precompile do
load 'tasks/docs.thor'
DocsCLI.new.prepare_deploy
load 'tasks/assets.thor'
AssetsCLI.new.compile
end

@ -0,0 +1 @@
sprites/**/*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

@ -13,10 +13,12 @@
@el = $('._app')
@localStorage = new LocalStorageStore
@appCache = new app.AppCache if app.AppCache.isEnabled()
@serviceWorker = new app.ServiceWorker if app.ServiceWorker.isEnabled()
@settings = new app.Settings
@db = new app.DB()
@settings.initLayout()
@docs = new app.collections.Docs
@disabledDocs = new app.collections.Docs
@entries = new app.collections.Entries
@ -76,7 +78,7 @@
.install()
@previousErrorHandler = onerror
window.onerror = @onWindowError.bind(@)
CookieStore.onBlocked = @onCookieBlocked
CookiesStore.onBlocked = @onCookieBlocked
return
bootOne: ->
@ -138,7 +140,10 @@
@docs.sort()
@initDoc(doc)
@saveDocs()
_onSuccess()
if app.settings.get('autoInstall')
doc.install(_onSuccess, onError)
else
_onSuccess()
return
doc.load onSuccess, onError, writeCache: true
@ -147,7 +152,7 @@
saveDocs: ->
@settings.setDocs(doc.slug for doc in @docs.all())
@db.migrate()
@appCache?.updateInBackground()
@serviceWorker?.updateInBackground()
welcomeBack: ->
visitCount = @settings.get('count')
@ -157,17 +162,24 @@
new app.views.Updates()
@updateChecker = new app.UpdateChecker()
reboot: ->
if location.pathname isnt '/' and location.pathname isnt '/settings'
window.location = "/##{location.pathname}"
else
window.location = '/'
return
reload: ->
@docs.clearCache()
@disabledDocs.clearCache()
if @appCache then @appCache.reload() else window.location = '/'
if @serviceWorker then @serviceWorker.reload() else @reboot()
return
reset: ->
@localStorage.reset()
@settings.reset()
@db?.reset()
@appCache?.update()
@serviceWorker?.update()
window.location = '/'
return
@ -186,9 +198,9 @@
return
indexHost: ->
# Can't load the index files from the host/CDN when applicationCache is
# Can't load the index files from the host/CDN when service worker is
# enabled because it doesn't support caching URLs that use CORS.
@config[if @appCache and @settings.hasDocs() then 'index_path' else 'docs_origin']
@config[if @serviceWorker and @settings.hasDocs() then 'index_path' else 'docs_origin']
onBootError: (args...) ->
@trigger 'bootError'
@ -245,7 +257,7 @@
matchMedia: !!window.matchMedia
insertAdjacentHTML: !!document.body.insertAdjacentHTML
defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false
cssGradients: supportsCssGradients()
cssVariables: !!CSS?.supports?('(--t: 0)')
for key, value of features when not value
Raven.captureMessage "unsupported/#{key}", level: 'info'
@ -268,9 +280,4 @@
isInvalidLocation: ->
@config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0
supportsCssGradients = ->
el = document.createElement('div')
el.style.cssText = "background-image: -webkit-linear-gradient(top, #000, #fff); background-image: linear-gradient(to top, #000, #fff);"
el.style.backgroundImage.indexOf('gradient') >= 0
$.extend app, Events

@ -1,42 +0,0 @@
class app.AppCache
$.extend @prototype, Events
@isEnabled: ->
try
applicationCache and applicationCache.status isnt applicationCache.UNCACHED
catch
constructor: ->
@cache = applicationCache
@notifyUpdate = true
@onUpdateReady() if @cache.status is @cache.UPDATEREADY
$.on @cache, 'progress', @onProgress
$.on @cache, 'updateready', @onUpdateReady
update: ->
@notifyUpdate = true
@notifyProgress = true
try @cache.update() catch
return
updateInBackground: ->
@notifyUpdate = false
@notifyProgress = false
try @cache.update() catch
return
reload: ->
$.on @cache, 'updateready noupdate error', -> window.location = '/'
@notifyUpdate = false
@notifyProgress = true
try @cache.update() catch
return
onProgress: (event) =>
@trigger 'progress', event if @notifyProgress
return
onUpdateReady: =>
@trigger 'updateready' if @notifyUpdate
return

@ -13,3 +13,6 @@ app.config =
version: <%= Time.now.to_i %>
release: <%= Time.now.utc.httpdate.to_json %>
mathml_stylesheet: '<%= App.cdn_origin %>/mathml.css'
favicon_spritesheet: '<%= image_path('sprites/docs.png') %>'
service_worker_path: '/service-worker.js'
service_worker_enabled: <%= App.environment == :production || ENV['ENABLE_SERVICE_WORKER'] == 'true' %>

@ -0,0 +1,49 @@
class app.ServiceWorker
$.extend @prototype, Events
@isEnabled: ->
!!navigator.serviceWorker and app.config.service_worker_enabled
constructor: ->
@registration = null
@notifyUpdate = true
navigator.serviceWorker.register(app.config.service_worker_path, {scope: '/'})
.then(
(registration) => @updateRegistration(registration),
(error) -> console.error('Could not register service worker:', error)
)
update: ->
return unless @registration
@notifyUpdate = true
return @registration.update().catch(->)
updateInBackground: ->
return unless @registration
@notifyUpdate = false
return @registration.update().catch(->)
reload: ->
return @updateInBackground().then(() -> app.reboot())
updateRegistration: (registration) ->
@registration = registration
$.on @registration, 'updatefound', @onUpdateFound
return
onUpdateFound: =>
$.off @installingRegistration, 'statechange', @onStateChange() if @installingRegistration
@installingRegistration = @registration.installing
$.on @installingRegistration, 'statechange', @onStateChange
return
onStateChange: =>
if @installingRegistration and @installingRegistration.state == 'installed' and navigator.serviceWorker.controller
@installingRegistration = null
@onUpdateReady()
return
onUpdateReady: ->
@trigger 'updateready' if @notifyUpdate
return

@ -5,11 +5,13 @@ class app.Settings
'manualUpdate'
'fastScroll'
'arrowScroll'
'analyticsConsent'
'docs'
'dark'
'layout'
'size'
'tips'
'autoInstall'
]
INTERNAL_KEYS = [
@ -19,6 +21,8 @@ class app.Settings
'news'
]
LAYOUTS: ['_max-width', '_sidebar-hidden', '_native-scrollbars']
@defaults:
count: 0
hideDisabled: false
@ -26,9 +30,10 @@ class app.Settings
news: 0
manualUpdate: false
schema: 1
analyticsConsent: false
constructor: ->
@store = new CookieStore
@store = new CookiesStore
@cache = {}
get: (key) ->
@ -38,6 +43,7 @@ class app.Settings
set: (key, value) ->
@store.set(key, value)
delete @cache[key]
@toggleDark(value) if key == 'dark'
return
del: (key) ->
@ -63,6 +69,8 @@ class app.Settings
return
setLayout: (name, enable) ->
@toggleLayout(name, enable)
layout = (@store.get('layout') || '').split(' ')
$.arrayDelete(layout, '')
@ -104,3 +112,28 @@ class app.Settings
@store.reset()
@cache = {}
return
initLayout: ->
@toggleDark(@get('dark') is 1)
@toggleLayout(layout, @hasLayout(layout)) for layout in @LAYOUTS
@initSidebarWidth()
return
toggleDark: (enable) ->
classList = document.documentElement.classList
classList.toggle('_theme-default', !enable)
classList.toggle('_theme-dark', enable)
color = getComputedStyle(document.documentElement).getPropertyValue('--headerBackground').trim()
$('meta[name=theme-color]').setAttribute('content', color)
return
toggleLayout: (layout, enable) ->
classList = document.body.classList
classList.toggle(layout, enable) unless layout is '_sidebar-hidden'
classList.toggle('_overlay-scrollbars', $.overlayScrollbarsEnabled())
return
initSidebarWidth: ->
size = @get('size')
document.documentElement.style.setProperty('--sidebarWidth', size + 'px') if size
return

@ -149,6 +149,9 @@ class app.Shortcuts
when 40
@trigger 'altDown'
false
when 68
@trigger 'altD'
false
when 70
@trigger 'altF', event
when 71

@ -3,13 +3,13 @@ class app.UpdateChecker
@lastCheck = Date.now()
$.on window, 'focus', @onFocus
app.appCache.on 'updateready', @onUpdateReady if app.appCache
app.serviceWorker?.on 'updateready', @onUpdateReady
setTimeout @checkDocs, 0
check: ->
if app.appCache
app.appCache.update()
if app.serviceWorker
app.serviceWorker.update()
else
ajax
url: $('script[src*="application"]').getAttribute('src')

@ -1,4 +1,8 @@
class @CookieStore
class @CookiesStore
# Intentionally called CookiesStore instead of CookieStore
# Calling it CookieStore causes issues when the Experimental Web Platform features flag is enabled in Chrome
# Related issue: https://github.com/freeCodeCamp/devdocs/issues/932
INT = /^\d+$/
@onBlocked: ->

@ -0,0 +1,64 @@
defaultUrl = null
currentSlug = null
imageCache = {}
urlCache = {}
withImage = (url, action) ->
if imageCache[url]
action(imageCache[url])
else
img = new Image()
img.crossOrigin = 'anonymous'
img.src = url
img.onload = () =>
imageCache[url] = img
action(img)
@setFaviconForDoc = (doc) ->
return if currentSlug == doc.slug
favicon = $('link[rel="icon"]')
if defaultUrl == null
defaultUrl = favicon.href
if urlCache[doc.slug]
favicon.href = urlCache[doc.slug]
currentSlug = doc.slug
return
styles = window.getComputedStyle($("._icon-#{doc.slug.split('~')[0]}"), ':before')
bgUrl = app.config.favicon_spritesheet
sourceSize = 16
sourceX = Math.abs(parseInt(styles['background-position-x'].slice(0, -2)))
sourceY = Math.abs(parseInt(styles['background-position-y'].slice(0, -2)))
withImage(bgUrl, (docImg) ->
withImage(defaultUrl, (defaultImg) ->
size = defaultImg.width
canvas = document.createElement('canvas')
ctx = canvas.getContext('2d')
canvas.width = size
canvas.height = size
ctx.drawImage(defaultImg, 0, 0)
docIconPercentage = 65
destinationCoords = size / 100 * (100 - docIconPercentage)
destinationSize = size / 100 * docIconPercentage
ctx.drawImage(docImg, sourceX, sourceY, sourceSize, sourceSize, destinationCoords, destinationCoords, destinationSize, destinationSize)
urlCache[doc.slug] = canvas.toDataURL()
favicon.href = urlCache[doc.slug]
currentSlug = doc.slug
)
)
@resetFavicon = () ->
if defaultUrl != null and currentSlug != null
$('link[rel="icon"]').href = defaultUrl
currentSlug = null

@ -1,5 +1,5 @@
###
* Copyright 2013-2017 Thibaut Courouble and other contributors
* Copyright 2013-2019 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:

@ -190,7 +190,7 @@ isSameOrigin = (url) ->
updateCanonicalLink = ->
@canonicalLink ||= document.head.querySelector('link[rel="canonical"]')
@canonicalLink.setAttribute('href', "http://#{location.host}#{location.pathname}")
@canonicalLink.setAttribute('href', "https://#{location.host}#{location.pathname}")
trackers = []
@ -199,5 +199,21 @@ page.track = (fn) ->
return
track = ->
tracker.call() for tracker in trackers
consentGiven = Cookies.get('analyticsConsent')
consentAsked = Cookies.get('analyticsConsentAsked')
if consentGiven == '1'
tracker.call() for tracker in trackers
else if consentGiven == undefined and consentAsked == undefined
# Only ask for consent once per browser session
Cookies.set('analyticsConsentAsked', '1')
new app.views.Notif 'AnalyticsConsent', autoHide: null
return
@resetAnalytics = ->
for cookie in document.cookie.split(/;\s?/)
name = cookie.split('=')[0]
if name[0] == '_'
Cookies.expire(name)
return

@ -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
@ -352,6 +352,10 @@ isIE = null
$.isIE = ->
isIE ?= navigator.userAgent?.indexOf('MSIE') >= 0 || navigator.userAgent?.indexOf('rv:11.0') >= 0
isChromeForAndroid = null
$.isChromeForAndroid = ->
isChromeForAndroid ?= navigator.userAgent?.indexOf('Android') >= 0 && /Chrome\/([.0-9])+ Mobile/.test(navigator.userAgent)
isAndroid = null
$.isAndroid = ->
isAndroid ?= navigator.userAgent?.indexOf('Android') >= 0

@ -142,4 +142,6 @@ class app.models.Doc extends app.Model
return
isOutdated: (status) ->
status and status.installed and @mtime isnt status.mtime
return false if not status
isInstalled = status.installed or app.settings.get('autoInstall')
isInstalled and @mtime isnt status.mtime

@ -1,5 +1,37 @@
[
[
"2019-07-21",
"Fixed several bugs, added an option to automatically download documentation and <a href=\"https://github.com/freeCodeCamp/devdocs/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+sort%3Aupdated-desc+closed%3A%3E2019-07-18+977+988+986+870+886+1024+979+975+941+831+1005+848+942\" target=\"_blank\">more</a>."
],
[
"2019-07-19",
"Replaced the AppCache with a Service Worker (which makes DevDocs an installable PWA) and fixed layout preferences on Firefox."
],
[
"2018-09-23",
"New documentations: <a href=\"/puppeteer/\">Puppeteer</a> and <a href=\"/handlebars/\">Handlebars.js</a>"
], [
"2018-08-12",
"New documentations: <a href=\"/dart/\">Dart</a> and <a href=\"/qt/\">Qt</a>"
], [
"2018-07-29",
"New documentations: <a href=\"/bash/\">Bash</a>, <a href=\"/graphite/\">Graphite</a> and <a href=\"/pygame/\">Pygame</a>"
], [
"2018-07-08",
"New documentations: <a href=\"/leaflet/\">Leaflet</a>, <a href=\"/terraform/\">Terraform</a> and <a href=\"/koa/\">Koa</a>"
], [
"2018-03-26",
"DevDocs is joining the freeCodeCamp community. Read the announcement <a href=\"https://medium.freecodecamp.org/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 +142,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 +183,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 +268,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>."

@ -12,8 +12,8 @@ app.templates.notFoundPage = ->
app.templates.pageLoadError = ->
error """ The page failed to load. """,
""" It may be missing from the server (try reloading the app) or you could be offline.<br>
If you keep seeing this, you're likely behind a proxy or firewall that blocks cross-domain requests. """,
""" It may be missing from the server (try reloading the app) or you could be offline (try <a href="/offline">installing the documentation for offline usage</a> when online again).<br>
If you're online and you keep seeing this, you're likely behind a proxy or firewall that blocks cross-domain requests. """,
""" #{back} &middot; <a href="/##{location.pathname}" target="_top" class="_error-link">Reload</a>
&middot; <a href="#" class="_error-link" data-retry>Retry</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'
@ -56,21 +56,18 @@ app.templates.unsupportedBrowser = """
<h1 class="_fail-title">Your browser is unsupported, sorry.</h1>
<p class="_fail-text">DevDocs is an API documentation browser which supports the following browsers:
<ul class="_fail-list">
<li>Recent versions of Chrome and Firefox
<li>Safari 5.1+
<li>Opera 12.1+
<li>Internet Explorer 10+
<li>iOS 6+
<li>Android 4.1+
<li>Windows Phone 8+
<li>Recent versions of Firefox, Chrome, or Opera
<li>Safari 11.1+
<li>Edge 17+
<li>iOS 11.3+
</ul>
<p class="_fail-text">
If you're unable to upgrade, I apologize.
I decided to prioritize speed and new features over support for older browsers.
If you're unable to upgrade, we apologize.
We decided to prioritize speed and new features over support for older browsers.
<p class="_fail-text">
Note: if you're already using one of the browsers above, check your settings and add-ons.
The app uses feature detection, not user agent sniffing.
<p class="_fail-text">
&mdash; Thibaut <a href="https://twitter.com/DevDocs" class="_fail-link">@DevDocs</a>
&mdash; <a href="https://twitter.com/DevDocs">@DevDocs</a>
</div>
"""

@ -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) ->
@ -68,3 +68,9 @@ app.templates.notifShare = ->
app.templates.notifUpdateDocs = ->
textNotif """ Documentation updates available. """,
""" <a href="/offline">Install them</a> as soon as possible to avoid broken pages. """
app.templates.notifAnalyticsConsent = ->
textNotif """ Tracking cookies """,
""" We would like to gather usage data about how DevDocs is used through Google Analytics and Gauges. We only collect anonymous traffic information.
Please confirm if you accept our tracking cookies. You can always change your decision in the settings.
<br><span class="_notif-right"><a href="#" data-behavior="accept-analytics">Accept</a> or <a href="#" data-behavior="decline-analytics">Decline</a></span> """

@ -11,28 +11,22 @@ app.templates.aboutPage = -> """
</nav>
<h1 class="_lined-heading">DevDocs: API Documentation Browser</h1>
<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>
</ul>
<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.
<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>.
<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>Join the <a href="https://groups.google.com/d/forum/devdocs">mailing list</a>
<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>
<li>Join the <a href="https://gitter.im/FreeCodeCamp/DevDocs">Gitter</a> chat room
</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;2019 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,20 +43,19 @@ 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>
Otherwise use the <a href="https://groups.google.com/d/forum/devdocs">mailing list</a>.
If you have a specific feature request, add it to the <a href="https://github.com/freeCodeCamp/devdocs/issues">issue tracker</a>.<br>
Otherwise, come talk to us in the <a href="https://gitter.im/FreeCodeCamp/DevDocs">Gitter</a> chat room.
<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>.
<h2 class="_block-heading" id="credits">Credits</h2>
<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,43 +71,59 @@ 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>We do not collect personal information.
<li>We use Google Analytics, Gauges and Sentry to collect anonymous traffic information and improve the app.
<li><a href="https://devdocs.io">devdocs.io</a> ("App") is operated by <a href="https://www.freecodecamp.org/">freeCodeCamp</a> ("We").
<li>We do not collect personal information through the app.
<li>We use Google Analytics and Gauges to collect anonymous traffic information if you have given consent to this. You can change your decision in the <a href="/settings">settings</a>.
<li>We use Sentry to collect crash data and improve the app.
<li>The app uses cookies to store user preferences.
<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.
<li>If you have any questions regarding privacy, please email <a href="mailto:thibaut@devdocs.io">thibaut@devdocs.io</a>.
<li>If you have any questions regarding privacy, please email <a href="mailto:privacy@freecodecamp.org">privacy@freecodecamp.org</a>.
</ul>
"""
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; 20182019 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'
], [
'Async',
'2010-2017 Caolan McMahon',
'2010-2018 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'
], [
'Bash',
'2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.',
'GFDL',
'https://www.gnu.org/licenses/fdl-1.3.en.html'
], [
'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-2019 Twitter, Inc.<br>2011-2019 The Bootstrap Authors',
'CC BY',
'https://creativecommons.org/licenses/by/3.0/'
], [
@ -124,7 +133,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 +143,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',
@ -154,12 +163,12 @@ credits = [
'https://github.com/clojure/clojure/blob/master/epl-v10.html'
], [
'CMake',
'2000-2017 Kitware, Inc. and Contributors',
'2000-2019 Kitware, Inc. and Contributors',
'BSD',
'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,17 +178,17 @@ 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',
'2012-2018 The Apache Software Foundation',
'Apache',
'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE'
], [
@ -194,14 +203,19 @@ 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'
], [
'Dart',
'2012 the Dart project authors',
'CC BY-SA',
'https://creativecommons.org/licenses/by-sa/4.0/'
], [
'Django',
'Django Software Foundation and individual contributors',
@ -209,7 +223,7 @@ credits = [
'https://raw.githubusercontent.com/django/django/master/LICENSE'
], [
'Docker',
'2017 Docker, Inc.<br>Docker and the Docker logo are trademarks of Docker, Inc.',
'2019 Docker, Inc.<br>Docker and the Docker logo are trademarks of Docker, Inc.',
'Apache',
'https://raw.githubusercontent.com/docker/docker.github.io/master/LICENSE'
], [
@ -224,12 +238,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 +256,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 +283,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,14 +293,24 @@ 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'
], [
'Graphite',
'2008-2012 Chris Davis<br>&copy; 2011-2016 The Graphite Project',
'Apache',
'https://raw.githubusercontent.com/graphite-project/graphite-web/master/LICENSE'
], [
'Grunt',
'GruntJS Team',
'MIT',
'https://github.com/gruntjs/grunt-docs/blob/master/package.json#L10'
], [
'Handlebars',
'2011-2017 Yehuda Katz',
'MIT',
'https://raw.githubusercontent.com/wycats/handlebars.js/master/LICENSE'
], [
'Haskell',
'The University of Glasgow',
@ -289,9 +318,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 +341,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.',
@ -329,17 +368,27 @@ credits = [
'https://raw.githubusercontent.com/jquery/api.jqueryui.com/master/LICENSE.txt'
], [
'Julia',
'2009-2016 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors',
'2009-2018 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',
'MIT',
'https://raw.githubusercontent.com/knockout/knockout/master/LICENSE'
], [
'Koa',
'2018 Koa contributors',
'MIT',
'https://raw.githubusercontent.com/koajs/koa/master/LICENSE'
], [
'Kotlin',
'2010-2017 JetBrains s.r.o.',
'2010-2019 JetBrains s.r.o.',
'Apache',
'https://raw.githubusercontent.com/JetBrains/kotlin/master/license/LICENSE.txt'
], [
@ -347,6 +396,11 @@ credits = [
'Taylor Otwell',
'MIT',
'https://raw.githubusercontent.com/laravel/framework/master/LICENSE.txt'
], [
'Leaflet',
'2010-2019 Vladimir Agafonkin<br>&copy; 2010-2011, CloudMade<br>Maps &copy; OpenStreetMap contributors.',
'BSD',
'https://raw.githubusercontent.com/Leaflet/Leaflet/master/LICENSE'
], [
'Less',
'2009-2016 The Core Less Team',
@ -359,9 +413,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',
@ -384,7 +438,7 @@ credits = [
'https://daringfireball.net/projects/markdown/license'
], [
'Matplotlib',
'2012-2017 Matplotlib Development Team. All rights reserved.',
'2012-2018 Matplotlib Development Team. All rights reserved.',
'Custom',
'https://raw.githubusercontent.com/matplotlib/matplotlib/master/LICENSE/LICENSE'
], [
@ -399,7 +453,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 +473,12 @@ credits = [
'https://github.com/LearnBoost/mongoose/blob/master/README.md#license'
], [
'nginx',
'2002-2017 Igor Sysoev<br>&copy; 2011-2017 Nginx, Inc.',
'2002-2019 Igor Sysoev<br>&copy; 2011-2019 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'
], [
@ -464,7 +518,7 @@ credits = [
'https://raw.githubusercontent.com/OpenTSDB/opentsdb.net/gh-pages/COPYING.LESSER'
], [
'Padrino',
'2010-2016 Padrino',
'2010-2019 Padrino',
'MIT',
'https://raw.githubusercontent.com/padrino/padrino-framework/master/padrino/LICENSE.txt'
], [
@ -494,7 +548,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 +558,22 @@ 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/'
], [
'Puppeteer',
'2017 Google Inc',
'Apache',
'https://raw.githubusercontent.com/GoogleChrome/puppeteer/master/LICENSE'
], [
'Pygame',
'Pygame Developers',
'LGPLv2.1',
'https://raw.githubusercontent.com/pygame/pygame/master/LICENSE'
], [
'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'
], [
@ -517,6 +581,11 @@ credits = [
'2009-2017 Kristopher Michael Kowal',
'MIT',
'https://raw.githubusercontent.com/kriskowal/q/master/LICENSE'
], [
'Qt',
'2012-2018 The Qt Company Ltd',
'GFDL',
'https://doc.qt.io/qt-5/licensing.html'
], [
'Ramda',
'2013-2016 Scott Sauyet and Michael Hurley',
@ -524,12 +593,12 @@ credits = [
'https://raw.githubusercontent.com/ramda/ramda/master/LICENSE.txt'
], [
'React, React Native, Flow, Relay',
'2013-2017 Facebook Inc.',
'CC BY',
'https://raw.githubusercontent.com/facebook/react/master/LICENSE-docs'
'2013-present Facebook Inc.',
'MIT',
'https://raw.githubusercontent.com/facebook/react/master/LICENSE'
], [
'Redis',
'2009-2017 Salvatore Sanfilippo',
'2009-2018 Salvatore Sanfilippo',
'CC BY-SA',
'https://creativecommons.org/licenses/by-sa/4.0/'
], [
@ -574,12 +643,12 @@ credits = [
'http://scikit-image.org/docs/dev/license.html'
], [
'scikit-learn',
'2007-2017 The scikit-learn developers',
'2007-2018 The scikit-learn developers',
'BSD',
'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,14 +678,19 @@ 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/'
], [
'Terraform',
'2018 HashiCorp',
'MPL',
'https://raw.githubusercontent.com/hashicorp/terraform-website/master/LICENSE.md'
], [
'Twig',
'2009-2017 The Twig Team',
'2009-2018 The Twig Team',
'BSD',
'https://twig.sensiolabs.org/license'
'https://twig.symfony.com/license'
], [
'TypeScript',
'Microsoft and other contributors',
@ -624,17 +698,17 @@ credits = [
'https://raw.githubusercontent.com/Microsoft/TypeScript-Handbook/master/LICENSE'
], [
'Underscore.js',
'2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors',
'2009-2018 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 +723,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>
@ -133,6 +131,9 @@ app.templates.helpPage = ->
<dt class="_shortcuts-dt">
<code class="_shortcut-code">alt + s</code>
<dd class="_shortcuts-dd">Search on Stack Overflow
<dt class="_shortcuts-dt">
<code class="_shortcut-code">alt + d</code>
<dd class="_shortcuts-dd">Search on DuckDuckGo
</dl>
<p class="_note _note-green">
<strong>Tip:</strong> If the cursor is no longer in the search field, press <code class="_label">/</code> or
@ -153,5 +154,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 = {}) ->

@ -25,14 +25,14 @@ app.templates.offlinePage = (docs) -> """
<h2 class="_block-heading">Questions & Answers</h2>
<dl>
<dt>How does this work?
<dd>Each page is cached as a key-value pair in <a href="https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API">IndexedDB</a> (downloaded from a single file).<br>
The app also uses <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache">AppCache</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API">localStorage</a> to cache the assets and index files.
<dd>Each page is cached as a key-value pair in <a href="https://devdocs.io/dom/indexeddb_api">IndexedDB</a> (downloaded from a single file).<br>
The app also uses <a href="https://devdocs.io/dom/service_worker_api/using_service_workers">Service Workers</a> and <a href="https://devdocs.io/dom/web_storage_api">localStorage</a> to cache the assets and index files.
<dt>Can I close the tab/browser?
<dd>#{canICloseTheTab()}
<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?
@ -41,10 +41,15 @@ app.templates.offlinePage = (docs) -> """
"""
canICloseTheTab = ->
if app.AppCache.isEnabled()
if app.ServiceWorker.isEnabled()
""" Yes! Even offline, you can open a new tab, go to <a href="//devdocs.io">devdocs.io</a>, and everything will work as if you were online (provided you installed all the documentations you want to use beforehand). """
else
""" No. AppCache isn't available in your browser (or is disabled), so loading <a href="//devdocs.io">devdocs.io</a> offline won't work.<br>
reason = "aren't available in your browser (or are disabled)"
if app.config.env != 'production'
reason = "are disabled in your development instance of DevDocs (enable them by setting the <code>ENABLE_SERVICE_WORKER</code> environment variable to <code>true</code>)"
""" No. Service Workers #{reason}, so loading <a href="//devdocs.io">devdocs.io</a> offline won't work.<br>
The current tab will continue to function even when you go offline (provided you installed all the documentations beforehand). """
app.templates.offlineDoc = (doc, status) ->

@ -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>.
we&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
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>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 <a href="https://gitter.im/FreeCodeCamp/DevDocs">Gitter</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>.
<object data="https://img.shields.io/github/stars/freeCodeCamp/devdocs.svg?style=social" type="image/svg+xml" aria-hidden="true"></object>
<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,6 @@ 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>
"""

@ -15,6 +15,14 @@ app.templates.settingsPage = (settings) -> """
<input type="checkbox" form="settings" name="layout" value="_sidebar-hidden"#{if settings['_sidebar-hidden'] then ' checked' else ''}>Automatically hide and show the sidebar
<small>Tip: drag the edge of the sidebar to resize it.</small>
</label>
<label class="_settings-label">
<input type="checkbox" form="settings" name="autoInstall" value="_auto-install"#{if settings.autoInstall then ' checked' else ''}>Automatically download documentation for offline use
<small>Only enable this when bandwidth isn't a concern to you.</small>
</label>
<label class="_settings-label">
<input type="checkbox" form="settings" name="analyticsConsent"#{if settings.analyticsConsent then ' checked' else ''}>Enable tracking cookies
<small>With this checked, we enable Google Analytics and Gauges to collect anonymous traffic information.</small>
</label>
</div>
</div>

@ -1,28 +1,32 @@
try {
if (app.config.env == 'production') {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-5544833-12', 'devdocs.io');
page.track(function() {
ga('send', 'pageview', {
page: location.pathname + location.search + location.hash,
dimension1: app.router.context && app.router.context.doc && app.router.context.doc.slug_without_version
if (app.config.env === 'production') {
if (Cookies.get('analyticsConsent') === '1') {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-5544833-12', 'devdocs.io');
page.track(function() {
ga('send', 'pageview', {
page: location.pathname + location.search + location.hash,
dimension1: app.router.context && app.router.context.doc && app.router.context.doc.slug_without_version
});
});
});
page.track(function() {
if (window._gauges)
_gauges.push(['track']);
else
(function() {
var _gauges=_gauges||[];!function(){var a=document.createElement("script");
a.type="text/javascript",a.async=!0,a.id="gauges-tracker",
a.setAttribute("data-site-id","51c15f82613f5d7819000067"),
a.src="https://secure.gaug.es/track.js";var b=document.getElementsByTagName("script")[0];
b.parentNode.insertBefore(a,b)}();
})();
});
page.track(function() {
if (window._gauges)
_gauges.push(['track']);
else
(function() {
var _gauges=_gauges||[];!function(){var a=document.createElement("script");
a.type="text/javascript",a.async=!0,a.id="gauges-tracker",
a.setAttribute("data-site-id","51c15f82613f5d7819000067"),
a.src="https://secure.gaug.es/track.js";var b=document.getElementsByTagName("script")[0];
b.parentNode.insertBefore(a,b)}();
})();
});
} else {
resetAnalytics();
}
}
} catch(e) { }

@ -413,7 +413,7 @@
// when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
// with the same identifier as the touch event that previously triggered the click that triggered the alert.
// Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
// immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
// immediately preceding touch event (issue #52), so this fix is unavailable on that platform.
// Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string,
// which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long,
// random integers, it's safe to to continue if the identifier is 0 here.
@ -805,7 +805,7 @@
}
}
// IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
// IE11: prefixed -ms-touch-action is no longer supported and it's recommended to use non-prefixed version
// http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
return true;

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -19,7 +19,10 @@ class app.views.Content extends app.View
after: 'afterRoute'
init: ->
@scrollEl = if app.isMobile() then document.body else @el
@scrollEl = if app.isMobile()
(document.scrollingElement || document.body)
else
@el
@scrollMap = {}
@scrollStack = []
@ -150,6 +153,9 @@ class app.views.Content extends app.View
return
afterRoute: (route, context) =>
if route != 'entry' and route != 'type'
resetFavicon()
switch route
when 'root'
@show @rootPage

@ -40,6 +40,7 @@ class app.views.EntryPage extends app.View
if app.disabledDocs.findBy 'slug', @entry.doc.slug
@hiddenView = new app.views.HiddenPage @el, @entry
setFaviconForDoc(@entry.doc)
@delay @polyfillMathML
@trigger 'loaded'
return
@ -123,7 +124,7 @@ class app.views.EntryPage extends app.View
@render @tmpl('pageLoadError')
@resetClass()
@addClass @constructor.errorClass
app.appCache?.update()
app.serviceWorker?.update()
return
cache: ->

@ -57,6 +57,7 @@ class app.views.OfflinePage extends app.View
doc[action](@onInstallSuccess.bind(@, doc), @onInstallError.bind(@, doc), @onInstallProgress.bind(@, doc))
el.parentNode.innerHTML = "#{el.textContent.replace(/e$/, '')}ing…"
else if action = el.getAttribute('data-action-all')
return unless action isnt 'uninstall' or window.confirm('Uninstall all docs?')
app.db.migrate()
$.click(el) for el in @findAll("[data-action='#{action}']")
return

@ -9,10 +9,17 @@ 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'
@append @tmpl(tmpl)
return
hideIntro: ->

@ -1,7 +1,4 @@
class app.views.SettingsPage extends app.View
LAYOUTS = ['_max-width', '_sidebar-hidden', '_native-scrollbars']
SIDEBAR_HIDDEN_LAYOUT = '_sidebar-hidden'
@className: '_static'
@events:
@ -17,32 +14,31 @@ class app.views.SettingsPage extends app.View
settings.dark = app.settings.get('dark')
settings.smoothScroll = !app.settings.get('fastScroll')
settings.arrowScroll = app.settings.get('arrowScroll')
settings[layout] = app.settings.hasLayout(layout) for layout in LAYOUTS
settings.autoInstall = app.settings.get('autoInstall')
settings.analyticsConsent = app.settings.get('analyticsConsent')
settings[layout] = app.settings.hasLayout(layout) for layout in app.settings.LAYOUTS
settings
getTitle: ->
'Preferences'
toggleDark: (enable) ->
css = $('link[rel="stylesheet"][data-alt]')
alt = css.getAttribute('data-alt')
css.setAttribute('data-alt', css.getAttribute('href'))
css.setAttribute('href', alt)
app.settings.set('dark', !!enable)
app.appCache?.updateInBackground()
return
toggleLayout: (layout, enable) ->
document.body.classList[if enable then 'add' else 'remove'](layout) unless layout is SIDEBAR_HIDDEN_LAYOUT
document.body.classList[if $.overlayScrollbarsEnabled() then 'add' else 'remove']('_overlay-scrollbars')
app.settings.setLayout(layout, enable)
app.appCache?.updateInBackground()
return
toggleSmoothScroll: (enable) ->
app.settings.set('fastScroll', !enable)
return
toggleAnalyticsConsent: (enable) ->
app.settings.set('analyticsConsent', if enable then '1' else '0')
resetAnalytics() unless enable
return
toggle: (name, enable) ->
app.settings.set(name, enable)
return
@ -86,6 +82,8 @@ class app.views.SettingsPage extends app.View
@toggleSmoothScroll input.checked
when 'import'
@import input.files[0], input
when 'analyticsConsent'
@toggleAnalyticsConsent input.checked
else
@toggle input.name, input.checked
return

@ -9,6 +9,7 @@ class app.views.TypePage extends app.View
render: (@type) ->
@html @tmpl('typePage', @type)
setFaviconForDoc(@type.doc)
return
getTitle: ->

@ -28,7 +28,7 @@ class app.views.Document extends app.View
return
setTitle: (title) ->
@el.title = if title then "DevDocs — #{title}" else 'DevDocs API Documentation'
@el.title = if title then "#{title} — DevDocs" else 'DevDocs API Documentation'
afterRoute: (route) =>
if route is 'settings'
@ -75,9 +75,11 @@ class app.views.Document extends app.View
return unless target.hasAttribute('data-behavior')
$.stopEvent(event)
switch target.getAttribute('data-behavior')
when 'back' then history.back()
when 'reload' then window.location.reload()
when 'reboot' then window.location = '/'
when 'hard-reload' then app.reload()
when 'reset' then app.reset() if confirm('Are you sure you want to reset DevDocs?')
when 'back' then history.back()
when 'reload' then window.location.reload()
when 'reboot' then app.reboot()
when 'hard-reload' then app.reload()
when 'reset' then app.reset() if confirm('Are you sure you want to reset DevDocs?')
when 'accept-analytics' then Cookies.set('analyticsConsent', '1') && app.reboot()
when 'decline-analytics' then Cookies.set('analyticsConsent', '0') && app.reboot()
return

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

@ -11,9 +11,6 @@ class app.views.Resizer extends app.View
init: ->
@el.setAttribute('draggable', 'true')
@appendTo $('._app')
@style = $('style[data-resizer]')
@size = @style.getAttribute('data-size')
return
MIN = 260
@ -24,15 +21,11 @@ class app.views.Resizer extends app.View
return unless value > 0
value = Math.min(Math.max(Math.round(value), MIN), MAX)
newSize = "#{value}px"
@style.innerHTML = @style.innerHTML.replace(new RegExp(@size, 'g'), newSize)
@size = newSize
if save
app.settings.setSize(value)
app.appCache?.updateInBackground()
document.documentElement.style.setProperty('--sidebarWidth', newSize)
app.settings.setSize(value) if save
return
onDragStart: (event) =>
@style.removeAttribute('disabled')
event.dataTransfer.effectAllowed = 'link'
event.dataTransfer.setData('Text', '')
$.on(window, 'dragover', @onDrag)
@ -50,7 +43,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

@ -25,7 +25,6 @@ class app.views.Settings extends app.View
if super
@render()
document.body.classList.remove(SIDEBAR_HIDDEN_LAYOUT)
app.appCache?.on 'progress', @onAppCacheProgress
return
deactivate: ->
@ -33,7 +32,6 @@ class app.views.Settings extends app.View
@resetClass()
@docPicker.detach()
document.body.classList.add(SIDEBAR_HIDDEN_LAYOUT) if app.settings.hasLayout(SIDEBAR_HIDDEN_LAYOUT)
app.appCache?.off 'progress', @onAppCacheProgress
return
render: ->
@ -52,7 +50,7 @@ class app.views.Settings extends app.View
docs = @docPicker.getSelectedDocs()
app.settings.setDocs(docs)
@saveBtn.textContent = if app.appCache then 'Downloading\u2026' else 'Saving\u2026'
@saveBtn.textContent = 'Saving\u2026'
disabledDocs = new app.collections.Docs(doc for doc in app.docs.all() when docs.indexOf(doc.slug) is -1)
disabledDocs.uninstall ->
app.db.migrate()
@ -83,9 +81,3 @@ class app.views.Settings extends app.View
$.stopEvent(event)
app.router.show '/'
return
onAppCacheProgress: (event) =>
if event.lengthComputable
percentage = Math.round event.loaded * 100 / event.total
@saveBtn.textContent = "Downloading\u2026 (#{percentage}%)"
return

@ -17,6 +17,7 @@ class app.views.Search extends app.View
typing: 'focus'
altG: 'google'
altS: 'stackoverflow'
altD: 'duckduckgo'
@routes:
after: 'afterRoute'
@ -29,6 +30,9 @@ class app.views.Search extends app.View
.on 'results', @onResults
.on 'end', @onEnd
@scope
.on 'change', @onScopeChange
app.on 'ready', @onReady
$.on window, 'hashchange', @searchUrl
$.on window, 'focus', @onWindowFocus
@ -113,6 +117,10 @@ class app.views.Search extends app.View
@externalSearch "https://stackoverflow.com/search?q="
return
duckduckgo: =>
@externalSearch "https://duckduckgo.com/?t=devdocs&q="
return
onResults: (results) =>
@hasResults = true if results.length
@trigger 'results', results, @flags
@ -127,13 +135,17 @@ class app.views.Search extends app.View
if event.target is @resetLink
$.stopEvent(event)
@reset()
app.document.onEscape()
return
onSubmit: (event) ->
$.stopEvent(event)
return
onScopeChange: =>
@value = ''
@onInput()
return
afterRoute: (name, context) =>
return if app.shortcuts.eventInProgress?.name is 'escape'
@reset(true) if not context.init and app.router.isIndex()

@ -6,7 +6,9 @@ class app.views.SearchScope extends app.View
tag: '._search-tag'
@events:
click: 'onClick'
keydown: 'onKeydown'
textInput: 'onTextInput'
@routes:
after: 'afterRoute'
@ -87,17 +89,33 @@ class app.views.SearchScope extends app.View
@trigger 'change', null, previousDoc
return
doScopeSearch: (event) =>
@search @input.value[0...@input.selectionStart]
$.stopEvent(event) if @doc
return
onClick: (event) =>
if event.target is @tag
@reset()
$.stopEvent(event)
return
onKeydown: (event) =>
if event.which is 8 # backspace
if @doc and not @input.value
$.stopEvent(event)
if @doc and @input.selectionEnd is 0
@reset()
else if not @doc and @input.value
$.stopEvent(event)
else if not @doc and @input.value and not $.isChromeForAndroid()
return if event.ctrlKey or event.metaKey or event.altKey or event.shiftKey
if event.which is 9 or # tab
(event.which is 32 and app.isMobile()) # space
@search @input.value[0...@input.selectionStart]
$.stopEvent(event) if @doc
@doScopeSearch(event)
return
onTextInput: (event) =>
return unless $.isChromeForAndroid()
if not @doc and @input.value and event.data == ' '
@doScopeSearch(event)
return
extractHashValue: ->

@ -28,7 +28,7 @@ class app.views.Sidebar extends app.View
app.on 'ready', @onReady
$.on document.documentElement, 'mouseleave', (event) => @display() if event.clientX < 10
$.on document.documentElement, 'mouseleave', (event) => @display() unless event.clientX <= 0
$.on document.documentElement, 'mouseenter', => @resetDisplay(forceNoHover: false)
return

@ -1,101 +0,0 @@
//= depend_on docs-1.png
//= depend_on docs-1@2x.png
//= depend_on docs-2.png
//= depend_on docs-2@2x.png
/*!
* Copyright 2013-2017 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:
* http://mozilla.org/MPL/2.0/
*/
@import 'global/variables-dark',
'global/icons',
'global/classes',
'global/base';
@import 'components/app',
'components/header',
'components/notif',
'components/sidebar',
'components/settings',
'components/content',
'components/page',
'components/fail',
'components/path',
'components/notice',
'components/prism',
'components/mobile';
@import 'pages/simple',
'pages/angular',
'pages/angularjs',
'pages/apache',
'pages/async',
'pages/bootstrap',
'pages/c',
'pages/cakephp',
'pages/clojure',
'pages/codeception',
'pages/coffeescript',
'pages/cordova',
'pages/crystal',
'pages/d',
'pages/d3',
'pages/dojo',
'pages/drupal',
'pages/elixir',
'pages/ember',
'pages/erlang',
'pages/express',
'pages/git',
'pages/github',
'pages/go',
'pages/haskell',
'pages/jquery',
'pages/julia',
'pages/knockout',
'pages/kotlin',
'pages/laravel',
'pages/liquid',
'pages/love',
'pages/lua',
'pages/mdn',
'pages/meteor',
'pages/modernizr',
'pages/moment',
'pages/nginx',
'pages/node',
'pages/npm',
'pages/openjdk',
'pages/perl',
'pages/phalcon',
'pages/phaser',
'pages/php',
'pages/phpunit',
'pages/postgres',
'pages/pug',
'pages/ramda',
'pages/rdoc',
'pages/react_native',
'pages/redis',
'pages/rethinkdb',
'pages/rfc',
'pages/rubydoc',
'pages/rust',
'pages/scala',
'pages/sinon',
'pages/socketio',
'pages/sphinx',
'pages/sphinx_simple',
'pages/sqlite',
'pages/support_tables',
'pages/tcl_tk',
'pages/tensorflow',
'pages/underscore',
'pages/vue',
'pages/webpack',
'pages/yard',
'pages/yii';

@ -1,17 +1,19 @@
//= depend_on docs-1.png
//= depend_on docs-1@2x.png
//= depend_on docs-2.png
//= depend_on docs-2@2x.png
//= depend_on sprites/docs.png
//= depend_on sprites/docs@2x.png
//= depend_on sprites/docs.json
/*!
* Copyright 2013-2017 Thibaut Courouble and other contributors
* Copyright 2013-2019 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:
* http://mozilla.org/MPL/2.0/
*/
@import 'global/variables',
@import 'global/variables-light',
'global/variables-dark',
'global/variables',
'global/mixins',
'global/icons',
'global/classes',
'global/base';
@ -34,6 +36,7 @@
'pages/angularjs',
'pages/apache',
'pages/async',
'pages/bash',
'pages/bootstrap',
'pages/c',
'pages/cakephp',
@ -44,6 +47,7 @@
'pages/crystal',
'pages/d',
'pages/d3',
'pages/dart',
'pages/dojo',
'pages/drupal',
'pages/elixir',
@ -53,7 +57,9 @@
'pages/git',
'pages/github',
'pages/go',
'pages/graphite',
'pages/haskell',
'pages/jekyll',
'pages/jquery',
'pages/julia',
'pages/knockout',
@ -77,6 +83,8 @@
'pages/phpunit',
'pages/postgres',
'pages/pug',
'pages/python',
'pages/qt',
'pages/ramda',
'pages/rdoc',
'pages/react_native',
@ -94,6 +102,7 @@
'pages/support_tables',
'pages/tcl_tk',
'pages/tensorflow',
'pages/terraform',
'pages/underscore',
'pages/vue',
'pages/webpack',

@ -1,6 +1,6 @@
html._booting { background: $contentBackground; }
html._booting { background: var(--contentBackground); }
body._max-width { background: none; }
html._booting body._max-width { background: $documentBackground; }
html._booting body._max-width { background: var(--documentBackground); }
._app {
position: relative;
@ -15,8 +15,8 @@ html._booting body._max-width { background: $documentBackground; }
._max-width & {
margin: 0 auto;
max-width: $maxWidth;
background: $contentBackground;
box-shadow: 1px 0 $headerBorder, -1px 0 $headerBorder;
max-width: var(--maxWidth);
background: var(--contentBackground);
box-shadow: 1px 0 var(--headerBorder), -1px 0 var(--headerBorder);
}
}

@ -4,13 +4,13 @@
._container {
position: relative;
z-index: $contentZ;
z-index: var(--contentZ);
height: 100%;
margin-left: $sidebarWidth;
margin-left: var(--sidebarWidth);
pointer-events: none;
@extend %border-box;
@media #{$mediumScreen} { margin-left: $sidebarMediumWidth; }
@include mobile { margin-left: var(--sidebarMediumWidth); }
._sidebar-hidden & { margin-left: 0; }
body:not(._native-scrollbars) & { -webkit-margin-end: -1px; }
@ -30,7 +30,7 @@
._sidebar-hidden &:before {
content: '';
display: block;
margin-top: $headerHeight;
margin-top: var(--headerHeight);
}
._overlay-scrollbars & { padding-left: .625rem; }
@ -54,7 +54,7 @@
font-size: 4rem;
font-weight: 300;
letter-spacing: -.125rem;
color: $loadingText;
color: var(--loadingText);
text-align: center;
cursor: default;
}
@ -68,7 +68,7 @@
//
._splash-title {
color: $splashText;
color: var(--splashText);
@extend %loading, %user-select-none;
}
@ -88,7 +88,7 @@
min-height: calc(100vh - 2.375rem);
._sidebar-hidden & {
min-height: calc(100vh - 2.375rem - #{$headerHeight});
min-height: calc(100vh - 2.375rem - var(--headerHeight));
}
}
@ -140,12 +140,12 @@
._error-text {
margin: 0 0 1rem;
color: $textColorLight;
color: var(--textColorLight);
}
._error-links {
font-size: 1rem;
font-weight: $boldFontWeight;
font-weight: var(--boldFontWeight);
}
._error-link { padding: 0 .5rem; }
@ -167,7 +167,7 @@
height: 1px;
margin-top: .25rem;
margin-left: 1rem;
background: $boxBorderLight;
background: var(--boxBorderLight);
}
}
@ -197,7 +197,7 @@
._toc-title {
margin: 0 0 .5rem;
font-size: inherit;
font-weight: $boldFontWeight;
font-weight: var(--boldFontWeight);
}
._toc-list {
@ -252,7 +252,7 @@
._docs-size {
text-align: right;
> small { color: $textColorLight; }
> small { color: var(--textColorLight); }
}
._docs-tools {
@ -285,7 +285,7 @@
padding: 0 .75rem;
}
._btn-link:not(._show) { display: none; }
._btn-link._show ~ ._btn-link._show { border-left: 1px solid $boxBorder; }
._btn-link._show ~ ._btn-link._show { border-left: 1px solid var(--boxBorder); }
}
//
@ -297,7 +297,7 @@
position: relative;
padding-left: 10em;
font-size: .8125rem;
color: $textColorLight;
color: var(--textColorLight);
+ ._news-row { margin-top: 1em; }
}
@ -305,7 +305,7 @@
._news-title {
display: block;
font-size: .875rem;
color: $textColor;
color: var(--textColor);
}
._news-date {
@ -372,16 +372,18 @@
// Utilities
//
._bold { font-weight: $boldFontWeight; }
._bold { font-weight: var(--boldFontWeight); }
._note { @extend %note; }
._note-green { @extend %note-green; }
._label { @extend %label; }
._code { @extend %code; }
._highlight { background: $highlightBackground !important; }
._highlight { background: var(--highlightBackground) !important; }
._table { width: 100%; }
._mobile ._table { overflow-x: auto; }
._pre-heading { @extend %pre-heading; }
._pre-clip {
display: none;
position: absolute;
@ -394,12 +396,9 @@
pre:hover > & { display: block; }
&:hover { opacity: 1; }
> svg { @extend %svg-icon; }
@if $style == 'dark' {
> svg { fill: white; }
} @else {
> svg { fill: black; }
> svg {
@extend %svg-icon;
fill: var(--absolute);
}
&._pre-clip-success > svg,
@ -417,15 +416,13 @@
line-height: normal;
white-space: nowrap;
padding: .375rem .675rem;
background-image: linear-gradient(lighten($boxBackground, 4%), darken($boxBackground, 2%));
border: 1px solid $boxBorder;
background-color: var(--boxBackground);
border: 1px solid var(--boxBorder);
border-radius: 3px;
box-shadow: 0 1px rgba($boxBorder, .08);
cursor: pointer;
&:active {
background-color: $boxBackground;
box-shadow: inset 0 1px 1px rgba(black, .05), inset 0 1px 4px $boxBorder;
box-shadow: inset 0 1px 1px rgba(black, .05), inset 0 1px 4px var(--boxBorder);
}
}
@ -445,22 +442,23 @@
._btn-link {
line-height: inherit;
color: $linkColor;
text-decoration: $linkTextDecoration;
color: var(--linkColor);
text-decoration: var(--linkTextDecoration);
&:hover {
color: $linkColorHover;
color: var(--linkColorHover);
text-decoration: underline;
}
}
._reset-btn,
._reset-btn:hover {
color: $textColorRed;
color: var(--textColorRed);
}
._github-btn {
display: inline-block;
vertical-align: text-top;
margin-left: .25rem;
background: inherit;
}

@ -1,4 +1,4 @@
._fail {
._fail { // Don't use CSS variables, in case the browser doesn't support them.
display: block;
position: relative;
top: 1.5rem;
@ -23,7 +23,7 @@
._fail-title {
margin: 0 0 1rem;
font-size: 1rem;
font-weight: $boldFontWeight;
font-weight: bold;
}
._fail-text, ._fail-list {
@ -32,5 +32,3 @@
}
._fail-text:last-child { margin: 0; }
._fail-link { float: right; }

@ -4,20 +4,20 @@
._header {
position: absolute;
z-index: $headerZ;
z-index: var(--headerZ);
top: 0;
left: 0;
display: -ms-flexbox;
display: flex;
width: $sidebarWidth;
height: $headerHeight;
background: $headerBackground;
border-bottom: 1px solid $headerBorder;
border-right: 1px solid $headerBorder;
width: var(--sidebarWidth);
height: var(--headerHeight);
background: var(--headerBackground);
border-bottom: 1px solid var(--headerBorder);
border-right: 1px solid var(--headerBorder);
@extend %border-box;
@extend %user-select-none;
@media #{$mediumScreen} { width: $sidebarMediumWidth; }
@include mobile { width: var(--sidebarMediumWidth); }
}
._header-left {
@ -35,7 +35,7 @@
flex: 0 0 auto;
width: 2.25rem;
height: 100%;
color: $textColorLight;
color: var(--textColorLight);
text-align: center;
&[hidden] { display: none; }
@ -67,8 +67,8 @@
word-wrap: normal;
overflow-wrap: normal;
font-size: .875rem;
background: $contentBackground;
border: 1px solid $headerBorder;
background: var(--contentBackground);
border: 1px solid var(--headerBorder);
border-radius: 3px;
box-shadow: -1px 1px 1px rgba(black, .05);
transition: all 0ms cubic-bezier(0.23, 1, 0.32, 1) 1ms;
@ -98,10 +98,10 @@
margin: 0;
line-height: 1.5rem;
font-size: 1rem;
font-weight: $boldFontWeight;
font-weight: var(--boldFontWeight);
letter-spacing: -.5px;
background: $sidebarBackground;
border-bottom: 1px solid $sidebarBorder;
background: var(--sidebarBackground);
border-bottom: 1px solid var(--sidebarBorder);
border-radius: 2px 2px 0 0;
}
@ -109,7 +109,7 @@
._menu-title-link:hover {
display: block;
padding: .5rem 1rem;
color: $focusText;
color: var(--focusText);
text-decoration: none;
}
@ -121,9 +121,9 @@
text-decoration: none;
&:hover {
color: $focusText;
color: var(--focusText);
text-decoration: none;
background: $sidebarBackground;
background: var(--sidebarBackground);
}
&:last-child { border-radius: 0 0 2px 2px; }
@ -151,11 +151,7 @@
opacity: .42;
@extend %svg-icon;
@if $style == 'dark' {
fill: white;
} @else {
fill: black;
}
fill: var(--absolute);
}
}
@ -166,21 +162,19 @@
height: 100%;
padding: 0 .75rem 1px 1.75rem;
font-size: .875rem;
background: $contentBackground;
background: var(--contentBackground);
border: 1px solid;
border-color: darken($headerBorder, 2%);
border-color: var(--searchBorder);
border-radius: 3px;
&:focus {
outline: 0;
@if $inputFocusBorder {
border-color: $inputFocusBorder;
box-shadow: 0 0 1px $inputFocusBorder;
}
border-color: var(--inputFocusBorder);
box-shadow: 0 0 1px var(--inputFocusBorder);
}
&[disabled] {
background: $sidebarBackground;
background: var(--sidebarBackground);
cursor: not-allowed;
}
}
@ -202,13 +196,9 @@
top: .5rem;
left: .375rem;
@extend %svg-icon;
fill: var(--absolute);
}
@if $style == 'dark' {
> svg { fill: white; }
} @else {
> svg { fill: black; }
}
._search-active > & { display: block; }
}
@ -222,8 +212,9 @@
line-height: 1.25rem;
max-width: 50%;
font-size: .8125rem;
color: $textColorLight;
background: darken($headerBackground, 5%);
color: var(--textColorLight);
background: var(--searchTagBackground);
border-radius: 2px;
cursor: pointer;
@extend %truncate-text;
}

@ -4,7 +4,7 @@
._mobile {
font-size: 100%;
background: $contentBackground;
background: var(--contentBackground);
._hide-on-mobile { display: none; }
@ -18,7 +18,7 @@
._container {
margin: 0;
padding-top: $headerHeight;
padding-top: var(--headerHeight);
}
._content {

@ -1,15 +1,15 @@
._notice {
position: absolute;
z-index: $noticeZ;
z-index: var(--noticeZ);
bottom: 0;
left: $sidebarWidth;
left: var(--sidebarWidth);
right: 0;
height: 2.5rem;
padding: 0 1.25rem;
background: $noticeBackground;
box-shadow: inset 0 1px $noticeBorder;
background: var(--noticeBackground);
box-shadow: inset 0 1px var(--noticeBorder);
@media #{$mediumScreen} { left: $sidebarMediumWidth; }
@include mobile { left: var(--sidebarMediumWidth); }
._sidebar-hidden & { left: 0; }

@ -7,9 +7,9 @@
max-width: 90%;
padding: .625rem 1rem;
font-size: .75rem;
color: $notifColor;
background: $notifBackground;
border: $notifBorder;
color: var(--notifColor);
background: var(--notifBackground);
border: var(--notifBorder);
border-radius: .25rem;
transition: opacity .2s;
opacity: 0;
@ -30,7 +30,7 @@
._notif-info {
float: right;
color: $notifColorLight;
color: var(--notifColorLight);
}
._notif-link,
@ -69,13 +69,13 @@
&::-webkit-scrollbar { width: 10px !important; }
&::-webkit-scrollbar-track {
background: $notifBackground !important;
background: var(--notifBackground) !important;
border: 0 !important;
border-radius: 5px !important;
}
&::-webkit-scrollbar-thumb {
border: 3px solid $notifBackground !important;
border: 3px solid var(--notifBackground) !important;
&:hover, &:active { border-width: 2px !important; }
}
@ -90,7 +90,7 @@
> ._news-row {
line-height: 1.125rem;
font-size: .6875rem;
color: $notifColorLight;
color: var(--notifColorLight);
margin-bottom: .25rem;
+ ._news-row { margin-top: .625rem; }
@ -107,7 +107,7 @@
._news-date {
float: right;
margin-left: 1rem;
font-weight: $boldFontWeight;
font-weight: var(--boldFontWeight);
}
code {
@ -128,9 +128,13 @@
}
._notif-tip {
color: $textColor;
background: $tipBackground;
border: $tipBorder;
color: var(--textColor);
background: var(--tipBackground);
border: var(--tipBorder);
._notif-info { color: $textColorLight; }
._notif-info { color: var(--textColorLight); }
}
._notif-right {
float: right;
}

@ -23,7 +23,7 @@
max-width: 100%;
margin-bottom: 1em;
padding: 1px;
border: 1px dotted $boxBorder;
border: 1px dotted var(--boxBorder);
border-radius: 3px;
@extend %border-box;
}
@ -50,7 +50,7 @@
display: inline-block;
vertical-align: top;
padding: 0 .5rem;
background: $contentBackground;
background: var(--contentBackground);
@extend %internal-link;
& + & { margin-left: .75rem; }
@ -66,7 +66,7 @@
clear: both;
margin: 2rem 0 1.5rem;
font-size: .75rem;
color: $textColorLight;
color: var(--textColorLight);
text-align: center;
-webkit-font-smoothing: subpixel-antialiased;
@ -78,7 +78,7 @@
display: inline-block;
margin: 0;
padding: .25rem .75rem;
background: $labelBackground;
background: var(--labelBackground);
border-radius: 3px;
}

@ -1,17 +1,17 @@
._path {
position: absolute;
z-index: $noticeZ - 1;
z-index: var(--headerZ);
bottom: 0;
left: $sidebarWidth;
left: var(--sidebarWidth);
right: 0;
height: 2rem;
line-height: 2rem;
padding: 0 .375rem;
font-size: .875rem;
background: $pathBackground;
box-shadow: inset 0 1px $pathBorder;
background: var(--pathBackground);
box-shadow: inset 0 1px var(--pathBorder);
@media #{$mediumScreen} { left: $sidebarMediumWidth; }
@include mobile { left: var(--sidebarMediumWidth); }
._sidebar-hidden & { left: 0; }
@ -24,7 +24,7 @@
display: inline-block;
vertical-align: top;
padding: 0 .375rem;
color: $textColor;
color: var(--textColor);
text-decoration: none;
&:first-child:before {

@ -1,9 +1,26 @@
html {
--prismValue: #905;
--prismText: #5e8e01;
--prismOperator: #a67f59;
--prismKeyword: #0070a3;
--prismFunction: #dd4a68;
--prismVariable: #e90;
}
html._theme-dark {
--prismValue: #eb8160;
--prismText: #ddcf88;
--prismOperator: #b1c676;
--prismKeyword: #91b3ed;
--prismFunction: #c79e6b;
--prismVariable: #e9c062;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata,
.token.punctuation {
color: $textColorLight;
color: var(--textColorLight);
}
.namespace {
@ -17,11 +34,7 @@
.token.constant,
.token.symbol,
.token.deleted {
@if $style == 'dark' {
color: #eb8160;
} @else {
color: #905;
}
color: var(--prismValue);
}
.token.selector,
@ -30,11 +43,7 @@
.token.char,
.token.builtin,
.token.inserted {
@if $style == 'dark' {
color: #ddcf88;
} @else {
color: #5e8e01;
}
color: var(--prismText);
}
.token.operator,
@ -42,44 +51,28 @@
.token.url,
.language-css .token.string,
.style .token.string {
@if $style == 'dark' {
color: #b1c676;
} @else {
color: #a67f59;
}
color: var(--prismOperator);
}
.token.atrule,
.token.attr-value,
.token.keyword {
@if $style == 'dark' {
color: #91b3ed;
} @else {
color: #0070a3;
}
color: var(--prismKeyword);
}
.token.function {
@if $style == 'dark' {
color: #c79e6b;
} @else {
color: #dd4a68;
}
color: var(--prismFunction);
}
.token.regex,
.token.important,
.token.variable {
@if $style == 'dark' {
color: #e9c062;
} @else {
color: #e90;
}
color: var(--prismVariable);
}
.token.important,
.token.bold {
font-weight: $boldFontWeight;
font-weight: var(--boldFontWeight);
}
.token.italic {

@ -7,15 +7,15 @@
position: absolute;
top: 0;
bottom: 0;
z-index: $headerZ;
z-index: var(--headerZ);
&._in { display: block; }
> ._header { justify-content: space-between; }
&._dirty > ._header {
background: $noteGreenBackground;
border-color: $noteGreenBorder;
background: var(--noteGreenBackground);
border-color: var(--noteGreenBorder);
}
}
@ -37,7 +37,7 @@
padding-right: .5rem;
line-height: inherit;
font-size: inherit;
font-weight: $boldFontWeight;
font-weight: var(--boldFontWeight);
text-align: right;
@extend %border-box;
}
@ -52,7 +52,7 @@
> small {
display: block;
color: $textColorLight;
color: var(--textColorLight);
margin-left: 1.75rem;
}
@ -62,7 +62,7 @@
}
}
@media (max-width: $maxWidth) {
@media (max-width: 80rem) {
._setting-max-width { display: none; }
}
@ -80,7 +80,7 @@
line-height: 1.5rem;
padding: 0 .75rem;
font-size: .875rem;
font-weight: $boldFontWeight;
font-weight: var(--boldFontWeight);
color: inherit;
text-align: left;
cursor: pointer;
@ -119,12 +119,12 @@
position: relative;
vertical-align: top;
padding: 0 .75rem;
line-height: $headerHeight;
color: $textColorLight;
line-height: var(--headerHeight);
color: var(--textColorLight);
&.active {
color: $textColor;
font-weight: $boldFontWeight;
box-shadow: inset 0 -2px $linkColor;
color: var(--textColor);
font-weight: var(--boldFontWeight);
box-shadow: inset 0 -2px var(--linkColor);
}
}

@ -4,14 +4,14 @@
._sidebar {
position: absolute;
z-index: $sidebarZ;
z-index: var(--sidebarZ);
top: 0;
bottom: 0;
left: 0;
overflow-x: hidden;
overflow-y: scroll;
padding-top: $headerHeight;
background: $sidebarBackground;
padding-top: var(--headerHeight);
background: var(--sidebarBackground);
background-clip: content-box;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: none; // IE 10 doesn't support pointer-events
@ -22,13 +22,13 @@
._overlay-scrollbars & {
padding-top: 0;
top: $headerHeight;
top: var(--headerHeight);
}
body:not(._native-scrollbars) & {
&::-webkit-scrollbar { width: 10px; }
&::-webkit-scrollbar-track {
background: $contentBackground;
background: var(--contentBackground);
border: 0;
}
&::-webkit-scrollbar-thumb {
@ -52,10 +52,10 @@
._resizer {
position: absolute;
z-index: $sidebarZ + 1;
top: $headerHeight;
bottom: $headerHeight;
left: $sidebarWidth;
z-index: var(--headerZ);
top: var(--headerHeight);
bottom: var(--headerHeight);
left: var(--sidebarWidth);
margin-left: -2px;
width: 3px;
cursor: col-resize;
@ -72,11 +72,11 @@
margin: 0;
padding: 0;
list-style: none;
width: $sidebarWidth;
box-shadow: inset -1px 0 $sidebarBorder;
width: var(--sidebarWidth);
box-shadow: inset -1px 0 var(--sidebarBorder);
@extend %border-box;
@media #{$mediumScreen} { width: $sidebarMediumWidth; }
@include mobile { width: var(--sidebarMediumWidth); }
._sidebar > & { min-height: 100%; }
@ -89,7 +89,7 @@
padding: 0 .75rem 0 2.125rem;
line-height: 2rem;
font-size: .75rem;
color: $textColorLight;
color: var(--textColorLight);
text-transform: uppercase;
cursor: default;
}
@ -110,8 +110,8 @@
line-height: 1.5rem;
font-size: .875rem;
cursor: default;
background: $sidebarBackground;
box-shadow: inset -1px 0 $sidebarBorder;
background: var(--sidebarBackground);
box-shadow: inset -1px 0 var(--sidebarBorder);
@extend %truncate-text;
&, &:hover {
@ -123,16 +123,16 @@
&.focus:hover,
&.active,
&.active:hover {
color: $focusText;
background: $focusBackground;
box-shadow: inset -1px 0 $focusBorder;
color: var(--focusText);
background: var(--focusBackground);
box-shadow: inset -1px 0 var(--focusBorder);
}
&.active,
&.active:hover {
color: $selectionText;
background: $selectionBackground;
box-shadow: inset -1px 0 $selectionBorder;
color: var(--selectionText);
background: var(--selectionBackground);
box-shadow: inset -1px 0 var(--selectionBorder);
}
&:before {
@ -160,7 +160,7 @@
}
._list-count {
color: $textColorLighter;
color: var(--textColorLighter);
pointer-events: none;
._list-disabled:hover > & { display: none; }
@ -168,7 +168,7 @@
._list-enable {
display: none;
color: $linkColor;
color: var(--linkColor);
cursor: pointer;
&:hover { text-decoration: underline; }
@ -188,7 +188,7 @@
._list-disabled {
@extend %_list-dir;
&, &:hover { color: $textColorLight; }
&, &:hover { color: var(--textColorLight); }
&:before { opacity: .7; }
}
@ -200,11 +200,9 @@
width: 1rem;
height: 1rem;
cursor: pointer;
fill: black;
fill: var(--absolute);
opacity: .4;
@if $style == 'dark' { fill: white; }
&:hover { opacity: .65; }
._list-rdir > & {
@ -239,11 +237,11 @@
//
._list-pagelink {
color: $linkColor;
color: var(--linkColor);
cursor: pointer;
&:hover {
color: $linkColorHover;
color: var(--linkColorHover);
text-decoration: underline;
}
}
@ -275,9 +273,9 @@
left: .75rem;
width: .75rem;
height: 1px;
background: rgba($selectionText, .9);
box-shadow: 0 -3px rgba($selectionText, .9), // top line
0 3px rgba($selectionText, .9); // bottom line
background: var(--transparentSelectionText);
box-shadow: 0 -3px var(--transparentSelectionText), // top line
0 3px var(--transparentSelectionText); // bottom line
}
}
@ -289,7 +287,7 @@
padding: .5rem .75rem;
line-height: 1.25rem;
font-size: .8125rem;
color: $textColorLight;
color: var(--textColorLight);
& + & { padding-top: 0; }
}
@ -303,9 +301,9 @@
._list-hover.clone {
position: fixed;
overflow: visible;
z-index: $hoverZ;
z-index: var(--hoverZ);
left: 0;
min-width: $sidebarWidth;
min-width: var(--sidebarWidth);
padding: .25rem .75rem;
pointer-events: none;
-webkit-font-smoothing: subpixel-antialiased;
@ -313,7 +311,7 @@
transform: translate3d(0, 0, 0);
@extend %border-box;
@media #{$mediumScreen} { min-width: $sidebarMediumWidth; }
@include mobile { min-width: var(--sidebarMediumWidth); }
> ._list-text { display: inline; }
@ -346,10 +344,10 @@
padding: .5rem .75rem .25rem .75rem;
line-height: 1.5rem;
font-size: .75rem;
font-weight: $bolderFontWeight;
color: $textColorLight;
font-weight: var(--bolderFontWeight);
color: var(--textColorLight);
text-transform: uppercase;
background: linear-gradient(to bottom, $sidebarBackground, $sidebarBackground 75%, rgba($sidebarBackground, 0));
background: linear-gradient(to bottom, var(--sidebarBackground), var(--sidebarBackground) 75%, var(--transparentSidebarBackground));
cursor: default;
}

@ -1,9 +1,13 @@
html {
height: 100%;
font-size: 100%;
background: $documentBackground;
background: #fff; // fallback to show the error message to browsers that don't support CSS variables.
background: var(--documentBackground);
@media #{$mediumScreen} { font-size: 93.75%; }
@include mobile { font-size: 93.75%; }
@include print { background: none; }
@import 'global/print';
}
body {
@ -14,10 +18,11 @@ body {
font-weight: normal;
font-family: $baseFont;
line-height: 1.7;
color: $textColor;
color: $textColor; // fallback to show the error message to browsers that don't support CSS variables.
color: var(--textColor);
word-wrap: break-word;
overflow-wrap: break-word;
background: $contentBackground;
background: var(--contentBackground);
touch-action: manipulation;
-webkit-tap-highlight-color: rgba(black, 0);
-webkit-touch-callout: none;
@ -26,11 +31,11 @@ body {
}
a {
color: $linkColor;
text-decoration: $linkTextDecoration;
color: var(--linkColor);
text-decoration: var(--linkTextDecoration);
&:hover {
color: $linkColorHover;
color: var(--linkColorHover);
text-decoration: underline;
}
}
@ -44,7 +49,7 @@ img {
h1, h2, h3, h4, h5, h6 {
margin: 1.5em 0 1em;
line-height: 1.3;
font-weight: $bolderFontWeight;
font-weight: var(--bolderFontWeight);
}
h1 { font-size: 1.5em; }
@ -56,7 +61,7 @@ h5, h6 { font-size: 1em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
b, strong { font-weight: $boldFontWeight; }
b, strong { font-weight: var(--boldFontWeight); }
small { font-size: .9em; }
@ -76,7 +81,7 @@ li > ul, li > ol, dd > ul, dd > ol { margin: .5em 0; }
li > p { margin-bottom: .25em; }
dl { margin: 1.5em 0; }
dt { font-weight: $boldFontWeight; }
dt { font-weight: var(--boldFontWeight); }
dd {
margin: .375em;
padding-left: 1em;
@ -88,15 +93,15 @@ dfn, var { font-style: normal; }
abbr, acronym, dfn {
cursor: help;
border-bottom: 1px dotted $textColor;
border-bottom: 1px dotted var(--textColor);
}
pre, code, samp, %pre, %code {
font-family: $monoFont;
font-family: var(--monoFont);
font-weight: normal;
font-style: normal;
font-size: .9em;
color: $textColor;
color: var(--textColor);
white-space: pre-wrap;
direction: ltr;
-moz-tab-size: 2;
@ -118,14 +123,14 @@ a > code { color: inherit; }
table {
margin: 1.5em 0;
background: none;
border: 1px solid $boxBorder;
border: 1px solid var(--boxBorder);
border-collapse: separate;
border-spacing: 0;
border-radius: 3px;
}
caption {
font-weight: $boldFontWeight;
font-weight: var(--boldFontWeight);
padding: 0 .7em .3em;
}
@ -139,15 +144,15 @@ th, td {
}
th {
font-weight: $boldFontWeight;
font-weight: var(--boldFontWeight);
border: 0;
border-bottom: 1px solid $boxBorder;
border-bottom: 1px solid var(--boxBorder);
border-radius: 0;
@extend %heading-box;
&:empty { background: none; }
+ th, + td { border-left: 1px solid $boxBorder; }
+ th, + td { border-left: 1px solid var(--boxBorder); }
tr:first-child > &:first-child { border-top-left-radius: 3px; }
tr:first-child > &:last-child { border-top-right-radius: 3px; }
@ -158,10 +163,10 @@ th {
}
td {
background: $contentBackground;
border-bottom: 1px solid $boxBorderLight;
background: var(--contentBackground);
border-bottom: 1px solid var(--boxBorderLight);
+ td { border-left: 1px solid $boxBorderLight; }
+ td { border-left: 1px solid var(--boxBorderLight); }
tr:last-child > & { border-bottom: 0; }
> pre:only-child, > p:only-child, > ul:only-child, > ol:only-child {
@ -187,7 +192,7 @@ input, button {
margin: 0;
font-family: inherit;
font-size: 100%;
color: $textColor;
color: var(--textColor);
line-height: normal;
@extend %border-box;
}
@ -215,6 +220,10 @@ button:focus {
outline: -webkit-focus-ring-color auto 5px;
}
img, iframe {
background: var(--externalsBackground);
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
@ -227,9 +236,9 @@ input[type="search"]::-webkit-search-decoration {
border: 0 !important;
}
::-webkit-input-placeholder { color: $textColorLighter; }
::-moz-placeholder { color: $textColorLighter; opacity: 1; }
:-ms-input-placeholder { color: $textColorLighter; }
::-webkit-input-placeholder { color: var(--textColorLighter); }
::-moz-placeholder { color: var(--textColorLighter); opacity: 1; }
:-ms-input-placeholder { color: var(--textColorLighter); }
body:not(._native-scrollbars) {
*::-webkit-scrollbar { -webkit-appearance: none; }
@ -240,12 +249,12 @@ body:not(._native-scrollbars) {
*::-webkit-scrollbar-corner { display: none; }
*::-webkit-scrollbar-track {
background: $contentBackground;
border: 1px solid $contentBackground;
background: var(--contentBackground);
border: 1px solid var(--contentBackground);
&:hover {
background: $sidebarBackground;
border-color: $sidebarBorder;
background: var(--sidebarBackground);
border-color: var(--sidebarBorder);
}
&:vertical { border-width: 0 0 0 1px; }
@ -263,14 +272,14 @@ body:not(._native-scrollbars) {
*::-webkit-scrollbar-thumb {
min-height: 2rem;
background: $scrollbarColor;
background: var(--scrollbarColor);
background-clip: padding-box;
border: 5px solid rgba(black, 0);
border-radius: 10px;
&:hover,
&:active {
background-color: $scrollbarColorHover;
background-color: var(--scrollbarColorHover);
border-width: 4px;
}
}

@ -36,15 +36,15 @@
//
%box {
background: $boxBackground;
border: 1px solid $boxBorder;
background: var(--boxBackground);
border: 1px solid var(--boxBorder);
border-radius: 3px;
}
%heading-box {
color: $boxHeaderColor;
background: $boxHeaderBackground;
border: 1px solid $boxBorder;
color: var(--boxHeaderColor);
background: var(--boxHeaderBackground);
border: 1px solid var(--boxBorder);
border-radius: 3px;
}
@ -82,15 +82,15 @@
%note {
margin: 1.5rem 0;
padding: .5rem .875rem;
background: $noteBackground;
border: 1px solid $noteBorder;
background: var(--noteBackground);
border: 1px solid var(--noteBorder);
border-radius: 3px;
}
%label {
margin: 0 1px;
padding: 1px 4px 2px;
background: $labelBackground;
background: var(--labelBackground);
border-radius: 3px;
}
@ -102,35 +102,35 @@
padding-right: .5em;
overflow: hidden;
font-size: inherit;
color: $boxHeaderColor;
border: 1px solid $boxBorder;
color: var(--boxHeaderColor);
border: 1px solid var(--boxBorder);
border-radius: 2px;
@extend %label;
}
%label-yellow {
background: $noteBackground;
border-color: $noteBorder;
background: var(--noteBackground);
border-color: var(--noteBorder);
}
%note-green, %label-green {
background: $noteGreenBackground;
border-color: $noteGreenBorder;
background: var(--noteGreenBackground);
border-color: var(--noteGreenBorder);
}
%note-blue, %label-blue {
background: $noteBlueBackground;
border-color: $noteBlueBorder;
background: var(--noteBlueBackground);
border-color: var(--noteBlueBorder);
}
%note-orange, %label-orange {
background: $noteOrangeBackground;
border-color: $noteOrangeBorder;
background: var(--noteOrangeBackground);
border-color: var(--noteOrangeBorder);
}
%note-red, %label-red {
background: $noteRedBackground;
border-color: $noteRedBorder;
background: var(--noteRedBackground);
border-color: var(--noteRedBorder);
}
//
@ -149,12 +149,11 @@
pointer-events: none;
// <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15,15H2V6h2.595c0,0,0.689-0.896,2.17-2H1C0.447,4,0,4.449,0,5v11c0,0.553,0.447,1,1,1h15c0.553,0,1-0.447,1-1v-3.746 l-2,1.645V15z M13.361,8.05v3.551L20,6.4l-6.639-4.999v3.131C5.3,4.532,5.3,12.5,5.3,12.5C7.582,8.752,8.986,8.05,13.361,8.05z"/></svg>
@if $style == 'dark' {
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
} @else {
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
}
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
}
}
html._theme-dark %external-link:after {
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
}
%internal-link:after { content: none !important; }

@ -1,166 +0,0 @@
%svg-icon {
display: inline-block;
vertical-align: top;
width: 1rem;
height: 1rem;
pointer-events: none;
fill: currentColor;
}
%doc-icon {
content: '';
display: block;
width: 1rem;
height: 1rem;
background-image: image-url('docs-1.png');
background-size: 10rem 10rem;
}
%doc-icon-2 { background-image: image-url('docs-2.png') !important; }
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
%doc-icon { background-image: image-url('docs-1@2x.png'); }
%doc-icon-2 { background-image: image-url('docs-2@2x.png') !important; }
}
%darkIconFix {
@if $style == 'dark' {
filter: invert(100%) grayscale(100%);
-webkit-filter: invert(100%) grayscale(100%);
}
}
._icon-jest:before { background-position: 0 0; }
._icon-liquid:before { background-position: -1rem 0; }
._icon-openjdk:before { background-position: -2rem 0; }
._icon-codeceptjs:before { background-position: -3rem 0; }
._icon-codeception:before { background-position: -4rem 0; }
._icon-sqlite:before { background-position: -5rem 0; @extend %darkIconFix !optional; }
._icon-async:before { background-position: -6rem 0; @extend %darkIconFix !optional; }
._icon-http:before { background-position: -7rem 0; @extend %darkIconFix !optional; }
._icon-jquery:before { background-position: -8rem 0; @extend %darkIconFix !optional; }
._icon-underscore:before { background-position: -9rem 0; @extend %darkIconFix !optional; }
._icon-html:before { background-position: 0 -1rem; }
._icon-css:before { background-position: -1rem -1rem; }
._icon-dom:before { background-position: -2rem -1rem; }
._icon-dom_events:before { background-position: -3rem -1rem; }
._icon-javascript:before { background-position: -4rem -1rem; }
._icon-backbone:before { background-position: -5rem -1rem; @extend %darkIconFix !optional; }
._icon-node:before,
._icon-node_lts:before { background-position: -6rem -1rem; }
._icon-sass:before { background-position: -7rem -1rem; }
._icon-less:before { background-position: -8rem -1rem; }
._icon-angularjs:before { background-position: -9rem -1rem; }
._icon-coffeescript:before { background-position: 0 -2rem; @extend %darkIconFix !optional; }
._icon-ember:before { background-position: -1rem -2rem; }
._icon-yarn:before { background-position: -2rem -2rem; }
._icon-immutable:before { background-position: -3rem -2rem; @extend %darkIconFix !optional; }
._icon-jqueryui:before { background-position: -4rem -2rem; }
._icon-jquerymobile:before { background-position: -5rem -2rem; }
._icon-lodash:before { background-position: -6rem -2rem; }
._icon-php:before { background-position: -7rem -2rem; }
._icon-ruby:before,
._icon-minitest:before { background-position: -8rem -2rem; }
._icon-rails:before { background-position: -9rem -2rem; }
._icon-python:before,
._icon-python2:before { background-position: 0 -3rem; }
._icon-git:before { background-position: -1rem -3rem; }
._icon-redis:before { background-position: -2rem -3rem; }
._icon-postgresql:before { background-position: -3rem -3rem; }
._icon-d3:before { background-position: -4rem -3rem; }
._icon-knockout:before { background-position: -5rem -3rem; }
._icon-moment:before { background-position: -6rem -3rem; @extend %darkIconFix !optional; }
._icon-c:before { background-position: -7rem -3rem; }
._icon-statsmodels:before { background-position: -8rem -3rem; }
._icon-yii:before,
._icon-yii1:before { background-position: -9rem -3rem; }
._icon-cpp:before { background-position: 0 -4rem; }
._icon-go:before { background-position: -1rem -4rem; }
._icon-express:before { background-position: -2rem -4rem; }
._icon-grunt:before { background-position: -3rem -4rem; }
._icon-rust:before { background-position: -4rem -4rem; @extend %darkIconFix !optional; }
._icon-laravel:before { background-position: -5rem -4rem; }
._icon-haskell:before { background-position: -6rem -4rem; }
._icon-requirejs:before { background-position: -7rem -4rem; }
._icon-chai:before { background-position: -8rem -4rem; }
._icon-sinon:before { background-position: -9rem -4rem; }
._icon-cordova:before { background-position: 0 -5rem; }
._icon-markdown:before { background-position: -1rem -5rem; @extend %darkIconFix !optional; }
._icon-django:before { background-position: -2rem -5rem; }
._icon-xslt_xpath:before { background-position: -3rem -5rem; }
._icon-nginx:before,
._icon-nginx_lua_module:before { background-position: -4rem -5rem; }
._icon-svg:before { background-position: -5rem -5rem; }
._icon-marionette:before { background-position: -6rem -5rem; }
._icon-mongoose:before { background-position: -7rem -5rem; }
._icon-phpunit:before { background-position: -8rem -5rem; }
._icon-nokogiri:before { background-position: -9rem -5rem; @extend %darkIconFix !optional; }
._icon-rethinkdb:before { background-position: 0 -6rem; }
._icon-react:before { background-position: -1rem -6rem; }
._icon-socketio:before { background-position: -2rem -6rem; }
._icon-modernizr:before { background-position: -3rem -6rem; }
._icon-bower:before { background-position: -4rem -6rem; }
._icon-fish:before { background-position: -5rem -6rem; @extend %darkIconFix !optional; }
._icon-scikit_image:before { background-position: -6rem -6rem; }
._icon-twig:before { background-position: -7rem -6rem; }
._icon-pandas:before { background-position: -8rem -6rem; }
._icon-scikit_learn:before { background-position: -9rem -6rem; }
._icon-bottle:before { background-position: 0 -7rem; }
._icon-docker:before { background-position: -1rem -7rem; }
._icon-cakephp:before { background-position: -2rem -7rem; }
._icon-lua:before { background-position: -3rem -7rem; @extend %darkIconFix !optional; }
._icon-clojure:before { background-position: -4rem -7rem; }
._icon-symfony:before { background-position: -5rem -7rem; }
._icon-mocha:before { background-position: -6rem -7rem; }
._icon-meteor:before { background-position: -7rem -7rem; @extend %darkIconFix !optional; }
._icon-npm:before { background-position: -8rem -7rem; }
._icon-apache_http_server:before { background-position: -9rem -7rem; }
._icon-drupal:before { background-position: 0 -8rem; }
._icon-webpack:before { background-position: -1rem -8rem; }
._icon-phaser:before { background-position: -2rem -8rem; }
._icon-vue:before { background-position: -3rem -8rem; }
._icon-opentsdb:before { background-position: -4rem -8rem; }
._icon-q:before { background-position: -5rem -8rem; }
._icon-crystal:before { background-position: -6rem -8rem; @extend %darkIconFix !optional; }
._icon-julia:before { background-position: -7rem -8rem; @extend %darkIconFix !optional; }
._icon-redux:before { background-position: -8rem -8rem; @extend %darkIconFix !optional; }
._icon-bootstrap:before { background-position: -9rem -8rem; }
._icon-react_native:before { background-position: 0 -9rem; }
._icon-phalcon:before { background-position: -1rem -9rem; }
._icon-matplotlib:before { background-position: -2rem -9rem; }
._icon-cmake:before { background-position: -3rem -9rem; }
._icon-elixir:before { background-position: -4rem -9rem; @extend %darkIconFix !optional; }
._icon-vagrant:before { background-position: -5rem -9rem; }
._icon-dojo:before { background-position: -6rem -9rem; }
._icon-flow:before { background-position: -7rem -9rem; }
._icon-relay:before { background-position: -8rem -9rem; }
._icon-phoenix:before { background-position: -9rem -9rem; }
._icon-tcl_tk:before { background-position: 0 0; @extend %doc-icon-2; }
._icon-erlang:before { background-position: -1rem 0; @extend %doc-icon-2; }
._icon-chef:before { background-position: -2rem 0; @extend %doc-icon-2; }
._icon-ramda:before { background-position: -3rem 0; @extend %doc-icon-2; @extend %darkIconFix !optional; }
._icon-codeigniter:before { background-position: -4rem 0; @extend %doc-icon-2; @extend %darkIconFix !optional; }
._icon-influxdata:before { background-position: -5rem 0; @extend %doc-icon-2; @extend %darkIconFix !optional; }
._icon-tensorflow:before { background-position: -6rem 0; @extend %doc-icon-2; }
._icon-haxe:before { background-position: -7rem 0; @extend %doc-icon-2; }
._icon-ansible:before { background-position: -8rem 0; @extend %doc-icon-2; @extend %darkIconFix !optional; }
._icon-typescript:before { background-position: -9rem 0; @extend %doc-icon-2; }
._icon-browser_support_tables:before { background-position: 0rem -1rem; @extend %doc-icon-2; }
._icon-gnu_fortran:before { background-position: -1rem -1rem; @extend %doc-icon-2; }
._icon-gcc:before { background-position: -2rem -1rem; @extend %doc-icon-2; }
._icon-perl:before { background-position: -3rem -1rem; @extend %doc-icon-2; }
._icon-apache_pig:before { background-position: -4rem -1rem; @extend %doc-icon-2; }
._icon-numpy:before { background-position: -5rem -1rem; @extend %doc-icon-2; }
._icon-kotlin:before { background-position: -6rem -1rem; @extend %doc-icon-2; }
._icon-padrino:before { background-position: -7rem -1rem; @extend %doc-icon-2; }
._icon-angular:before { background-position: -8rem -1rem; @extend %doc-icon-2; }
._icon-love:before { background-position: -9rem -1rem; @extend %doc-icon-2; }
._icon-jasmine:before { background-position: 0 -2rem; @extend %doc-icon-2; }
._icon-pug:before { background-position: -1rem -2rem; @extend %doc-icon-2; }
._icon-electron:before { background-position: -2rem -2rem; @extend %doc-icon-2; }
._icon-falcon:before { background-position: -3rem -2rem; @extend %doc-icon-2; }
._icon-godot:before { background-position: -4rem -2rem; @extend %doc-icon-2; }
._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; }

@ -0,0 +1,43 @@
<% manifest = JSON.parse(File.read('assets/images/sprites/docs.json')) %>
%svg-icon {
display: inline-block;
vertical-align: top;
width: 1rem;
height: 1rem;
pointer-events: none;
fill: currentColor;
}
%doc-icon {
content: '';
display: block;
width: 1rem;
height: 1rem;
background-image: image-url('sprites/docs.png');
background-size: <%= manifest['icons_per_row'] %>rem <%= manifest['icons_per_row'] %>rem;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
%doc-icon { background-image: image-url('sprites/docs@2x.png'); }
}
html._theme-dark {
%darkIconFix {
filter: invert(100%) grayscale(100%);
-webkit-filter: invert(100%) grayscale(100%);
}
}
<%=
items = []
manifest['items'].each do |item|
rules = []
rules << "background-position: -#{item['col']}rem -#{item['row']}rem;"
rules << "@extend %darkIconFix !optional;" if item['dark_icon_fix']
items << "._icon-#{item['type']}:before { #{rules.join(' ')} }"
end
items.join('')
%>

@ -0,0 +1,15 @@
//
// Mixins
//
@mixin print {
@media print {
@content;
}
}
@mixin mobile {
@media (max-width: 800px) {
@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 var(--boxBorder);
}
._attribution:last-child:after {
content: 'Exported from DevDocs \2014 https://devdocs.io';
display: block;
margin-top: 1rem;
font-weight: var(--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;
}
}

@ -1,92 +1,76 @@
$baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
$monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
$boldFontWeight: 500;
$bolderFontWeight: 600;
html._theme-dark {
--absolute: white;
$style: 'dark';
--documentBackground: #222;
--contentBackground: #33373a;
$maxWidth: 80rem;
$headerHeight: 3rem;
$sidebarWidth: 20rem;
$sidebarMediumWidth: 16rem;
--textColor: #cbd0d0;
--textColorLight: #9da5ad;
--textColorLighter: #77787a;
$documentBackground: #222;
$contentBackground: #33373a;
--externalsBackground: #fff;
$textColor: #cbd0d0;
$textColorLight: #9da5ad;
$textColorLighter: #77787a;
$textColorRed: #f44336;
--inputFocusBorder: transparent;
$inputFocusBorder: false;
--focusBackground: #3f4042;
--focusBorder: #000;
--focusText: #f7f2f2;
$focusBackground: #3f4042;
$focusBorder: #000;
$focusText: #f7f2f2;
--loadingText: #5d6164;
$loadingText: #5d6164;
$splashText: $loadingText;
--selectionBackground: #007acc;
--selectionBorder: #000;
$selectionBackground: #007acc;
$selectionBorder: #000;
$selectionText: #fff;
--highlightBackground: #64675f;
$highlightBackground: #64675f;
--linkColor: var(--textColor);
--linkColorHover: white;
--linkTextDecoration: underline;
$linkColor: $textColor;
$linkColorHover: white;
$linkTextDecoration: underline;
--headerBackground: #1c1c1c;
--headerBorder: #000;
--searchTagBackground: #{darken(#1c1c1c, 5%)};
--searchBorder: #{darken(#000, 2%)};
$headerBackground: #1c1c1c;
$headerBorder: #000;
--sidebarBackground: #24282a;
--transparentSidebarBackground: #{rgba(#24282a, 0)};
--sidebarBorder: #000;
$sidebarBackground: #24282a;
$sidebarBorder: #000;
--scrollbarColor: #6c6c6f;
--scrollbarColorHover: #949697;
$scrollbarColor: #6c6c6f;
$scrollbarColorHover: #949697;
--pathBackground: var(--headerBackground);
--pathBorder: var(--headerBorder);
$pathBackground: $headerBackground;
$pathBorder: $headerBorder;
--noticeBackground: var(--sidebarBackground);
--noticeBorder: var(--sidebarBorder);
$noticeBackground: $sidebarBackground;
$noticeBorder: $sidebarBorder;
--boxBackground: var(--sidebarBackground);
--boxBorder: var(--headerBorder);
--boxBorderLight: var(--headerBorder);
--boxHeaderColor: #dbe4e4;
--boxHeaderBackground: var(--sidebarBackground);
$boxBackground: $sidebarBackground;
$boxBorder: $headerBorder;
$boxBorderLight: $headerBorder;
$boxHeaderColor: #dbe4e4;
$boxHeaderBackground: $sidebarBackground;
--noteBackground: #45474b;
--noteBorder: #000;
$noteBackground: #45474b;
$noteBorder: #000;
--noteGreenBackground: #284a2a;
--noteGreenBorder: #000;
$noteGreenBackground: #284a2a;
$noteGreenBorder: #000;
--noteBlueBackground: #2a4151;
--noteBlueBorder: #000;
$noteBlueBackground: #2a4151;
$noteBlueBorder: #000;
--noteOrangeBackground: #563322;
--noteOrangeBorder: #000;
$noteOrangeBackground: #563322;
$noteOrangeBorder: #000;
--noteRedBackground: #603033;
--noteRedBorder: #000;
$noteRedBackground: #603033;
$noteRedBorder: #000;
--labelBackground: var(--boxBackground);
$labelBackground: $boxBackground;
--notifBackground: #{rgba(#555, .95)};
--notifBorder: 1px solid #000;
$notifBackground: rgba(#555, .95);
$notifBorder: 1px solid #000;
$notifColor: #fff;
$notifColorLight: #ccc;
$tipBackground: $notifBackground;
$tipBorder: $notifBorder;
$mediumScreen: '(max-width: 800px)';
$contentZ: 1;
$sidebarZ: 2;
$headerZ: 3;
$noticeZ: 4;
$hoverZ: 5;
--tipBackground: var(--notifBackground);
--tipBorder: var(--notifBorder);
}

@ -0,0 +1,76 @@
html._theme-default {
--absolute: black;
--documentBackground: #f3f3f3;
--contentBackground: #fff;
--textColor: #333;
--textColorLight: #666;
--textColorLighter: #888;
--externalsBackground: #fff;
--inputFocusBorder: #35b5f4;
--focusBackground: #e5e5e5;
--focusBorder: #d4d4d4;
--focusText: #000;
--loadingText: #ccc;
--selectionBackground: #398df0;
--selectionBorder: #196fc2;
--highlightBackground: #fffdcd;
--linkColor: #3377c0;
--linkColorHover: #2f6cb6;
--linkTextDecoration: none;
--headerBackground: #eee;
--headerBorder: #d7d7d7;
--searchTagBackground: #{darken(#eee, 5%)};
--searchBorder: #{darken(#d7d7d7, 2%)};
--sidebarBackground: #f9f9f9;
--transparentSidebarBackground: #{rgba(#f9f9f9, 0)};
--sidebarBorder: #e1e1e1;
--scrollbarColor: #ccc;
--scrollbarColorHover: #999;
--pathBackground: var(--sidebarBackground);
--pathBorder: var(--sidebarBorder);
--noticeBackground: #faf9e2;
--noticeBorder: #e2e2c1;
--boxBackground: #fafafa;
--boxBorder: #d8d8d8;
--boxBorderLight: #e5e5e5;
--boxHeaderColor: var(--textColor);
--boxHeaderBackground: #f5f5f5;
--noteBackground: #f8f8dd;
--noteBorder: #d3d952;
--noteGreenBackground: #e7f8e1;
--noteGreenBorder: #89da70;
--noteBlueBackground: #d4f3fd;
--noteBlueBorder: #94bbeb;
--noteOrangeBackground: #fbe6d1;
--noteOrangeBorder: #ec8b01;
--noteRedBackground: #fed5d3;
--noteRedBorder: #dc7874;
--labelBackground: #f4f4f4;
--notifBackground: #{rgba(#333, .85)};
--notifBorder: none;
--tipBackground: #{rgba(#fffdcd, .95)};
--tipBorder: 1px solid #e7dca9;
}

@ -1,92 +1,35 @@
// Variables needed to style the error message for browsers that don't support CSS variables.
$baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
$monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
$boldFontWeight: 500;
$bolderFontWeight: 600;
$style: 'light';
$maxWidth: 80rem;
$headerHeight: 3rem;
$sidebarWidth: 20rem;
$sidebarMediumWidth: 16rem;
$documentBackground: #f3f3f3;
$contentBackground: #fff;
$textColor: #333;
$textColorLight: #666;
$textColorLighter: #888;
$textColorRed: #f44336;
$inputFocusBorder: #35b5f4;
$focusBackground: #e5e5e5;
$focusBorder: #d4d4d4;
$focusText: #000;
$loadingText: #ccc;
$splashText: #ccc;
$selectionBackground: #398df0;
$selectionBorder: #196fc2;
$selectionText: #fff;
$highlightBackground: #fffdcd;
$linkColor: #3377c0;
$linkColorHover: #2f6cb6;
$linkTextDecoration: none;
$headerBackground: #eee;
$headerBorder: #d7d7d7;
$sidebarBackground: #f9f9f9;
$sidebarBorder: #e1e1e1;
$scrollbarColor: #ccc;
$scrollbarColorHover: #999;
$pathBackground: $sidebarBackground;
$pathBorder: $sidebarBorder;
$noticeBackground: #faf9e2;
$noticeBorder: #e2e2c1;
$boxBackground: #fafafa;
$boxBorder: #d8d8d8;
$boxBorderLight: #e5e5e5;
$boxHeaderColor: $textColor;
$boxHeaderBackground: #f5f5f5;
$noteBackground: #f8f8dd;
$noteBorder: #d3d952;
$noteGreenBackground: #e7f8e1;
$noteGreenBorder: #89da70;
$noteBlueBackground: #d4f3fd;
$noteBlueBorder: #94bbeb;
html {
--baseFont: #{$baseFont};
--monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
--boldFontWeight: 500;
--bolderFontWeight: 600;
$noteOrangeBackground: #fbe6d1;
$noteOrangeBorder: #ec8b01;
--textColorRed: #f44336;
$noteRedBackground: #fed5d3;
$noteRedBorder: #dc7874;
--splashText: var(--loadingText);
$labelBackground: #f4f4f4;
--selectionText: #fff;
--transparentSelectionText: rgba(255, 255, 255, 0.9);
$notifBackground: rgba(#333, .85);
$notifBorder: none;
$notifColor: #fff;
$notifColorLight: #ccc;
--notifColor: #fff;
--notifColorLight: #ccc;
$tipBackground: rgba(#fffdcd, .95);
$tipBorder: 1px solid #e7dca9;
--maxWidth: 80rem;
--headerHeight: 3rem;
--sidebarWidth: 20rem;
--sidebarMediumWidth: 16rem;
$mediumScreen: '(max-width: 800px)';
--focusBackground: #e5e5e5;
--focusBorder: #d4d4d4;
--focusText: #000;
$contentZ: 1;
$sidebarZ: 2;
$headerZ: 3;
$noticeZ: 4;
$hoverZ: 5;
--contentZ: 1;
--sidebarZ: 2;
--headerZ: 3;
--noticeZ: 4;
--hoverZ: 5;
}

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

@ -8,7 +8,7 @@
.nav-index-section {
margin: 1.5em 0 1em -2em;
list-style: none;
font-weight: $boldFontWeight;
font-weight: var(--boldFontWeight);
text-transform: capitalize;
}

@ -3,13 +3,13 @@
h3 > .type-signature {
float: right;
color: $textColorLight;
color: var(--textColorLight);
}
h3 > .signature-attributes {
font-size: .75rem;
font-weight: normal;
font-style: italic;
color: $textColorLighter;
color: var(--textColorLighter);
}
}

@ -0,0 +1,12 @@
._bash {
dl > dt > code,
dl > dt > kbd {
@extend %block-label, %label-blue;
}
th[align=left] {
border-left: 1px solid var(--boxBorder);
}
code { @extend %label; }
}

@ -4,7 +4,7 @@
h4 > code, h5 > code, strong > code { @extend %label; }
h2 > small {
color: $textColorLight;
color: var(--textColorLight);
float: right;
}

@ -23,7 +23,7 @@
.t-spar { // language/switch, language/for, etc.
font-style: italic;
color: $textColorLight;
color: var(--textColorLight);
}
.t-sdsc-nopad dl, .t-sdsc-nopad dd { margin: 0; }
@ -46,6 +46,8 @@
+ div { margin-left: .5em; }
}
> table { margin: 0; }
}
.t-dcl-rev-aux > td:empty { padding: 0; }
@ -55,7 +57,7 @@
margin: 1rem 0;
padding: .375rem;
font-size: .75rem;
border: 1px solid $boxBorder;
border: 1px solid var(--boxBorder);
border-radius: 2px;
}

@ -5,6 +5,6 @@
.type {
float: right;
font-size: .9em;
color: $textColorLight;
color: var(--textColorLight);
}
}

@ -2,10 +2,10 @@
h2 { @extend %block-heading; }
h3, .d_decl { @extend %block-label, %label-blue; }
.d_decl { @extend %code; }
.d_decl > small { color: $textColorLight; }
.d_decl > strong { font-weight: $bolderFontWeight; }
.d_decl > small { color: var(--textColorLight); }
.d_decl > strong { font-weight: var(--bolderFontWeight); }
p > code, li > code, td > code, dd > code { @extend %label; }
span.red { color: $textColorRed; }
span.red { color: var(--textColorRed); }
}

@ -0,0 +1,12 @@
._dart {
@extend %simple;
dl:not(.dl-horizontal) dt, .multi-line-signature {
@extend %block-label;
.features {
float: right;
color: var(--textColorLight);
}
}
}

@ -1,5 +1,5 @@
._dojo {
@extend %simple;
.jsdoc-inheritance { color: $textColorLight; }
.jsdoc-inheritance { color: var(--textColorLight); }
}

@ -5,7 +5,7 @@
h3 > .access {
float: right;
color: $textColorLight;
color: var(--textColorLight);
font-weight: normal;
}
@ -15,6 +15,6 @@
}
p.github-link {
color: $textColorLight;
color: var(--textColorLight);
}
}

@ -5,5 +5,5 @@
code.code { @extend %label; }
.note { @extend %note; }
.warning { @extend %note, %note-red; }
.note .label, .warning .label { font-weight: $boldFontWeight; }
.note .label, .warning .label { font-weight: var(--boldFontWeight); }
}

@ -0,0 +1,7 @@
._graphite {
@extend %simple;
dl > dt {
@extend %block-label, %label-blue;
}
}

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

Loading…
Cancel
Save