Skip to content

Commit 5438143

Browse files
committed
Fix merge conflicts
2 parents 4355631 + ac50e99 commit 5438143

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+761
-255
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ indent_style = space
66
indent_size = 2
77
insert_final_newline = true
88
trim_trailing_whitespace = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false

.github/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ Want to contribute? Great. Please review the following guidelines carefully and
2424
## Requesting new features
2525

2626
1. Search for similar feature requests; someone may have already requested it.
27-
2. Make sure your feature fits DevDocs's [vision](https://github.com/freeCodeCamp/devdocs/blob/master/README.md#vision).
27+
2. Make sure your feature fits DevDocs's [vision](../README.md#vision).
2828
3. Provide a clear and detailed explanation of the feature and why it's important to add it.
2929

3030
## Requesting new documentations
3131

32-
Please don't open issues to request new documentations.
32+
Please don't open issues to request new documentations.
3333
Use the [Trello board](https://trello.com/b/6BmTulfx/devdocs-documentation) where everyone can vote.
3434

3535
## Contributing code and features
@@ -44,7 +44,7 @@ Use the [Trello board](https://trello.com/b/6BmTulfx/devdocs-documentation) wher
4444

4545
## Contributing new documentations
4646

47-
See the [wiki](https://github.com/freeCodeCamp/devdocs/wiki) to learn how to add new documentations.
47+
See the [`docs` folder](https://github.com/freeCodeCamp/devdocs/tree/master/docs) to learn how to add new documentations.
4848

4949
**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.
5050

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
.bundle
3+
log
34
tmp
45
public/assets
56
public/fonts

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@ cache: bundler
55
before_script:
66
- gem update --system
77
- gem install bundler
8+
9+
deploy:
10+
provider: heroku
11+
app: devdocs
12+
on:
13+
branch: master
14+
api_key:
15+
secure: "4p1klvWJZSOImzFcKOduILjP93hlOlAhceWlYMKS4tU+TCFE8qTBzdKdFPSCsCgjB+YR9pBss+L0lJpVVMjSwFHXqpKe6EeUSltO2k7DFHfW7kXLUM/L0AfqXz+YXk76XUyZMhvOEbldPfaMaj10e8vgDOQCSHABDyK/4CU+hnI="

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
> Our Code of Conduct is available here: <https://code-of-conduct.freecodecamp.org/>

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM ruby:2.6.0
22

33
ENV LANG=C.UTF-8
4+
ENV ENABLE_SERVICE_WORKER=true
45

56
WORKDIR /devdocs
67

Dockerfile-alpine

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM ruby:2.6.0-alpine
22

33
ENV LANG=C.UTF-8
4+
ENV ENABLE_SERVICE_WORKER=true
45

56
WORKDIR /devdocs
67

PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
If you’re adding a new scraper, please ensure that you have:
2+
3+
- [ ] Tested the scraper on a local copy of DevDocs
4+
- [ ] Ensured that the docs are styled similarly to other docs on DevDocs
5+
<!-- If the docs don’t have an icon, delete the next four items: -->
6+
- [ ] Added these files to the <code>public/icons/*your_scraper_name*/</code> directory:
7+
- [ ] `16.png`: a 16×16 pixel icon for the doc
8+
- [ ] `[email protected]`: a 32×32 pixel icon for the doc
9+
- [ ] `SOURCE`: A text file containing the URL to the page the image can be found on or the URL of the original image itself
10+
11+
<!-- Replace the `[ ]` with a `[x]` once you’ve completed each step. -->

README.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Keep track of development news:
1010
* Watch the repository on [GitHub](https://github.com/freeCodeCamp/devdocs/subscription)
1111
* Follow [@DevDocs](https://twitter.com/DevDocs) on Twitter
1212

13-
**Table of Contents:** [Quick Start](#quick-start) · [Vision](#vision) · [App](#app) · [Scraper](#scraper) · [Commands](#available-commands) · [Contributing](#contributing) · [License](#copyright--license) · [Questions?](#questions)
13+
**Table of Contents:** [Quick Start](#quick-start) · [Vision](#vision) · [App](#app) · [Scraper](#scraper) · [Commands](#available-commands) · [Contributing](#contributing) · [Documentation](#documentation) · [Plugins and Extensions](#plugins-and-extensions) · [License](#copyright--license) · [Questions?](#questions)
1414

1515
## Quick Start
1616

@@ -59,14 +59,14 @@ The web app is all client-side JavaScript, written in [CoffeeScript](http://coff
5959

6060
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.
6161

62-
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.
62+
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.
6363

6464
DevDocs being a developer tool, the browser requirements are high:
6565

6666
* Recent versions of Firefox, Chrome, or Opera
67-
* Safari 9.1+
68-
* Edge 16+
69-
* iOS 10+
67+
* Safari 11.1+
68+
* Edge 17+
69+
* iOS 11.3+
7070

7171
This allows the code to take advantage of the latest DOM and HTML5 APIs and make developing DevDocs a lot more fun!
7272

@@ -83,12 +83,13 @@ Modifications made to each document include:
8383
* replacing all external (not scraped) URLs with their fully qualified counterpart
8484
* replacing all internal (scraped) URLs with their unqualified and relative counterpart
8585
* adding content, such as a title and link to the original document
86+
* ensuring correct syntax highlighting using [Prism](http://prismjs.com/)
8687

8788
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.
8889

8990
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.).
9091

91-
More information about scrapers and filters is available on the [wiki](https://github.com/freeCodeCamp/devdocs/wiki).
92+
More information about [scrapers](./docs/scraper-reference.md) and [filters](./docs/filter-reference.md) is available in the `docs` folder.
9293

9394
## Available Commands
9495

@@ -128,15 +129,40 @@ If multiple versions of Ruby are installed on your system, commands must be run
128129

129130
## Contributing
130131

131-
Contributions are welcome. Please read the [contributing guidelines](https://github.com/freeCodeCamp/devdocs/blob/master/.github/CONTRIBUTING.md).
132-
133-
DevDocs's own documentation is available on the [wiki](https://github.com/freeCodeCamp/devdocs/wiki).
132+
Contributions are welcome. Please read the [contributing guidelines](./.github/CONTRIBUTING.md).
133+
134+
## Documentation
135+
136+
* [Adding documentations to DevDocs](./docs/adding-docs.md)
137+
* [Scraper Reference](./docs/scraper-reference.md)
138+
* [Filter Reference](./docs/filter-reference.md)
139+
* [Maintainers’ Guide](./docs/maintainers.md)
140+
141+
## Plugins and Extensions
142+
143+
* [Chrome web app](https://chrome.google.com/webstore/detail/devdocs/mnfehgbmkapmjnhcnbodoamcioleeooe)
144+
* [Ubuntu Touch app](https://uappexplorer.com/app/devdocsunofficial.berkes)
145+
* [Sublime Text plugin](https://sublime.wbond.net/packages/DevDocs)
146+
* [Atom plugin](https://atom.io/packages/devdocs)
147+
* [Brackets extension](https://github.com/gruehle/dev-docs-viewer)
148+
* [Fluid](http://fluidapp.com) for turning DevDocs into a real OS X app
149+
* [GTK shell / Vim integration](https://github.com/naquad/devdocs-shell)
150+
* [Emacs lookup](https://github.com/skeeto/devdocs-lookup)
151+
* [Alfred Workflow](https://github.com/yannickglt/alfred-devdocs)
152+
* [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.
153+
* [Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=akfish.vscode-devdocs ) (1)
154+
* [Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=deibit.devdocs) (2)
155+
* [Desktop application](https://github.com/egoist/devdocs-desktop)
156+
* [Doc Browser](https://github.com/qwfy/doc-browser) is a native Linux app that supports DevDocs docsets
157+
* [GNOME Application](https://github.com/hardpixel/devdocs-desktop) GTK3 application with search integrated in headerbar
158+
* [macOS Application](https://github.com/dteoh/devdocs-macos)
159+
* [Android Application](https://github.com/Merith-TK/devdocs_webapp_kotlin) is a fully working, advanced WebView
134160

135161
## Copyright / License
136162

137163
Copyright 2013-2019 Thibaut Courouble and [other contributors](https://github.com/freeCodeCamp/devdocs/graphs/contributors)
138164

139-
This software is licensed under the terms of the Mozilla Public License v2.0. See the [COPYRIGHT](https://github.com/freeCodeCamp/devdocs/blob/master/COPYRIGHT) and [LICENSE](https://github.com/freeCodeCamp/devdocs/blob/master/LICENSE) files.
165+
This software is licensed under the terms of the Mozilla Public License v2.0. See the [COPYRIGHT](./COPYRIGHT) and [LICENSE](./LICENSE) files.
140166

141167
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.
142168

assets/javascripts/app/app.coffee

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313

1414
@el = $('._app')
1515
@localStorage = new LocalStorageStore
16-
@appCache = new app.AppCache if app.AppCache.isEnabled()
16+
@serviceWorker = new app.ServiceWorker if app.ServiceWorker.isEnabled()
1717
@settings = new app.Settings
1818
@db = new app.DB()
1919

20+
@settings.initLayout()
21+
2022
@docs = new app.collections.Docs
2123
@disabledDocs = new app.collections.Docs
2224
@entries = new app.collections.Entries
@@ -147,7 +149,7 @@
147149
saveDocs: ->
148150
@settings.setDocs(doc.slug for doc in @docs.all())
149151
@db.migrate()
150-
@appCache?.updateInBackground()
152+
@serviceWorker?.updateInBackground()
151153

152154
welcomeBack: ->
153155
visitCount = @settings.get('count')
@@ -167,14 +169,14 @@
167169
reload: ->
168170
@docs.clearCache()
169171
@disabledDocs.clearCache()
170-
if @appCache then @appCache.reload() else @reboot()
172+
if @serviceWorker then @serviceWorker.reload() else @reboot()
171173
return
172174

173175
reset: ->
174176
@localStorage.reset()
175177
@settings.reset()
176178
@db?.reset()
177-
@appCache?.update()
179+
@serviceWorker?.update()
178180
window.location = '/'
179181
return
180182

@@ -193,9 +195,9 @@
193195
return
194196

195197
indexHost: ->
196-
# Can't load the index files from the host/CDN when applicationCache is
198+
# Can't load the index files from the host/CDN when service worker is
197199
# enabled because it doesn't support caching URLs that use CORS.
198-
@config[if @appCache and @settings.hasDocs() then 'index_path' else 'docs_origin']
200+
@config[if @serviceWorker and @settings.hasDocs() then 'index_path' else 'docs_origin']
199201

200202
onBootError: (args...) ->
201203
@trigger 'bootError'
@@ -252,7 +254,7 @@
252254
matchMedia: !!window.matchMedia
253255
insertAdjacentHTML: !!document.body.insertAdjacentHTML
254256
defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false
255-
cssVariables: CSS.supports and CSS.supports('(--t: 0)')
257+
cssVariables: !!CSS?.supports?('(--t: 0)')
256258

257259
for key, value of features when not value
258260
Raven.captureMessage "unsupported/#{key}", level: 'info'

0 commit comments

Comments
 (0)