diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 26444a3c..f5512345 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -10,9 +10,8 @@ Want to contribute? Great. Please review the following guidelines carefully and 4. [Contributing code and features](#contributing-code-and-features) 5. [Contributing new documentations](#contributing-new-documentations) 6. [Updating existing documentations](#updating-existing-documentations) -7. [Other contributions](#other-contributions) -8. [Coding conventions](#coding-conventions) -9. [Questions?](#questions) +7. [Coding conventions](#coding-conventions) +8. [Questions?](#questions) ## Reporting bugs diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c0dfddfc..88ac89f9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Create a report to help us improve Devdocs +about: Create a report to help us improve DevDocs title: '' labels: 'bug' assignees: '' @@ -34,7 +34,7 @@ encountered it ## More resources ## Possible fix diff --git a/.github/ISSUE_TEMPLATE/documentation_bug.md b/.github/ISSUE_TEMPLATE/documentation_bug.md index 9160c071..5f56d098 100644 --- a/.github/ISSUE_TEMPLATE/documentation_bug.md +++ b/.github/ISSUE_TEMPLATE/documentation_bug.md @@ -24,7 +24,7 @@ Add a description about how the documentation should be ## Actual style ## Expected style diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index a496a10d..664a6540 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -13,7 +13,7 @@ If possible fill each section # Feature request ## Examples diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f8bc6637..c93bfc45 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,13 +16,13 @@ If you’re adding a new scraper, please ensure that you have: - [ ] `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 - + -If you're updating an existing documentation to it's latest version, please ensure that you have: +If you're updating existing documentation to its latest version, please ensure that you have: - [ ] Updated the versions and releases in the scraper file -- [ ] Ensured the license is up-to-date and that the documentation's entry in the array in `about_tmpl.coffee` matches it's data in `self.attribution` +- [ ] Ensured the license is up-to-date and that the documentation's entry in the array in `about_tmpl.coffee` matches its data in `self.attribution` - [ ] Ensured the icons and the `SOURCE` file in public/icons/*your_scraper_name*/ are up-to-date if the documentation has a custom icon - [ ] Ensured `self.links` contains up-to-date urls if `self.links` is defined - [ ] Tested the changes locally to ensure: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e6c95e0..ad547735 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-20.04 if: github.repository == 'freeCodeCamp/devdocs' steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v2.4.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1.66.1 + uses: ruby/setup-ruby@v1.110.0 with: bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Run tests diff --git a/.github/workflows/schedule-doc-report.yml b/.github/workflows/schedule-doc-report.yml index 013ed75b..b90a3098 100644 --- a/.github/workflows/schedule-doc-report.yml +++ b/.github/workflows/schedule-doc-report.yml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-20.04 if: github.repository == 'freeCodeCamp/devdocs' steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v2.4.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1.66.1 + uses: ruby/setup-ruby@v1.110.0 with: bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Generate report diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..7b7801dc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: Ruby tests + +on: + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2.4.2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1.110.0 + with: + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake diff --git a/.gitignore b/.gitignore index 8f06d308..bbf749a4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,7 @@ public/docs/**/* docs/**/* !docs/*.md /vendor +*.tar +*.tar.bz2 +*.tar.gz +*.zip diff --git a/.ruby-version b/.ruby-version index 57cf282e..49cdd668 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.5 +2.7.6 diff --git a/Dockerfile b/Dockerfile index dd1302df..060193df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.6.5 +FROM ruby:2.7.6 ENV LANG=C.UTF-8 ENV ENABLE_SERVICE_WORKER=true diff --git a/Gemfile b/Gemfile index 61004330..fa6189fd 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,9 @@ source 'https://rubygems.org' -ruby '~> 2.6.0' +ruby '~> 2.7.3' gem 'rake' gem 'thor' -gem 'pry', '~> 0.12.0' +gem 'pry', '~> 0.14.0' gem 'activesupport', '~> 5.2', require: false gem 'yajl-ruby', require: false gem 'html-pipeline' diff --git a/Gemfile.lock b/Gemfile.lock index a73db036..f91f2685 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,38 +1,38 @@ GEM remote: https://rubygems.org/ specs: - activesupport (5.2.3) + activesupport (5.2.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) backports (3.15.0) - better_errors (2.5.1) + better_errors (2.9.1) coderay (>= 1.0.0) erubi (>= 1.0.0) rack (>= 0.9.0) browser (2.6.1) chunky_png (1.3.11) - coderay (1.1.2) + coderay (1.1.3) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.5) - daemons (1.3.1) - erubi (1.9.0) + concurrent-ruby (1.1.9) + daemons (1.4.0) + erubi (1.10.0) ethon (0.12.0) ffi (>= 1.3.0) eventmachine (1.2.7) execjs (2.7.0) exifr (1.3.6) - ffi (1.12.2) + ffi (1.15.5) fspath (3.1.2) highline (2.0.3) html-pipeline (2.12.0) activesupport (>= 2) nokogiri (>= 1.4) - i18n (1.7.0) + i18n (1.8.10) concurrent-ruby (~> 1.0) image_optim (0.26.5) exifr (~> 1.2, >= 1.2.2) @@ -45,26 +45,29 @@ GEM image_optim (~> 0.19) image_size (2.0.2) in_threads (1.5.3) - method_source (0.9.2) - mini_portile2 (2.4.0) - minitest (5.12.2) + method_source (1.0.0) + mini_portile2 (2.8.0) + minitest (5.14.4) multi_json (1.13.1) - mustermann (1.0.3) + mustermann (1.1.1) + ruby2_keywords (~> 0.0.1) net-sftp (3.0.0.beta1) net-ssh (>= 5.0.0, < 6.0.0) net-ssh (5.2.0) newrelic_rpm (6.7.0.359) - nokogiri (1.10.4) - mini_portile2 (~> 2.4.0) + nokogiri (1.13.6) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) options (2.3.2) progress (3.5.2) progress_bar (1.3.0) highline (>= 1.6, < 3) options (~> 2.3.0) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - rack (2.0.7) + pry (0.14.1) + coderay (~> 1.1) + method_source (~> 1.0) + racc (1.6.0) + rack (2.2.3.1) rack-protection (2.0.7) rack rack-ssl-enforcer (0.2.9) @@ -75,6 +78,7 @@ GEM rb-inotify (0.10.0) ffi (~> 1.0) rr (1.2.1) + ruby2_keywords (0.0.5) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) @@ -106,7 +110,7 @@ GEM strings-ansi (0.1.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) - thin (1.7.2) + thin (1.8.1) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) @@ -121,14 +125,14 @@ GEM tty-which (0.4.1) typhoeus (1.3.1) ethon (>= 0.9.0) - tzinfo (1.2.5) + tzinfo (1.2.9) thread_safe (~> 0.1) uglifier (4.2.0) execjs (>= 0.3.0, < 3) unicode-display_width (1.6.0) unicode_utils (1.4.0) unix_utils (0.0.15) - yajl-ruby (1.4.1) + yajl-ruby (1.4.3) PLATFORMS ruby @@ -148,7 +152,7 @@ DEPENDENCIES newrelic_rpm nokogiri progress_bar - pry (~> 0.12.0) + pry (~> 0.14.0) rack rack-ssl-enforcer rack-test @@ -170,7 +174,7 @@ DEPENDENCIES yajl-ruby RUBY VERSION - ruby 2.6.3p62 + ruby 2.7.3p183 BUNDLED WITH - 2.0.2 + 2.1.4 diff --git a/README.md b/README.md index 35367313..f7788a8b 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Unless you wish to contribute to the project, we recommend using the hosted vers 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.6.x, 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.7.4, 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: ```sh git clone https://github.com/freeCodeCamp/devdocs.git && cd devdocs @@ -147,8 +147,6 @@ Made something cool? Feel free to open a PR to add a new row to this table! | Project | Description | Last commit | |---------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [Chrome web app](https://chrome.google.com/webstore/detail/devdocs/mnfehgbmkapmjnhcnbodoamcioleeooe) | Chrome Web App which adds a shortcut to DevDocs apps page. | N/A | -| [Ubuntu Touch app](https://uappexplorer.com/app/devdocsunofficial.berkes) | Application for devices running Ubuntu Touch. | N/A | | [Sublime Text plugin](https://sublime.wbond.net/packages/DevDocs) | Sublime Text plugin to search DevDocs by selection or by input. | [![Latest GitHub commit](https://img.shields.io/github/last-commit/vitorbritto/sublime-devdocs?logo=github&label)](https://github.com/vitorbritto/sublime-devdocs) | | [Atom plugin](https://atom.io/packages/devdocs) | Atom plugin adding the `doc` command to search DevDocs. | [![Latest GitHub commit](https://img.shields.io/github/last-commit/masnun/atom-devdocs?logo=github&label)](https://github.com/masnun/atom-devdocs) | | [gruehle/dev-docs-viewer](https://github.com/gruehle/dev-docs-viewer) | Brackets extension for searching and viewing DevDocs content. | [![Latest GitHub commit](https://img.shields.io/github/last-commit/gruehle/dev-docs-viewer?logo=github&label)](https://github.com/gruehle/dev-docs-viewer) | @@ -163,6 +161,8 @@ Made something cool? Feel free to open a PR to add a new row to this table! | [hardpixel/devdocs-desktop](https://github.com/hardpixel/devdocs-desktop) | GTK3 application for DevDocs with search integrated in the headerbar. | [![Latest GitHub commit](https://img.shields.io/github/last-commit/hardpixel/devdocs-desktop?logo=github&label)](https://github.com/hardpixel/devdocs-desktop) | | [dteoh/devdocs-macos](https://github.com/dteoh/devdocs-macos) | Native macOS application for DevDocs. | [![Latest GitHub commit](https://img.shields.io/github/last-commit/dteoh/devdocs-macos?logo=github&label)](https://github.com/dteoh/devdocs-macos) | | [Merith-TK/devdocs_webapp_kotlin](https://github.com/Merith-TK/devdocs_webapp_kotlin) | Android application which shows DevDocs in a webview. | [![Latest GitHub commit](https://img.shields.io/github/last-commit/Merith-TK/devdocs_webapp_kotlin?logo=github&label)](https://github.com/Merith-TK/devdocs_webapp_kotlin) | +| [astoff/devdocs.el](https://github.com/astoff/devdocs.el) | Emacs viewer for DevDocs | [![Latest GitHub commit](https://img.shields.io/github/last-commit/astoff/devdocs.el?logo=github&label)](https://github.com/astoff/devdocs.el) | +| [DevDocs Tab for VS Code](https://github.com/mohamed3nan/DevDocs-Tab) | VS Code extension to search for documentation on DevDocs.io faster by displaying it in a tab inside VS Code.| [![Latest GitHub commit](https://img.shields.io/github/last-commit/mohamed3nan/DevDocs-Tab?logo=github&label)](https://github.com/mohamed3nan/DevDocs-Tab) | ## Copyright / License diff --git a/assets/javascripts/app/settings.coffee b/assets/javascripts/app/settings.coffee index d3fc93e1..38b4f910 100644 --- a/assets/javascripts/app/settings.coffee +++ b/assets/javascripts/app/settings.coffee @@ -13,6 +13,8 @@ class app.Settings 'size' 'tips' 'autoInstall' + 'spaceScroll' + 'spaceTimeout' ] INTERNAL_KEYS = [ @@ -22,7 +24,12 @@ class app.Settings 'news' ] - LAYOUTS: ['_max-width', '_sidebar-hidden', '_native-scrollbars'] + LAYOUTS: [ + '_max-width' + '_sidebar-hidden' + '_native-scrollbars' + '_text-justify-hyphenate' + ] @defaults: count: 0 @@ -33,6 +40,8 @@ class app.Settings schema: 1 analyticsConsent: false theme: 'auto' + spaceScroll: 1 + spaceTimeout: 0.5 constructor: -> @store = new CookiesStore @@ -149,7 +158,8 @@ class app.Settings toggleLayout: (layout, enable) -> classList = document.body.classList - classList.toggle(layout, enable) unless app.router?.isSettings + # sidebar is always shown for settings; its state is updated in app.views.Settings + classList.toggle(layout, enable) unless layout is '_sidebar-hidden' and app.router?.isSettings classList.toggle('_overlay-scrollbars', $.overlayScrollbarsEnabled()) return diff --git a/assets/javascripts/app/shortcuts.coffee b/assets/javascripts/app/shortcuts.coffee index fb0c7220..28ddf0b8 100644 --- a/assets/javascripts/app/shortcuts.coffee +++ b/assets/javascripts/app/shortcuts.coffee @@ -18,10 +18,16 @@ class app.Shortcuts swapArrowKeysBehavior: -> app.settings.get('arrowScroll') + spaceScroll: -> + app.settings.get('spaceScroll') + showTip: -> app.showTip('KeyNav') @showTip = null + spaceTimeout: -> + app.settings.get('spaceTimeout') + onKeydown: (event) => return if @buggyEvent(event) result = if event.ctrlKey or event.metaKey @@ -59,7 +65,7 @@ class app.Shortcuts @trigger 'escape' false when 32 - if event.target.type is 'search' and (not @lastKeypress or @lastKeypress < Date.now() - 500) + if event.target.type is 'search' and @spaceScroll() and (not @lastKeypress or @lastKeypress < Date.now() - (@spaceTimeout() * 1000)) @trigger 'pageDown' false when 33 diff --git a/assets/javascripts/lib/page.coffee b/assets/javascripts/lib/page.coffee index 7a5329f6..5ad89b32 100644 --- a/assets/javascripts/lib/page.coffee +++ b/assets/javascripts/lib/page.coffee @@ -200,6 +200,8 @@ page.track = (fn) -> track = -> return unless app.config.env == 'production' + return if navigator.doNotTrack == '1' + return if navigator.globalPrivacyControl consentGiven = Cookies.get('analyticsConsent') consentAsked = Cookies.get('analyticsConsentAsked') diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index 1757b39d..2a9934a9 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,4 +1,61 @@ [ + [ + "2022-05-03", + "New documentations: Kubernetes, Kubectl" + ], + [ + "2022-04-25", + "New documentation: Nix" + ], + [ + "2022-03-31", + "New documentation: Eigen3" + ], + [ + "2022-02-21", + "New documentation: Tailwind CSS" + ], + [ + "2022-01-12", + "New documentation: React Router" + ], + [ + "2022-01-09", + "New documentation: Deno" + ], + [ + "2021-12-29", + "New documentation: PointCloudLibrary" + ], + [ + "2021-12-27", + "New documentation: Zig" + ], + [ + "2021-12-26", + "New documentation: GNU Make" + ], + [ + "2021-12-07", + "New documentation: Prettier", + "Renamed documentation: Web APIs" + ], + [ + "2021-12-05", + "New documentation: esbuild" + ], + [ + "2021-12-04", + "New documentation: Vite" + ], + [ + "2021-11-29", + "New documentation: i3" + ], + [ + "2021-06-09", + "New documentation: R" + ], [ "2021-05-31", "New documentation: Web Extensions" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 1698eec2..ebadb1b3 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -30,7 +30,6 @@ app.templates.aboutPage = -> """

Plugins and Extensions