diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000..1cf061121fc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +build/ +.github/ diff --git a/.editorconfig b/.editorconfig index b54e172c0db..1692977cec8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# EditorConfig is awesome: http://EditorConfig.org +# EditorConfig is awesome: https://EditorConfig.org # Top-most EditorConfig file root = true diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index c026a82da63..00000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,18 +0,0 @@ - https://spectrum.chat/slate <- - -If you've found a bug with Slate upstream that you're still encountering even in a lightly modified Slate, you're in the right place! Please fill out the form below with the issue you're having and we'll take a look. :) ---> - -Operating system: ✍️ TODO -Last upstream commit (run `git log --author="Robert Lord" | head -n 1`): ✍️ TODO -Browser version(s): ✍️ TODO -Ruby version (run `ruby -v`): ✍️ TODO - ---- - -✍️ TODO write your issue here diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 00000000000..25fcdb1d2e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,22 @@ +--- +name: Report a Bug +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Bug Description** +A clear and concise description of what the bug is and how to reproduce it. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Browser (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Last upstream Slate commit (run `git log --author="Robert Lord" | head -n 1`):** +Put the commit hash here diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000000..16f4beed616 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Questions, Ideas, Discussions + url: https://github.com/slatedocs/slate/discussions + about: Ask and answer questions, and propose new features. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index eebe789aa08..151e45d78cd 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..3d55c61d605 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build + +on: + push: + branches: [ '*' ] + pull_request: + branches: [ '*' ] + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7] + + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + + - uses: actions/cache@v1 + with: + path: vendor/bundle + key: gems-${{ runner.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }} + + # necessary to get ruby 2.3 to work nicely with bundler vendor/bundle cache + # can remove once ruby 2.3 is no longer supported + - run: gem update --system + + - run: bundle config set deployment 'true' + - run: bundle install + + - run: bundle exec middleman build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000000..7eff1f14ea4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Deploy + +on: + push: + branches: [ 'master' ] + +jobs: + deploy: + runs-on: ubuntu-latest + env: + ruby-version: 2.5 + + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.ruby-version }} + + - uses: actions/cache@v1 + with: + path: vendor/bundle + key: gems-${{ runner.os }}-${{ env.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }} + + - run: bundle config set deployment 'true' + - run: bundle install + + - run: bundle exec middleman build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build diff --git a/.gitignore b/.gitignore index 10501583560..1d5d08dd245 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ build/ _yardoc doc/ .idea/ + +# Vagrant artifacts +ubuntu-*-console.log diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0d6d210d94a..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -sudo: false - -language: ruby - -rvm: - - 2.3.3 - - 2.4.0 - -cache: bundler -script: bundle exec middleman build diff --git a/CHANGELOG.md b/CHANGELOG.md index 218f5caa99e..2ef19cb3b0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,57 @@ # Changelog +## Version 2.6.1 + +*May 30, 2020* + +* __[security]__ update child dependency activesupport in Gemfile.lock to 5.4.2.3 +* Update Middleman in Gemfile.lock to 4.3.7 +* Replace Travis-CI with GitHub actions for continuous integration +* Replace Spectrum with GitHub discussions + +## Version 2.6.0 + +*May 18, 2020* + +__Note__: 2.5.0 was "pulled" due to a breaking bug discovered after release. It is recommended to skip it, and move straight to 2.6.0. + +* Fix large whitespace gap in middle column for sections with codeblocks +* Fix highlighted code elements having a different background than rest of code block +* Change JSON keys to have a different font color than their values +* Disable asset hashing for woff and woff2 elements due to middleman bug breaking woff2 asset hashing in general +* Move Dockerfile to Debian from Alpine +* Converted repo to a [GitHub template](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-template-repository) +* Update sassc to 2.3.0 in Gemfile.lock + +## Version 2.5.0 + +*May 8, 2020* + +* __[security]__ update nokogiri to ~> 1.10.8 +* Update links in example docs to https://github.com/slatedocs/slate from https://github.com/lord/slate +* Update LICENSE to include full Apache 2.0 text +* Test slate against Ruby 2.5 and 2.6 on Travis-CI +* Update Vagrantfile to use Ubuntu 18.04 (thanks @bradthurber) +* Parse arguments and flags for deploy.sh on script start, instead of potentially after building source files +* Install nodejs inside Vagrantfile (thanks @fernandoaguilar) +* Add Dockerfile for running slate (thanks @redhatxl) +* update middleman-syntax and rouge to ~>3.2 +* update middleman to 4.3.6 + +## Version 2.4.0 + +*October 19, 2019* + +- Move repository from lord/slate to slatedocs/slate +- Fix documentation to point at new repo link, thanks to [Arun](https://github.com/slash-arun), [Gustavo Gawryszewski](https://github.com/gawry), and [Daniel Korbit](https://github.com/danielkorbit) +- Update `nokogiri` to 1.10.4 +- Update `ffi` in `Gemfile.lock` to fix security warnings, thanks to [Grey Baker](https://github.com/greysteil) and [jackmack](https://github.com/jakemack) +- Update `rack` to 2.0.7 in `Gemfile.lock` to fix security warnings, thanks to [Grey Baker](https://github.com/greysteil) and [jackmack](https://github.com/jakemack) +- Update middleman to `4.3` and relax constraints on middleman related gems, thanks to [jackmack](https://github.com/jakemack) +- Add sass gem, thanks to [jackmack](https://github.com/jackmack) +- Activate `asset_cache` in middleman to improve cacheability of static files, thanks to [Sam Gilman](https://github.com/thenengah) +- Update to using bundler 2 for `Gemfile.lock`, thanks to [jackmack](https://github.com/jakemack) + ## Version 2.3.1 *July 5, 2018* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..33b80ca4216 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM ruby:2.6-slim + +WORKDIR /srv/slate + +VOLUME /srv/slate/source +EXPOSE 4567 + +COPY . /srv/slate + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + build-essential \ + nodejs \ + && gem install bundler \ + && bundle install \ + && apt-get remove -y build-essential \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +CMD ["bundle", "exec", "middleman", "server", "--watcher-force-polling"] diff --git a/Gemfile b/Gemfile index 79d41fff6dd..95029e39a5c 100644 --- a/Gemfile +++ b/Gemfile @@ -2,10 +2,11 @@ ruby '>=2.3.1' source 'https://rubygems.org' # Middleman -gem 'middleman', '~>4.2.1' -gem 'middleman-syntax', '~> 3.0.0' -gem 'middleman-autoprefixer', '~> 2.7.0' -gem 'middleman-sprockets', '~> 4.1.0' -gem 'rouge', '~> 2.0.5' +gem 'middleman', '~>4.3' +gem 'middleman-syntax', '~> 3.2' +gem 'middleman-autoprefixer', '~> 2.7' +gem 'middleman-sprockets', '~> 4.1' +gem 'rouge', '~> 3.2' gem 'redcarpet', '~> 3.4.0' -gem 'nokogiri', '~> 1.8.2' +gem 'nokogiri', '~> 1.10.8' +gem 'sass' diff --git a/Gemfile.lock b/Gemfile.lock index eebb95a9694..b3c7f116a3f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,60 +1,57 @@ GEM remote: https://rubygems.org/ specs: - activesupport (5.0.1) + activesupport (5.2.4.3) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) + i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.0) - public_suffix (~> 2.0, >= 2.0.2) - autoprefixer-rails (6.6.1) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + autoprefixer-rails (9.5.1.1) execjs - backports (3.6.8) + backports (3.17.2) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) - compass-import-once (1.0.5) - sass (>= 3.2, < 3.5) - concurrent-ruby (1.0.5) + concurrent-ruby (1.1.6) contracts (0.13.0) - dotenv (2.2.0) + dotenv (2.7.5) erubis (2.7.0) execjs (2.7.0) fast_blank (1.0.0) - fastimage (2.0.1) - addressable (~> 2) - ffi (1.9.17) - haml (4.0.7) + fastimage (2.1.7) + ffi (1.12.2) + haml (5.1.2) + temple (>= 0.8.0) tilt hamster (3.0.0) concurrent-ruby (~> 1.0) - hashie (3.5.1) - i18n (0.7.0) - kramdown (1.13.2) + hashie (3.6.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + kramdown (1.17.0) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - memoist (0.15.0) - middleman (4.2.1) + memoist (0.16.2) + middleman (4.3.7) coffee-script (~> 2.2) - compass-import-once (= 1.0.5) haml (>= 4.0.5) kramdown (~> 1.2) - middleman-cli (= 4.2.1) - middleman-core (= 4.2.1) - sass (>= 3.4.0, < 4.0) - middleman-autoprefixer (2.7.1) - autoprefixer-rails (>= 6.5.2, < 7.0.0) + middleman-cli (= 4.3.7) + middleman-core (= 4.3.7) + middleman-autoprefixer (2.10.1) + autoprefixer-rails (~> 9.1) middleman-core (>= 3.3.3) - middleman-cli (4.2.1) + middleman-cli (4.3.7) thor (>= 0.17.0, < 2.0) - middleman-core (4.2.1) - activesupport (>= 4.2, < 5.1) + middleman-core (4.3.7) + activesupport (>= 4.2, < 6.0) addressable (~> 2.3) backports (~> 3.6) - bundler (~> 1.1) + bundler contracts (~> 0.13.0) dotenv erubis @@ -63,67 +60,75 @@ GEM fastimage (~> 2.0) hamster (~> 3.0) hashie (~> 3.4) - i18n (~> 0.7.0) + i18n (~> 0.9.0) listen (~> 3.0.0) memoist (~> 0.14) padrino-helpers (~> 0.13.0) parallel rack (>= 1.4.5, < 3) - sass (>= 3.4) + sassc (~> 2.0) servolux - tilt (~> 2.0) + tilt (~> 2.0.9) uglifier (~> 3.0) - middleman-sprockets (4.1.0) + middleman-sprockets (4.1.1) middleman-core (~> 4.0) sprockets (>= 3.0) - middleman-syntax (3.0.0) + middleman-syntax (3.2.0) middleman-core (>= 3.2) - rouge (~> 2.0) - mini_portile2 (2.3.0) - minitest (5.10.1) - nokogiri (1.8.2) - mini_portile2 (~> 2.3.0) - padrino-helpers (0.13.3.3) + rouge (~> 3.2) + mini_portile2 (2.4.0) + minitest (5.14.1) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + padrino-helpers (0.13.3.4) i18n (~> 0.6, >= 0.6.7) - padrino-support (= 0.13.3.3) + padrino-support (= 0.13.3.4) tilt (>= 1.4.1, < 3) - padrino-support (0.13.3.3) + padrino-support (0.13.3.4) activesupport (>= 3.1) - parallel (1.10.0) - public_suffix (2.0.5) - rack (2.0.5) - rb-fsevent (0.9.8) - rb-inotify (0.9.8) - ffi (>= 0.5.0) + parallel (1.19.1) + public_suffix (4.0.5) + rack (2.2.2) + rb-fsevent (0.10.4) + rb-inotify (0.10.1) + ffi (~> 1.0) redcarpet (3.4.0) - rouge (2.0.7) - sass (3.4.23) - servolux (0.12.0) + rouge (3.17.0) + 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) + sassc (2.3.0) + ffi (~> 1.9) + servolux (0.13.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - thor (0.19.4) - thread_safe (0.3.5) - tilt (2.0.6) - tzinfo (1.2.2) + temple (0.8.2) + thor (1.0.1) + thread_safe (0.3.6) + tilt (2.0.10) + tzinfo (1.2.7) thread_safe (~> 0.1) - uglifier (3.0.4) + uglifier (3.2.0) execjs (>= 0.3.0, < 3) PLATFORMS ruby DEPENDENCIES - middleman (~> 4.2.1) - middleman-autoprefixer (~> 2.7.0) - middleman-sprockets (~> 4.1.0) - middleman-syntax (~> 3.0.0) - nokogiri (~> 1.8.2) + middleman (~> 4.3) + middleman-autoprefixer (~> 2.7) + middleman-sprockets (~> 4.1) + middleman-syntax (~> 3.2) + nokogiri (~> 1.10.8) redcarpet (~> 3.4.0) - rouge (~> 2.0.5) + rouge (~> 3.2) + sass RUBY VERSION ruby 2.3.3p222 BUNDLED WITH - 1.15.4 + 2.1.4 diff --git a/LICENSE b/LICENSE index 5ceddf59f68..261eeb9e9f8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,13 +1,201 @@ -Copyright 2008-2013 Concur Technologies, Inc. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Licensed under the Apache License, Version 2.0 (the "License"); you may -not use this file except in compliance with the License. You may obtain -a copy of the License at + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - http://www.apache.org/licenses/LICENSE-2.0 + 1. Definitions. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -License for the specific language governing permissions and limitations -under the License. \ No newline at end of file + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index c9017010ae6..5920785ee37 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@
Slate helps you create beautiful, intelligent, responsive API documentation.
-

