├── .gitattributes ├── source ├── javascripts │ ├── all.js │ ├── app │ │ ├── _copy.js │ │ ├── _search.js │ │ ├── _toc.js │ │ └── _lang.js │ ├── all_nosearch.js │ └── lib │ │ ├── _jquery.highlight.js │ │ ├── _imagesloaded.min.js │ │ └── _energize.js ├── fonts │ ├── slate.eot │ ├── slate.ttf │ ├── slate.woff │ ├── slate.woff2 │ └── slate.svg ├── images │ ├── logo.png │ └── navbar.png ├── stylesheets │ ├── _icon-font.scss │ ├── print.css.scss │ ├── _rtl.scss │ ├── _variables.scss │ ├── _normalize.scss │ └── screen.css.scss ├── includes │ └── _errors.md ├── layouts │ └── layout.erb └── index.html.md ├── .dockerignore ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ └── bug.md ├── dependabot.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── deploy.yml │ ├── build.yml │ ├── publish.yml │ └── dev_deploy.yml ├── Gemfile ├── .gitignore ├── .editorconfig ├── Dockerfile ├── lib ├── multilang.rb ├── nesting_unique_head.rb ├── toc_data.rb ├── unique_head.rb └── monokai_sublime_slate.rb ├── Vagrantfile ├── config.rb ├── CODE_OF_CONDUCT.md ├── Gemfile.lock ├── font-selection.json ├── README.md ├── deploy.sh ├── slate.sh ├── LICENSE └── CHANGELOG.md /.gitattributes: -------------------------------------------------------------------------------- 1 | source/javascripts/lib/* linguist-vendored 2 | -------------------------------------------------------------------------------- /source/javascripts/all.js: -------------------------------------------------------------------------------- 1 | //= require ./all_nosearch 2 | //= require ./app/_search 3 | -------------------------------------------------------------------------------- /source/fonts/slate.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanveerpot/slate/HEAD/source/fonts/slate.eot -------------------------------------------------------------------------------- /source/fonts/slate.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanveerpot/slate/HEAD/source/fonts/slate.ttf -------------------------------------------------------------------------------- /source/fonts/slate.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanveerpot/slate/HEAD/source/fonts/slate.woff -------------------------------------------------------------------------------- /source/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanveerpot/slate/HEAD/source/images/logo.png -------------------------------------------------------------------------------- /source/fonts/slate.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanveerpot/slate/HEAD/source/fonts/slate.woff2 -------------------------------------------------------------------------------- /source/images/navbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanveerpot/slate/HEAD/source/images/navbar.png -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git/ 2 | .github/ 3 | build/ 4 | .editorconfig 5 | .gitattributes 6 | .gitignore 7 | CHANGELOG.md 8 | CODE_OF_CONDUCT.md 9 | deploy.sh 10 | font-selection.json 11 | README.md 12 | Vagrantfile -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Questions, Ideas, Discussions 4 | url: https://github.com/slatedocs/slate/discussions 5 | about: Ask and answer questions, and propose new features. 6 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: bundler 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | target-branch: dev 9 | versioning-strategy: increase-if-necessary 10 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | ruby '>= 2.6' 2 | source 'https://rubygems.org' 3 | 4 | # Middleman 5 | gem 'middleman', '~> 4.4' 6 | gem 'middleman-syntax', '~> 3.2' 7 | gem 'middleman-autoprefixer', '~> 3.0' 8 | gem 'middleman-sprockets', '~> 4.1' 9 | gem 'rouge', '~> 3.21' 10 | gem 'redcarpet', '~> 3.6.0' 11 | gem 'nokogiri', '~> 1.13.3' 12 | gem 'sass' 13 | gem 'webrick' 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.rbc 3 | .bundle 4 | .config 5 | coverage 6 | InstalledFiles 7 | lib/bundler/man 8 | pkg 9 | rdoc 10 | spec/reports 11 | test/tmp 12 | test/version_tmp 13 | tmp 14 | *.DS_STORE 15 | build/ 16 | .cache 17 | .vagrant 18 | .sass-cache 19 | 20 | # YARD artifacts 21 | .yardoc 22 | _yardoc 23 | doc/ 24 | .idea/ 25 | 26 | # Vagrant artifacts 27 | ubuntu-*-console.log 28 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # Top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | indent_style = space 11 | indent_size = 2 12 | trim_trailing_whitespace = true 13 | 14 | [*.rb] 15 | charset = utf-8 16 | 17 | [*.md] 18 | trim_trailing_whitespace = false 19 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:2.6-slim 2 | 3 | WORKDIR /srv/slate 4 | 5 | EXPOSE 4567 6 | 7 | COPY Gemfile . 8 | COPY Gemfile.lock . 9 | 10 | RUN apt-get update \ 11 | && apt-get install -y --no-install-recommends \ 12 | build-essential \ 13 | git \ 14 | nodejs \ 15 | && gem install bundler \ 16 | && bundle install \ 17 | && apt-get remove -y build-essential git \ 18 | && apt-get autoremove -y \ 19 | && rm -rf /var/lib/apt/lists/* 20 | 21 | COPY . /srv/slate 22 | 23 | RUN chmod +x /srv/slate/slate.sh 24 | 25 | ENTRYPOINT ["/srv/slate/slate.sh"] 26 | CMD ["build"] 27 | -------------------------------------------------------------------------------- /lib/multilang.rb: -------------------------------------------------------------------------------- 1 | module Multilang 2 | def block_code(code, full_lang_name) 3 | if full_lang_name 4 | parts = full_lang_name.split('--') 5 | rouge_lang_name = (parts) ? parts[0] : "" # just parts[0] here causes null ref exception when no language specified 6 | super(code, rouge_lang_name).sub("highlight #{rouge_lang_name}") do |match| 7 | match + " tab-" + full_lang_name 8 | end 9 | else 10 | super(code, full_lang_name) 11 | end 12 | end 13 | end 14 | 15 | require 'middleman-core/renderers/redcarpet' 16 | Middleman::Renderers::MiddlemanRedcarpetHTML.send :include, Multilang 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Report a Bug 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Bug Description** 11 | A clear and concise description of what the bug is and how to reproduce it. 12 | 13 | **Screenshots** 14 | If applicable, add screenshots to help explain your problem. 15 | 16 | **Browser (please complete the following information):** 17 | - OS: [e.g. iOS] 18 | - Browser [e.g. chrome, safari] 19 | - Version [e.g. 22] 20 | 21 | **Last upstream Slate commit (run `git log --author="\(Robert Lord\)\|\(Matthew Peveler\)\|\(Mike Ralphson\)" | head -n 1`):** 22 | Put the commit hash here 23 | -------------------------------------------------------------------------------- /source/javascripts/app/_copy.js: -------------------------------------------------------------------------------- 1 | function copyToClipboard(container) { 2 | const el = document.createElement('textarea'); 3 | el.value = container.textContent.replace(/\n$/, ''); 4 | document.body.appendChild(el); 5 | el.select(); 6 | document.execCommand('copy'); 7 | document.body.removeChild(el); 8 | } 9 | 10 | function setupCodeCopy() { 11 | $('pre.highlight').prepend('
Copy to Clipboard
'); 12 | $('.copy-clipboard').on('click', function() { 13 | copyToClipboard(this.parentNode.children[1]); 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /lib/nesting_unique_head.rb: -------------------------------------------------------------------------------- 1 | # Nested unique header generation 2 | require 'middleman-core/renderers/redcarpet' 3 | 4 | class NestingUniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML 5 | def initialize 6 | super 7 | @@headers_history = {} if !defined?(@@headers_history) 8 | end 9 | 10 | def header(text, header_level) 11 | friendly_text = text.gsub(/<[^>]*>/,"").parameterize 12 | @@headers_history[header_level] = text.parameterize 13 | 14 | if header_level > 1 15 | for i in (header_level - 1).downto(1) 16 | friendly_text.prepend("#{@@headers_history[i]}-") if @@headers_history.key?(i) 17 | end 18 | end 19 | 20 | return "#{text}" 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /source/javascripts/all_nosearch.js: -------------------------------------------------------------------------------- 1 | //= require ./lib/_energize 2 | //= require ./app/_copy 3 | //= require ./app/_toc 4 | //= require ./app/_lang 5 | 6 | function adjustLanguageSelectorWidth() { 7 | const elem = $('.dark-box > .lang-selector'); 8 | elem.width(elem.parent().width()); 9 | } 10 | 11 | $(function() { 12 | loadToc($('#toc'), '.toc-link', '.toc-list-h2', 10); 13 | setupLanguages($('body').data('languages')); 14 | $('.content').imagesLoaded( function() { 15 | window.recacheHeights(); 16 | window.refreshToc(); 17 | }); 18 | 19 | $(window).resize(function() { 20 | adjustLanguageSelectorWidth(); 21 | }); 22 | adjustLanguageSelectorWidth(); 23 | }); 24 | 25 | window.onpopstate = function() { 26 | activateLanguage(getLanguageFromQueryString()); 27 | }; 28 | -------------------------------------------------------------------------------- /lib/toc_data.rb: -------------------------------------------------------------------------------- 1 | require 'nokogiri' 2 | 3 | def toc_data(page_content) 4 | html_doc = Nokogiri::HTML::DocumentFragment.parse(page_content) 5 | 6 | # get a flat list of headers 7 | headers = [] 8 | html_doc.css('h1, h2, h3').each do |header| 9 | headers.push({ 10 | id: header.attribute('id').to_s, 11 | content: header.children, 12 | title: header.children.to_s.gsub(/<[^>]*>/, ''), 13 | level: header.name[1].to_i, 14 | children: [] 15 | }) 16 | end 17 | 18 | [3,2].each do |header_level| 19 | header_to_nest = nil 20 | headers = headers.reject do |header| 21 | if header[:level] == header_level 22 | header_to_nest[:children].push header if header_to_nest 23 | true 24 | else 25 | header_to_nest = header if header[:level] < header_level 26 | false 27 | end 28 | end 29 | end 30 | headers 31 | end 32 | -------------------------------------------------------------------------------- /lib/unique_head.rb: -------------------------------------------------------------------------------- 1 | # Unique header generation 2 | require 'middleman-core/renderers/redcarpet' 3 | require 'digest' 4 | class UniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML 5 | def initialize 6 | super 7 | @head_count = {} 8 | end 9 | def header(text, header_level) 10 | friendly_text = text.gsub(/<[^>]*>/,"").parameterize 11 | if friendly_text.strip.length == 0 12 | # Looks like parameterize removed the whole thing! It removes many unicode 13 | # characters like Chinese and Russian. To get a unique URL, let's just 14 | # URI escape the whole header 15 | friendly_text = Digest::SHA1.hexdigest(text)[0,10] 16 | end 17 | @head_count[friendly_text] ||= 0 18 | @head_count[friendly_text] += 1 19 | if @head_count[friendly_text] > 1 20 | friendly_text += "-#{@head_count[friendly_text]}" 21 | end 22 | return "#{text}" 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /source/stylesheets/_icon-font.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'slate'; 3 | src:font-url('slate.eot?-syv14m'); 4 | src:font-url('slate.eot?#iefix-syv14m') format('embedded-opentype'), 5 | font-url('slate.woff2?-syv14m') format('woff2'), 6 | font-url('slate.woff?-syv14m') format('woff'), 7 | font-url('slate.ttf?-syv14m') format('truetype'), 8 | font-url('slate.svg?-syv14m#slate') format('svg'); 9 | font-weight: normal; 10 | font-style: normal; 11 | } 12 | 13 | %icon { 14 | font-family: 'slate'; 15 | speak: none; 16 | font-style: normal; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | } 22 | 23 | %icon-exclamation-sign { 24 | @extend %icon; 25 | content: "\e600"; 26 | } 27 | %icon-info-sign { 28 | @extend %icon; 29 | content: "\e602"; 30 | } 31 | %icon-ok-sign { 32 | @extend %icon; 33 | content: "\e606"; 34 | } 35 | %icon-search { 36 | @extend %icon; 37 | content: "\e607"; 38 | } 39 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | 3 | on: 4 | push: 5 | branches: [ 'main' ] 6 | 7 | jobs: 8 | deploy: 9 | permissions: 10 | contents: write 11 | 12 | runs-on: ubuntu-latest 13 | env: 14 | ruby-version: 2.6 15 | 16 | steps: 17 | - uses: actions/checkout@v2 18 | - name: Set up Ruby 19 | uses: ruby/setup-ruby@v1 20 | with: 21 | ruby-version: ${{ env.ruby-version }} 22 | 23 | - uses: actions/cache@v2 24 | with: 25 | path: vendor/bundle 26 | key: gems-${{ runner.os }}-${{ env.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }} 27 | restore-keys: | 28 | gems-${{ runner.os }}-${{ env.ruby-version }}- 29 | gems-${{ runner.os }}- 30 | 31 | - run: bundle config set deployment 'true' 32 | - name: bundle install 33 | run: | 34 | bundle config path vendor/bundle 35 | bundle install --jobs 4 --retry 3 36 | 37 | - run: bundle exec middleman build 38 | 39 | - name: Deploy 40 | uses: peaceiris/actions-gh-pages@v3 41 | with: 42 | github_token: ${{ secrets.GITHUB_TOKEN }} 43 | publish_dir: ./build 44 | keep_files: true 45 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: [ '*' ] 6 | pull_request: 7 | branches: [ '*' ] 8 | 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | ruby-version: [2.6, 2.7, '3.0', 3.1, 3.2] 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Set up Ruby 20 | uses: ruby/setup-ruby@v1 21 | with: 22 | ruby-version: ${{ matrix.ruby-version }} 23 | 24 | - uses: actions/cache@v2 25 | with: 26 | path: vendor/bundle 27 | key: gems-${{ runner.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }} 28 | restore-keys: | 29 | gems-${{ runner.os }}-${{ matrix.ruby-version }}- 30 | gems-${{ runner.os }}- 31 | 32 | # necessary to get ruby 2.3 to work nicely with bundler vendor/bundle cache 33 | # can remove once ruby 2.3 is no longer supported 34 | - run: gem update --system 35 | 36 | - run: bundle config set deployment 'true' 37 | - name: bundle install 38 | run: | 39 | bundle config path vendor/bundle 40 | bundle install --jobs 4 --retry 3 41 | 42 | - run: bundle exec middleman build 43 | -------------------------------------------------------------------------------- /source/includes/_errors.md: -------------------------------------------------------------------------------- 1 | # Errors 2 | 3 | 6 | 7 | The Kittn API uses the following error codes: 8 | 9 | 10 | Error Code | Meaning 11 | ---------- | ------- 12 | 400 | Bad Request -- Your request is invalid. 13 | 401 | Unauthorized -- Your API key is wrong. 14 | 403 | Forbidden -- The kitten requested is hidden for administrators only. 15 | 404 | Not Found -- The specified kitten could not be found. 16 | 405 | Method Not Allowed -- You tried to access a kitten with an invalid method. 17 | 406 | Not Acceptable -- You requested a format that isn't json. 18 | 410 | Gone -- The kitten requested has been removed from our servers. 19 | 418 | I'm a teapot. 20 | 429 | Too Many Requests -- You're requesting too many kittens! Slow down! 21 | 500 | Internal Server Error -- We had a problem with our server. Try again later. 22 | 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. 23 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish Docker image 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | push_to_registry: 9 | name: Push Docker image to Docker Hub 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Check out the repo 13 | uses: actions/checkout@v2 14 | 15 | - name: Set up QEMU 16 | uses: docker/setup-qemu-action@v1 17 | with: 18 | platforms: all 19 | 20 | - name: Docker meta 21 | id: meta 22 | uses: docker/metadata-action@v3 23 | with: 24 | images: slatedocs/slate 25 | tags: | 26 | type=ref,event=tag 27 | 28 | - name: Set up Docker Buildx 29 | id: buildx 30 | uses: docker/setup-buildx-action@v1 31 | 32 | - name: Login to DockerHub 33 | uses: docker/login-action@v1 34 | with: 35 | username: ${{ secrets.DOCKER_USERNAME }} 36 | password: ${{ secrets.DOCKER_ACCESS_KEY }} 37 | 38 | - name: Push to Docker Hub 39 | uses: docker/build-push-action@v2 40 | with: 41 | builder: ${{ steps.buildx.outputs.name }} 42 | context: . 43 | file: ./Dockerfile 44 | platforms: linux/amd64,linux/arm64,linux/ppc64le 45 | push: true 46 | tags: ${{ steps.meta.outputs.tags }} 47 | labels: ${{ steps.meta.outputs.labels }} 48 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure(2) do |config| 2 | config.vm.box = "ubuntu/focal64" 3 | config.vm.network :forwarded_port, guest: 4567, host: 4567 4 | config.vm.provider "virtualbox" do |vb| 5 | vb.memory = "2048" 6 | end 7 | 8 | config.vm.provision "bootstrap", 9 | type: "shell", 10 | inline: <<-SHELL 11 | # add nodejs v12 repository 12 | curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - 13 | 14 | sudo apt-get update 15 | sudo apt-get install -yq ruby ruby-dev 16 | sudo apt-get install -yq pkg-config build-essential nodejs git libxml2-dev libxslt-dev 17 | sudo apt-get autoremove -yq 18 | gem install --no-document bundler 19 | SHELL 20 | 21 | # add the local user git config to the vm 22 | config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig" 23 | 24 | config.vm.provision "install", 25 | type: "shell", 26 | privileged: false, 27 | inline: <<-SHELL 28 | echo "==============================================" 29 | echo "Installing app dependencies" 30 | cd /vagrant 31 | sudo gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)" 32 | bundle config build.nokogiri --use-system-libraries 33 | bundle install 34 | SHELL 35 | 36 | config.vm.provision "run", 37 | type: "shell", 38 | privileged: false, 39 | run: "always", 40 | inline: <<-SHELL 41 | echo "==============================================" 42 | echo "Starting up middleman at http://localhost:4567" 43 | echo "If it does not come up, check the ~/middleman.log file for any error messages" 44 | cd /vagrant 45 | bundle exec middleman server --watcher-force-polling --watcher-latency=1 &> ~/middleman.log & 46 | SHELL 47 | end 48 | -------------------------------------------------------------------------------- /config.rb: -------------------------------------------------------------------------------- 1 | # Unique header generation 2 | require './lib/unique_head.rb' 3 | 4 | # Markdown 5 | set :markdown_engine, :redcarpet 6 | set :markdown, 7 | fenced_code_blocks: true, 8 | smartypants: true, 9 | disable_indented_code_blocks: true, 10 | prettify: true, 11 | strikethrough: true, 12 | tables: true, 13 | with_toc_data: true, 14 | no_intra_emphasis: true, 15 | renderer: UniqueHeadCounter 16 | 17 | # Assets 18 | set :css_dir, 'stylesheets' 19 | set :js_dir, 'javascripts' 20 | set :images_dir, 'images' 21 | set :fonts_dir, 'fonts' 22 | 23 | # Activate the syntax highlighter 24 | activate :syntax 25 | ready do 26 | require './lib/monokai_sublime_slate.rb' 27 | require './lib/multilang.rb' 28 | end 29 | 30 | activate :sprockets 31 | 32 | activate :autoprefixer do |config| 33 | config.browsers = ['last 2 version', 'Firefox ESR'] 34 | config.cascade = false 35 | config.inline = true 36 | end 37 | 38 | # Github pages require relative links 39 | activate :relative_assets 40 | set :relative_links, true 41 | 42 | # Build Configuration 43 | configure :build do 44 | # We do want to hash woff and woff2 as there's a bug where woff2 will use 45 | # woff asset hash which breaks things. Trying to use a combination of ignore and 46 | # rewrite_ignore does not work as it conflicts weirdly with relative_assets. Disabling 47 | # the .woff2 extension only does not work as .woff will still activate it so have to 48 | # have both. See https://github.com/slatedocs/slate/issues/1171 for more details. 49 | activate :asset_hash, :exts => app.config[:asset_extensions] - %w[.woff .woff2] 50 | # If you're having trouble with Middleman hanging, commenting 51 | # out the following two lines has been known to help 52 | activate :minify_css 53 | activate :minify_javascript 54 | # activate :gzip 55 | end 56 | 57 | # Deploy Configuration 58 | # If you want Middleman to listen on a different port, you can set that below 59 | set :port, 4567 60 | 61 | helpers do 62 | require './lib/toc_data.rb' 63 | end 64 | -------------------------------------------------------------------------------- /.github/workflows/dev_deploy.yml: -------------------------------------------------------------------------------- 1 | name: Dev Deploy 2 | 3 | on: 4 | push: 5 | branches: [ 'dev' ] 6 | 7 | jobs: 8 | push_to_registry: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Check out the repo 13 | uses: actions/checkout@v2 14 | 15 | - name: Set up QEMU 16 | uses: docker/setup-qemu-action@v1 17 | with: 18 | platforms: all 19 | 20 | - name: Docker meta 21 | id: meta 22 | uses: docker/metadata-action@v3 23 | with: 24 | images: | 25 | slatedocs/slate 26 | tags: | 27 | type=ref,event=branch 28 | 29 | - name: Set up Docker Buildx 30 | id: buildx 31 | uses: docker/setup-buildx-action@v1 32 | 33 | - name: Login to DockerHub 34 | uses: docker/login-action@v1 35 | with: 36 | username: ${{ secrets.DOCKER_USERNAME }} 37 | password: ${{ secrets.DOCKER_ACCESS_KEY }} 38 | 39 | - name: Push to Docker Hub 40 | uses: docker/build-push-action@v2 41 | with: 42 | builder: ${{ steps.buildx.outputs.name }} 43 | context: . 44 | file: ./Dockerfile 45 | platforms: linux/amd64,linux/arm64,linux/ppc64le 46 | push: true 47 | tags: ${{ steps.meta.outputs.tags }} 48 | labels: ${{ steps.meta.outputs.labels }} 49 | 50 | deploy_gh: 51 | permissions: 52 | contents: write 53 | 54 | runs-on: ubuntu-latest 55 | env: 56 | ruby-version: 2.6 57 | 58 | steps: 59 | - uses: actions/checkout@v2 60 | - name: Set up Ruby 61 | uses: ruby/setup-ruby@v1 62 | with: 63 | ruby-version: ${{ env.ruby-version }} 64 | 65 | - uses: actions/cache@v2 66 | with: 67 | path: vendor/bundle 68 | key: gems-${{ runner.os }}-${{ env.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }} 69 | restore-keys: | 70 | gems-${{ runner.os }}-${{ env.ruby-version }}- 71 | gems-${{ runner.os }}- 72 | - run: bundle config set deployment 'true' 73 | - name: bundle install 74 | run: | 75 | bundle config path vendor/bundle 76 | bundle install --jobs 4 --retry 3 77 | - run: bundle exec middleman build 78 | 79 | - name: Deploy 80 | uses: peaceiris/actions-gh-pages@v3.7.0-8 81 | with: 82 | github_token: ${{ secrets.GITHUB_TOKEN }} 83 | destination_dir: dev 84 | publish_dir: ./build 85 | keep_files: true 86 | -------------------------------------------------------------------------------- /source/fonts/slate.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /source/javascripts/app/_search.js: -------------------------------------------------------------------------------- 1 | //= require ../lib/_lunr 2 | //= require ../lib/_jquery 3 | //= require ../lib/_jquery.highlight 4 | ;(function () { 5 | 'use strict'; 6 | 7 | var content, searchResults; 8 | var highlightOpts = { element: 'span', className: 'search-highlight' }; 9 | var searchDelay = 0; 10 | var timeoutHandle = 0; 11 | var index; 12 | 13 | function populate() { 14 | index = lunr(function(){ 15 | 16 | this.ref('id'); 17 | this.field('title', { boost: 10 }); 18 | this.field('body'); 19 | this.pipeline.add(lunr.trimmer, lunr.stopWordFilter); 20 | var lunrConfig = this; 21 | 22 | $('h1, h2').each(function() { 23 | var title = $(this); 24 | var body = title.nextUntil('h1, h2'); 25 | lunrConfig.add({ 26 | id: title.prop('id'), 27 | title: title.text(), 28 | body: body.text() 29 | }); 30 | }); 31 | 32 | }); 33 | determineSearchDelay(); 34 | } 35 | 36 | $(populate); 37 | $(bind); 38 | 39 | function determineSearchDelay() { 40 | if (index.tokenSet.toArray().length>5000) { 41 | searchDelay = 300; 42 | } 43 | } 44 | 45 | function bind() { 46 | content = $('.content'); 47 | searchResults = $('.search-results'); 48 | 49 | $('#input-search').on('keyup',function(e) { 50 | var wait = function() { 51 | return function(executingFunction, waitTime){ 52 | clearTimeout(timeoutHandle); 53 | timeoutHandle = setTimeout(executingFunction, waitTime); 54 | }; 55 | }(); 56 | wait(function(){ 57 | search(e); 58 | }, searchDelay); 59 | }); 60 | } 61 | 62 | function search(event) { 63 | 64 | var searchInput = $('#input-search')[0]; 65 | 66 | unhighlight(); 67 | searchResults.addClass('visible'); 68 | 69 | // ESC clears the field 70 | if (event.keyCode === 27) searchInput.value = ''; 71 | 72 | if (searchInput.value) { 73 | var results = index.search(searchInput.value).filter(function(r) { 74 | return r.score > 0.0001; 75 | }); 76 | 77 | if (results.length) { 78 | searchResults.empty(); 79 | $.each(results, function (index, result) { 80 | var elem = document.getElementById(result.ref); 81 | searchResults.append("
  • " + $(elem).text() + "
  • "); 82 | }); 83 | highlight.call(searchInput); 84 | } else { 85 | searchResults.html('
  • '); 86 | $('.search-results li').text('No Results Found for "' + searchInput.value + '"'); 87 | } 88 | } else { 89 | unhighlight(); 90 | searchResults.removeClass('visible'); 91 | } 92 | } 93 | 94 | function highlight() { 95 | if (this.value) content.highlight(this.value, highlightOpts); 96 | } 97 | 98 | function unhighlight() { 99 | content.unhighlight(highlightOpts); 100 | } 101 | })(); 102 | 103 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hello@lord.io. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /source/stylesheets/print.css.scss: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | @import 'normalize'; 3 | @import 'variables'; 4 | @import 'icon-font'; 5 | 6 | /* 7 | Copyright 2008-2013 Concur Technologies, Inc. 8 | 9 | Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | not use this file except in compliance with the License. You may obtain 11 | a copy of the License at 12 | 13 | http://www.apache.org/licenses/LICENSE-2.0 14 | 15 | Unless required by applicable law or agreed to in writing, software 16 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 18 | License for the specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | $print-color: #999; 23 | $print-color-light: #ccc; 24 | $print-font-size: 12px; 25 | 26 | body { 27 | @extend %default-font; 28 | } 29 | 30 | .tocify, .toc-footer, .lang-selector, .search, #nav-button { 31 | display: none; 32 | } 33 | 34 | .tocify-wrapper>img { 35 | margin: 0 auto; 36 | display: block; 37 | } 38 | 39 | .content { 40 | font-size: 12px; 41 | 42 | pre, code { 43 | @extend %code-font; 44 | @extend %break-words; 45 | border: 1px solid $print-color; 46 | border-radius: 5px; 47 | font-size: 0.8em; 48 | } 49 | 50 | pre { 51 | code { 52 | border: 0; 53 | } 54 | } 55 | 56 | pre { 57 | padding: 1.3em; 58 | } 59 | 60 | code { 61 | padding: 0.2em; 62 | } 63 | 64 | table { 65 | border: 1px solid $print-color; 66 | tr { 67 | border-bottom: 1px solid $print-color; 68 | } 69 | td,th { 70 | padding: 0.7em; 71 | } 72 | } 73 | 74 | p { 75 | line-height: 1.5; 76 | } 77 | 78 | a { 79 | text-decoration: none; 80 | color: #000; 81 | } 82 | 83 | h1 { 84 | @extend %header-font; 85 | font-size: 2.5em; 86 | padding-top: 0.5em; 87 | padding-bottom: 0.5em; 88 | margin-top: 1em; 89 | margin-bottom: $h1-margin-bottom; 90 | border: 2px solid $print-color-light; 91 | border-width: 2px 0; 92 | text-align: center; 93 | } 94 | 95 | h2 { 96 | @extend %header-font; 97 | font-size: 1.8em; 98 | margin-top: 2em; 99 | border-top: 2px solid $print-color-light; 100 | padding-top: 0.8em; 101 | } 102 | 103 | h1+h2, h1+div+h2 { 104 | border-top: none; 105 | padding-top: 0; 106 | margin-top: 0; 107 | } 108 | 109 | h3, h4 { 110 | @extend %header-font; 111 | font-size: 0.8em; 112 | margin-top: 1.5em; 113 | margin-bottom: 0.8em; 114 | text-transform: uppercase; 115 | } 116 | 117 | h5, h6 { 118 | text-transform: uppercase; 119 | } 120 | 121 | aside { 122 | padding: 1em; 123 | border: 1px solid $print-color-light; 124 | border-radius: 5px; 125 | margin-top: 1.5em; 126 | margin-bottom: 1.5em; 127 | line-height: 1.6; 128 | } 129 | 130 | aside:before { 131 | vertical-align: middle; 132 | padding-right: 0.5em; 133 | font-size: 14px; 134 | } 135 | 136 | aside.notice:before { 137 | @extend %icon-info-sign; 138 | } 139 | 140 | aside.warning:before { 141 | @extend %icon-exclamation-sign; 142 | } 143 | 144 | aside.success:before { 145 | @extend %icon-ok-sign; 146 | } 147 | } 148 | 149 | .copy-clipboard { 150 | @media print { 151 | display: none 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /source/stylesheets/_rtl.scss: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // RTL Styles Variables 3 | //////////////////////////////////////////////////////////////////////////////// 4 | 5 | $default: auto; 6 | 7 | //////////////////////////////////////////////////////////////////////////////// 8 | // TABLE OF CONTENTS 9 | //////////////////////////////////////////////////////////////////////////////// 10 | 11 | #toc>ul>li>a>span { 12 | float: left; 13 | } 14 | 15 | .toc-wrapper { 16 | transition: right 0.3s ease-in-out !important; 17 | left: $default !important; 18 | #{right}: 0; 19 | } 20 | 21 | .toc-h2 { 22 | padding-#{right}: $nav-padding + $nav-indent; 23 | } 24 | 25 | #nav-button { 26 | #{right}: 0; 27 | transition: right 0.3s ease-in-out; 28 | &.open { 29 | right: $nav-width 30 | } 31 | } 32 | 33 | //////////////////////////////////////////////////////////////////////////////// 34 | // PAGE LAYOUT AND CODE SAMPLE BACKGROUND 35 | //////////////////////////////////////////////////////////////////////////////// 36 | .page-wrapper { 37 | margin-#{left}: $default !important; 38 | margin-#{right}: $nav-width; 39 | .dark-box { 40 | #{right}: $default; 41 | #{left}: 0; 42 | } 43 | } 44 | 45 | .lang-selector { 46 | width: $default !important; 47 | a { 48 | float: right; 49 | } 50 | } 51 | 52 | //////////////////////////////////////////////////////////////////////////////// 53 | // CODE SAMPLE STYLES 54 | //////////////////////////////////////////////////////////////////////////////// 55 | .content { 56 | &>h1, 57 | &>h2, 58 | &>h3, 59 | &>h4, 60 | &>h5, 61 | &>h6, 62 | &>p, 63 | &>table, 64 | &>ul, 65 | &>ol, 66 | &>aside, 67 | &>dl { 68 | margin-#{left}: $examples-width; 69 | margin-#{right}: $default !important; 70 | } 71 | &>ul, 72 | &>ol { 73 | padding-#{right}: $main-padding + 15px; 74 | } 75 | table { 76 | th, 77 | td { 78 | text-align: right; 79 | } 80 | } 81 | dd { 82 | margin-#{right}: 15px; 83 | } 84 | aside { 85 | aside:before { 86 | padding-#{left}: 0.5em; 87 | } 88 | .search-highlight { 89 | background: linear-gradient(to top right, #F7E633 0%, #F1D32F 100%); 90 | } 91 | } 92 | pre, 93 | blockquote { 94 | float: left !important; 95 | clear: left !important; 96 | } 97 | } 98 | 99 | //////////////////////////////////////////////////////////////////////////////// 100 | // TYPOGRAPHY 101 | //////////////////////////////////////////////////////////////////////////////// 102 | h1, 103 | h2, 104 | h3, 105 | h4, 106 | h5, 107 | h6, 108 | p, 109 | aside { 110 | text-align: right; 111 | direction: rtl; 112 | } 113 | 114 | .toc-wrapper { 115 | text-align: right; 116 | direction: rtl; 117 | font-weight: 100 !important; 118 | } 119 | 120 | 121 | //////////////////////////////////////////////////////////////////////////////// 122 | // RESPONSIVE DESIGN 123 | //////////////////////////////////////////////////////////////////////////////// 124 | @media (max-width: $tablet-width) { 125 | .toc-wrapper { 126 | #{right}: -$nav-width; 127 | &.open { 128 | #{right}: 0; 129 | } 130 | } 131 | .page-wrapper { 132 | margin-#{right}: 0; 133 | } 134 | } 135 | 136 | @media (max-width: $phone-width) { 137 | %left-col { 138 | margin-#{left}: 0; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | activesupport (6.1.6.1) 5 | concurrent-ruby (~> 1.0, >= 1.0.2) 6 | i18n (>= 1.6, < 2) 7 | minitest (>= 5.1) 8 | tzinfo (~> 2.0) 9 | zeitwerk (~> 2.3) 10 | addressable (2.8.1) 11 | public_suffix (>= 2.0.2, < 6.0) 12 | autoprefixer-rails (10.2.5.0) 13 | execjs (< 2.8.0) 14 | backports (3.23.0) 15 | coffee-script (2.4.1) 16 | coffee-script-source 17 | execjs 18 | coffee-script-source (1.12.2) 19 | concurrent-ruby (1.2.0) 20 | contracts (0.16.1) 21 | dotenv (2.8.1) 22 | erubis (2.7.0) 23 | execjs (2.7.0) 24 | fast_blank (1.0.1) 25 | fastimage (2.2.6) 26 | ffi (1.15.5) 27 | haml (5.2.2) 28 | temple (>= 0.8.0) 29 | tilt 30 | hamster (3.0.0) 31 | concurrent-ruby (~> 1.0) 32 | hashie (3.6.0) 33 | i18n (1.6.0) 34 | concurrent-ruby (~> 1.0) 35 | kramdown (2.4.0) 36 | rexml 37 | listen (3.8.0) 38 | rb-fsevent (~> 0.10, >= 0.10.3) 39 | rb-inotify (~> 0.9, >= 0.9.10) 40 | memoist (0.16.2) 41 | middleman (4.4.3) 42 | coffee-script (~> 2.2) 43 | haml (>= 4.0.5, < 6.0) 44 | kramdown (>= 2.3.0) 45 | middleman-cli (= 4.4.3) 46 | middleman-core (= 4.4.3) 47 | middleman-autoprefixer (3.0.0) 48 | autoprefixer-rails (~> 10.0) 49 | middleman-core (>= 4.0.0) 50 | middleman-cli (4.4.3) 51 | thor (>= 0.17.0, < 2.0) 52 | middleman-core (4.4.3) 53 | activesupport (>= 6.1, < 7.1) 54 | addressable (~> 2.4) 55 | backports (~> 3.6) 56 | bundler (~> 2.0) 57 | contracts (~> 0.13) 58 | dotenv 59 | erubis 60 | execjs (~> 2.0) 61 | fast_blank 62 | fastimage (~> 2.0) 63 | hamster (~> 3.0) 64 | hashie (~> 3.4) 65 | i18n (~> 1.6.0) 66 | listen (~> 3.0) 67 | memoist (~> 0.14) 68 | padrino-helpers (~> 0.15.0) 69 | parallel 70 | rack (>= 1.4.5, < 3) 71 | sassc (~> 2.0) 72 | servolux 73 | tilt (~> 2.0.9) 74 | toml 75 | uglifier (~> 3.0) 76 | webrick 77 | middleman-sprockets (4.1.1) 78 | middleman-core (~> 4.0) 79 | sprockets (>= 3.0) 80 | middleman-syntax (3.3.0) 81 | middleman-core (>= 3.2) 82 | rouge (~> 3.2) 83 | mini_portile2 (2.8.0) 84 | minitest (5.17.0) 85 | nokogiri (1.13.9) 86 | mini_portile2 (~> 2.8.0) 87 | racc (~> 1.4) 88 | padrino-helpers (0.15.2) 89 | i18n (>= 0.6.7, < 2) 90 | padrino-support (= 0.15.2) 91 | tilt (>= 1.4.1, < 3) 92 | padrino-support (0.15.2) 93 | parallel (1.22.1) 94 | parslet (2.0.0) 95 | public_suffix (5.0.1) 96 | racc (1.6.0) 97 | rack (2.2.6.2) 98 | rb-fsevent (0.11.2) 99 | rb-inotify (0.10.1) 100 | ffi (~> 1.0) 101 | redcarpet (3.6.0) 102 | rexml (3.2.5) 103 | rouge (3.30.0) 104 | sass (3.7.4) 105 | sass-listen (~> 4.0.0) 106 | sass-listen (4.0.0) 107 | rb-fsevent (~> 0.9, >= 0.9.4) 108 | rb-inotify (~> 0.9, >= 0.9.7) 109 | sassc (2.4.0) 110 | ffi (~> 1.9) 111 | servolux (0.13.0) 112 | sprockets (3.7.2) 113 | concurrent-ruby (~> 1.0) 114 | rack (> 1, < 3) 115 | temple (0.10.0) 116 | thor (1.2.1) 117 | tilt (2.0.11) 118 | toml (0.3.0) 119 | parslet (>= 1.8.0, < 3.0.0) 120 | tzinfo (2.0.6) 121 | concurrent-ruby (~> 1.0) 122 | uglifier (3.2.0) 123 | execjs (>= 0.3.0, < 3) 124 | webrick (1.8.1) 125 | zeitwerk (2.6.0) 126 | 127 | PLATFORMS 128 | ruby 129 | 130 | DEPENDENCIES 131 | middleman (~> 4.4) 132 | middleman-autoprefixer (~> 3.0) 133 | middleman-sprockets (~> 4.1) 134 | middleman-syntax (~> 3.2) 135 | nokogiri (~> 1.13.3) 136 | redcarpet (~> 3.6.0) 137 | rouge (~> 3.21) 138 | sass 139 | webrick 140 | 141 | RUBY VERSION 142 | ruby 2.7.2p137 143 | 144 | BUNDLED WITH 145 | 2.2.22 146 | -------------------------------------------------------------------------------- /lib/monokai_sublime_slate.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- # 2 | # frozen_string_literal: true 3 | 4 | # this is based on https://github.com/rouge-ruby/rouge/blob/master/lib/rouge/themes/monokai_sublime.rb 5 | # but without the added background, and changed styling for JSON keys to be soft_yellow instead of white 6 | 7 | module Rouge 8 | module Themes 9 | class MonokaiSublimeSlate < CSSTheme 10 | name 'monokai.sublime.slate' 11 | 12 | palette :black => '#000000' 13 | palette :bright_green => '#a6e22e' 14 | palette :bright_pink => '#f92672' 15 | palette :carmine => '#960050' 16 | palette :dark => '#49483e' 17 | palette :dark_grey => '#888888' 18 | palette :dark_red => '#aa0000' 19 | palette :dimgrey => '#75715e' 20 | palette :emperor => '#555555' 21 | palette :grey => '#999999' 22 | palette :light_grey => '#aaaaaa' 23 | palette :light_violet => '#ae81ff' 24 | palette :soft_cyan => '#66d9ef' 25 | palette :soft_yellow => '#e6db74' 26 | palette :very_dark => '#1e0010' 27 | palette :whitish => '#f8f8f2' 28 | palette :orange => '#f6aa11' 29 | palette :white => '#ffffff' 30 | 31 | style Generic::Heading, :fg => :grey 32 | style Literal::String::Regex, :fg => :orange 33 | style Generic::Output, :fg => :dark_grey 34 | style Generic::Prompt, :fg => :emperor 35 | style Generic::Strong, :bold => false 36 | style Generic::Subheading, :fg => :light_grey 37 | style Name::Builtin, :fg => :orange 38 | style Comment::Multiline, 39 | Comment::Preproc, 40 | Comment::Single, 41 | Comment::Special, 42 | Comment, :fg => :dimgrey 43 | style Error, 44 | Generic::Error, 45 | Generic::Traceback, :fg => :carmine 46 | style Generic::Deleted, 47 | Generic::Inserted, 48 | Generic::Emph, :fg => :dark 49 | style Keyword::Constant, 50 | Keyword::Declaration, 51 | Keyword::Reserved, 52 | Name::Constant, 53 | Keyword::Type, :fg => :soft_cyan 54 | style Literal::Number::Float, 55 | Literal::Number::Hex, 56 | Literal::Number::Integer::Long, 57 | Literal::Number::Integer, 58 | Literal::Number::Oct, 59 | Literal::Number, 60 | Literal::String::Char, 61 | Literal::String::Escape, 62 | Literal::String::Symbol, :fg => :light_violet 63 | style Literal::String::Doc, 64 | Literal::String::Double, 65 | Literal::String::Backtick, 66 | Literal::String::Heredoc, 67 | Literal::String::Interpol, 68 | Literal::String::Other, 69 | Literal::String::Single, 70 | Literal::String, :fg => :soft_yellow 71 | style Name::Attribute, 72 | Name::Class, 73 | Name::Decorator, 74 | Name::Exception, 75 | Name::Function, :fg => :bright_green 76 | style Name::Variable::Class, 77 | Name::Namespace, 78 | Name::Entity, 79 | Name::Builtin::Pseudo, 80 | Name::Variable::Global, 81 | Name::Variable::Instance, 82 | Name::Variable, 83 | Text::Whitespace, 84 | Text, 85 | Name, :fg => :white 86 | style Name::Label, :fg => :bright_pink 87 | style Operator::Word, 88 | Name::Tag, 89 | Keyword, 90 | Keyword::Namespace, 91 | Keyword::Pseudo, 92 | Operator, :fg => :bright_pink 93 | end 94 | end 95 | end 96 | -------------------------------------------------------------------------------- /source/stylesheets/_variables.scss: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2008-2013 Concur Technologies, Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | not use this file except in compliance with the License. You may obtain 6 | a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | License for the specific language governing permissions and limitations 14 | under the License. 15 | */ 16 | 17 | 18 | //////////////////////////////////////////////////////////////////////////////// 19 | // CUSTOMIZE SLATE 20 | //////////////////////////////////////////////////////////////////////////////// 21 | // Use these settings to help adjust the appearance of Slate 22 | 23 | 24 | // BACKGROUND COLORS 25 | //////////////////// 26 | $nav-bg: #2E3336 !default; 27 | $examples-bg: #2E3336 !default; 28 | $code-bg: #1E2224 !default; 29 | $code-annotation-bg: #191D1F !default; 30 | $nav-subitem-bg: #1E2224 !default; 31 | $nav-active-bg: #0F75D4 !default; 32 | $nav-active-parent-bg: #1E2224 !default; // parent links of the current section 33 | $lang-select-border: #000 !default; 34 | $lang-select-bg: #1E2224 !default; 35 | $lang-select-active-bg: $examples-bg !default; // feel free to change this to blue or something 36 | $lang-select-pressed-bg: #111 !default; // color of language tab bg when mouse is pressed 37 | $main-bg: #F3F7F9 !default; 38 | $aside-notice-bg: #8fbcd4 !default; 39 | $aside-warning-bg: #c97a7e !default; 40 | $aside-success-bg: #6ac174 !default; 41 | $search-notice-bg: #c97a7e !default; 42 | 43 | 44 | // TEXT COLORS 45 | //////////////////// 46 | $main-text: #333 !default; // main content text color 47 | $nav-text: #fff !default; 48 | $nav-active-text: #fff !default; 49 | $nav-active-parent-text: #fff !default; // parent links of the current section 50 | $lang-select-text: #fff !default; // color of unselected language tab text 51 | $lang-select-active-text: #fff !default; // color of selected language tab text 52 | $lang-select-pressed-text: #fff !default; // color of language tab text when mouse is pressed 53 | 54 | 55 | // SIZES 56 | //////////////////// 57 | $nav-width: 230px !default; // width of the navbar 58 | $examples-width: 50% !default; // portion of the screen taken up by code examples 59 | $logo-margin: 0px !default; // margin below logo 60 | $main-padding: 28px !default; // padding to left and right of content & examples 61 | $nav-padding: 15px !default; // padding to left and right of navbar 62 | $nav-v-padding: 10px !default; // padding used vertically around search boxes and results 63 | $nav-indent: 10px !default; // extra padding for ToC subitems 64 | $code-annotation-padding: 13px !default; // padding inside code annotations 65 | $h1-margin-bottom: 21px !default; // padding under the largest header tags 66 | $tablet-width: 930px !default; // min width before reverting to tablet size 67 | $phone-width: $tablet-width - $nav-width !default; // min width before reverting to mobile size 68 | 69 | 70 | // FONTS 71 | //////////////////// 72 | %default-font { 73 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 74 | font-size: 14px; 75 | } 76 | 77 | %header-font { 78 | @extend %default-font; 79 | font-weight: bold; 80 | } 81 | 82 | %code-font { 83 | font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif; 84 | font-size: 12px; 85 | line-height: 1.5; 86 | } 87 | 88 | 89 | // OTHER 90 | //////////////////// 91 | $nav-footer-border-color: #666 !default; 92 | $search-box-border-color: #666 !default; 93 | 94 | 95 | //////////////////////////////////////////////////////////////////////////////// 96 | // INTERNAL 97 | //////////////////////////////////////////////////////////////////////////////// 98 | // These settings are probably best left alone. 99 | 100 | %break-words { 101 | word-break: break-all; 102 | hyphens: auto; 103 | } 104 | -------------------------------------------------------------------------------- /source/javascripts/app/_toc.js: -------------------------------------------------------------------------------- 1 | //= require ../lib/_jquery 2 | //= require ../lib/_imagesloaded.min 3 | ;(function () { 4 | 'use strict'; 5 | 6 | var htmlPattern = /<[^>]*>/g; 7 | var loaded = false; 8 | 9 | var debounce = function(func, waitTime) { 10 | var timeout = false; 11 | return function() { 12 | if (timeout === false) { 13 | setTimeout(function() { 14 | func(); 15 | timeout = false; 16 | }, waitTime); 17 | timeout = true; 18 | } 19 | }; 20 | }; 21 | 22 | var closeToc = function() { 23 | $(".toc-wrapper").removeClass('open'); 24 | $("#nav-button").removeClass('open'); 25 | }; 26 | 27 | function loadToc($toc, tocLinkSelector, tocListSelector, scrollOffset) { 28 | var headerHeights = {}; 29 | var pageHeight = 0; 30 | var windowHeight = 0; 31 | var originalTitle = document.title; 32 | 33 | var recacheHeights = function() { 34 | headerHeights = {}; 35 | pageHeight = $(document).height(); 36 | windowHeight = $(window).height(); 37 | 38 | $toc.find(tocLinkSelector).each(function() { 39 | var targetId = $(this).attr('href'); 40 | if (targetId[0] === "#") { 41 | headerHeights[targetId] = $("#" + $.escapeSelector(targetId.substring(1))).offset().top; 42 | } 43 | }); 44 | }; 45 | 46 | var refreshToc = function() { 47 | var currentTop = $(document).scrollTop() + scrollOffset; 48 | 49 | if (currentTop + windowHeight >= pageHeight) { 50 | // at bottom of page, so just select last header by making currentTop very large 51 | // this fixes the problem where the last header won't ever show as active if its content 52 | // is shorter than the window height 53 | currentTop = pageHeight + 1000; 54 | } 55 | 56 | var best = null; 57 | for (var name in headerHeights) { 58 | if ((headerHeights[name] < currentTop && headerHeights[name] > headerHeights[best]) || best === null) { 59 | best = name; 60 | } 61 | } 62 | 63 | // Catch the initial load case 64 | if (currentTop == scrollOffset && !loaded) { 65 | best = window.location.hash; 66 | loaded = true; 67 | } 68 | 69 | var $best = $toc.find("[href='" + best + "']").first(); 70 | if (!$best.hasClass("active")) { 71 | // .active is applied to the ToC link we're currently on, and its parent