The example above was created with Slate. Check it out at lord.github.io/slate.
+The example above was created with Slate. Check it out at slatedocs.github.io/slate.
Features ------------ @@ -29,44 +29,18 @@ Features * **RTL Support** Full right-to-left layout for RTL languages such as Arabic, Persian (Farsi), Hebrew etc. -Getting started with Slate is super easy! Simply fork this repository and follow the instructions below. Or, if you'd like to check out what Slate is capable of, take a look at the [sample docs](http://lord.github.io/slate). +Getting started with Slate is super easy! Simply press the green "use this template" button above and follow the instructions below. Or, if you'd like to check out what Slate is capable of, take a look at the [sample docs](https://slatedocs.github.io/slate/). Getting Started with Slate ------------------------------ -### Prerequisites +To get started with Slate, please check out the [Getting Started](https://github.com/slatedocs/slate/wiki#getting-started) +section in our [wiki](https://github.com/slatedocs/slate/wiki). -You're going to need: - - - **Linux or macOS** — Windows may work, but is unsupported. - - **Ruby, version 2.3.1 or newer** - - **Bundler** — If Ruby is already installed, but the `bundle` command doesn't work, just run `gem install bundler` in a terminal. - -### Getting Set Up - -1. Fork this repository on GitHub. -2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git` -3. `cd slate` -4. Initialize and start Slate. You can either do this locally, or with Vagrant: - -```shell -# either run this to run locally -bundle install -bundle exec middleman server - -# OR run this to run with vagrant -vagrant up -``` - -You can now see the docs at http://localhost:4567. Whoa! That was fast! - -Now that Slate is all set up on your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/lord/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/lord/slate/wiki/Deploying-Slate). - -If you'd prefer to use Docker, instructions are available [in the wiki](https://github.com/lord/slate/wiki/Docker). - -### Note on JavaScript Runtime - -For those who don't have JavaScript runtime or are experiencing JavaScript runtime issues with ExecJS, it is recommended to add the [rubyracer gem](https://github.com/cowboyd/therubyracer) to your gemfile and run `bundle` again. +We support running Slate in three different ways: +* [Natively](https://github.com/slatedocs/slate/wiki/Using-Slate-Natively) +* [Using Vagrant](https://github.com/slatedocs/slate/wiki/Using-Slate-in-Vagrant) +* [Using Docker](https://github.com/slatedocs/slate/wiki/Using-Slate-in-Docker) Companies Using Slate --------------------------------- @@ -76,26 +50,26 @@ Companies Using Slate * [Best Buy](https://bestbuyapis.github.io/api-documentation/) * [Travis-CI](https://docs.travis-ci.com/api/) * [Greenhouse](https://developers.greenhouse.io/harvest.html) -* [Woocommerce](http://woocommerce.github.io/woocommerce-rest-api-docs/) +* [WooCommerce](http://woocommerce.github.io/woocommerce-rest-api-docs/) * [Dwolla](https://docs.dwolla.com/) * [Clearbit](https://clearbit.com/docs) * [Coinbase](https://developers.coinbase.com/api) * [Parrot Drones](http://developer.parrot.com/docs/bebop/) * [Scale](https://docs.scaleapi.com/) -You can view more in [the list on the wiki](https://github.com/lord/slate/wiki/Slate-in-the-Wild). +You can view more in [the list on the wiki](https://github.com/slatedocs/slate/wiki/Slate-in-the-Wild). Questions? Need Help? Found a bug? -------------------- -If you've got questions about setup, deploying, special feature implementation in your fork, or just want to chat with the developer, please feel free to [start a thread in our Spectrum community](https://spectrum.chat/slate)! +If you've got questions about setup, deploying, special feature implementation in your fork, or just want to chat with the developer, please feel free to [start a thread in our Discussions tab](https://github.com/slatedocs/slate/discussions)! -Found a bug with upstream Slate? Go ahead and [submit an issue](https://github.com/lord/slate/issues). And, of course, feel free to submit pull requests with bug fixes or changes to the `dev` branch. +Found a bug with upstream Slate? Go ahead and [submit an issue](https://github.com/slatedocs/slate/issues). And, of course, feel free to submit pull requests with bug fixes or changes to the `dev` branch. Contributors -------------------- -Slate was built by [Robert Lord](https://lord.io) while interning at [TripIt](https://www.tripit.com/). +Slate was built by [Robert Lord](https://lord.io) while at [TripIt](https://www.tripit.com/). The project is now maintained by [Matthew Peveler](https://github.com/MasterOdin) and [Mike Ralphson](https://github.com/MikeRalphson). Thanks to the following people who have submitted major pull requests: diff --git a/Vagrantfile b/Vagrantfile index 6f2444e2133..4166fb6ba24 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,5 +1,5 @@ Vagrant.configure(2) do |config| - config.vm.box = "ubuntu/trusty64" + config.vm.box = "ubuntu/bionic64" config.vm.network :forwarded_port, guest: 4567, host: 4567 config.vm.provider "virtualbox" do |vb| vb.memory = "2048" @@ -8,12 +8,14 @@ Vagrant.configure(2) do |config| config.vm.provision "bootstrap", type: "shell", inline: <<-SHELL - sudo apt-add-repository ppa:brightbox/ruby-ng + # add nodejs v12 repository + curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - + sudo apt-get update - sudo apt-get install -yq ruby2.4 ruby2.4-dev + sudo apt-get install -yq ruby ruby-dev sudo apt-get install -yq pkg-config build-essential nodejs git libxml2-dev libxslt-dev sudo apt-get autoremove -yq - gem2.4 install --no-ri --no-rdoc bundler + gem install --no-ri --no-rdoc bundler SHELL # add the local user git config to the vm diff --git a/config.rb b/config.rb index 24887979fea..6f8b677f617 100644 --- a/config.rb +++ b/config.rb @@ -23,6 +23,7 @@ # Activate the syntax highlighter activate :syntax ready do + require './lib/monokai_sublime_slate.rb' require './lib/multilang.rb' end @@ -40,12 +41,16 @@ # Build Configuration configure :build do + # We do want to hash woff and woff2 as there's a bug where woff2 will use + # woff asset hash which breaks things. Trying to use a combination of ignore and + # rewrite_ignore does not work as it conflicts weirdly with relative_assets. Disabling + # the .woff2 extension only does not work as .woff will still activate it so have to + # have both. See https://github.com/slatedocs/slate/issues/1171 for more details. + activate :asset_hash, :exts => app.config[:asset_extensions] - %w[.woff .woff2] # If you're having trouble with Middleman hanging, commenting # out the following two lines has been known to help activate :minify_css activate :minify_javascript - # activate :relative_assets - # activate :asset_hash # activate :gzip end diff --git a/deploy.sh b/deploy.sh index f122ba7ce62..f872d23f713 100755 --- a/deploy.sh +++ b/deploy.sh @@ -36,7 +36,7 @@ parse_args() { while : ; do if [[ $1 = "-h" || $1 = "--help" ]]; then echo "$help_message" - return 0 + exit 0 elif [[ $1 = "-v" || $1 = "--verbose" ]]; then verbose=true shift @@ -49,11 +49,22 @@ parse_args() { elif [[ $1 = "-n" || $1 = "--no-hash" ]]; then GIT_DEPLOY_APPEND_HASH=false shift + elif [[ $1 = "--source-only" ]]; then + source_only=true + shift + elif [[ $1 = "--push-only" ]]; then + push_only=true + shift else break fi done + if [ ${source_only} ] && [ ${push_only} ]; then + >&2 echo "You can only specify one of --source-only or --push-only" + exit 1 + fi + # Set internal option vars from the environment and arg flags. All internal # vars should be declared here, with sane defaults if applicable. @@ -73,8 +84,6 @@ parse_args() { } main() { - parse_args "$@" - enable_expanded_output if ! git diff --exit-code --quiet --cached; then @@ -205,9 +214,11 @@ sanitize() { "$@" 2> >(filter 1>&2) | filter } -if [[ $1 = --source-only ]]; then +parse_args "$@" + +if [[ ${source_only} ]]; then run_build -elif [[ $1 = --push-only ]]; then +elif [[ ${push_only} ]]; then main "$@" else run_build diff --git a/lib/monokai_sublime_slate.rb b/lib/monokai_sublime_slate.rb new file mode 100644 index 00000000000..cd2de33172d --- /dev/null +++ b/lib/monokai_sublime_slate.rb @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- # +# frozen_string_literal: true + +# this is based on https://github.com/rouge-ruby/rouge/blob/master/lib/rouge/themes/monokai_sublime.rb +# but without the added background, and changed styling for JSON keys to be soft_yellow instead of white + +module Rouge + module Themes + class MonokaiSublimeSlate < CSSTheme + name 'monokai.sublime.slate' + + palette :black => '#000000' + palette :bright_green => '#a6e22e' + palette :bright_pink => '#f92672' + palette :carmine => '#960050' + palette :dark => '#49483e' + palette :dark_grey => '#888888' + palette :dark_red => '#aa0000' + palette :dimgrey => '#75715e' + palette :emperor => '#555555' + palette :grey => '#999999' + palette :light_grey => '#aaaaaa' + palette :light_violet => '#ae81ff' + palette :soft_cyan => '#66d9ef' + palette :soft_yellow => '#e6db74' + palette :very_dark => '#1e0010' + palette :whitish => '#f8f8f2' + palette :orange => '#f6aa11' + palette :white => '#ffffff' + + style Generic::Heading, :fg => :grey + style Literal::String::Regex, :fg => :orange + style Generic::Output, :fg => :dark_grey + style Generic::Prompt, :fg => :emperor + style Generic::Strong, :bold => false + style Generic::Subheading, :fg => :light_grey + style Name::Builtin, :fg => :orange + style Comment::Multiline, + Comment::Preproc, + Comment::Single, + Comment::Special, + Comment, :fg => :dimgrey + style Error, + Generic::Error, + Generic::Traceback, :fg => :carmine + style Generic::Deleted, + Generic::Inserted, + Generic::Emph, :fg => :dark + style Keyword::Constant, + Keyword::Declaration, + Keyword::Reserved, + Name::Constant, + Keyword::Type, :fg => :soft_cyan + style Literal::Number::Float, + Literal::Number::Hex, + Literal::Number::Integer::Long, + Literal::Number::Integer, + Literal::Number::Oct, + Literal::Number, + Literal::String::Char, + Literal::String::Escape, + Literal::String::Symbol, :fg => :light_violet + style Literal::String::Doc, + Literal::String::Double, + Literal::String::Backtick, + Literal::String::Heredoc, + Literal::String::Interpol, + Literal::String::Other, + Literal::String::Single, + Literal::String, :fg => :soft_yellow + style Name::Attribute, + Name::Class, + Name::Decorator, + Name::Exception, + Name::Function, :fg => :bright_green + style Name::Variable::Class, + Name::Namespace, + Name::Entity, + Name::Builtin::Pseudo, + Name::Variable::Global, + Name::Variable::Instance, + Name::Variable, + Text::Whitespace, + Text, + Name, :fg => :white + style Name::Label, :fg => :bright_pink + style Operator::Word, + Name::Tag, + Keyword, + Keyword::Namespace, + Keyword::Pseudo, + Operator, :fg => :bright_pink + end + end + end diff --git a/source/index.html.md b/source/index.html.md index e101e66ef94..27cf28aa991 100644 --- a/source/index.html.md +++ b/source/index.html.md @@ -9,7 +9,7 @@ language_tabs: # must be one of https://git.io/vQNgJ toc_footers: - Sign Up for a Developer Key - - Documentation Powered by Slate + - Documentation Powered by Slate includes: - errors @@ -23,7 +23,7 @@ Welcome to the Kittn API! You can use our API to access Kittn API endpoints, whi We have language bindings in Shell, Ruby, Python, and JavaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right. -This example API documentation page was created with [Slate](https://github.com/lord/slate). Feel free to edit it and use it as a base for your own API's documentation. +This example API documentation page was created with [Slate](https://github.com/slatedocs/slate). Feel free to edit it and use it as a base for your own API's documentation. # Authentication diff --git a/source/layouts/layout.erb b/source/layouts/layout.erb index 29b80d72a32..14537281a17 100644 --- a/source/layouts/layout.erb +++ b/source/layouts/layout.erb @@ -32,7 +32,7 @@ under the License.