Skip to content

Commit ad386c7

Browse files
committed
Update Slate
1 parent 1bedf7f commit ad386c7

File tree

8 files changed

+213
-0
lines changed

8 files changed

+213
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source/javascripts/lib/* linguist-vendored

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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" | head -n 1`):**
22+
Put the commit hash here

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
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.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!--
2+
⚠️ 🚨 ⚠️ STOP AND READ THIS ⚠️ 🚨 ⚠️
3+
4+
👆👆 see that 'base fork' dropdown above? You should change it! The default value of "slatedocs/slate" submits your change to ALL USERS OF SLATE, not just your company. This is PROBABLY NOT WHAT YOU WANT.
5+
-->

.github/workflows/build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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.3, 2.4, 2.5, 2.6, 2.7]
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@v1
25+
with:
26+
path: vendor/bundle
27+
key: gems-${{ runner.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
28+
29+
# necessary to get ruby 2.3 to work nicely with bundler vendor/bundle cache
30+
# can remove once ruby 2.3 is no longer supported
31+
- run: gem update --system
32+
33+
- run: bundle config set deployment 'true'
34+
- run: bundle install
35+
36+
- run: bundle exec middleman build

.github/workflows/deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches: [ 'main' ]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
env:
11+
ruby-version: 2.5
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Ruby
16+
uses: ruby/setup-ruby@v1
17+
with:
18+
ruby-version: ${{ env.ruby-version }}
19+
20+
- uses: actions/cache@v1
21+
with:
22+
path: vendor/bundle
23+
key: gems-${{ runner.os }}-${{ env.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
24+
25+
- run: bundle config set deployment 'true'
26+
- run: bundle install
27+
28+
- run: bundle exec middleman build
29+
30+
- name: Deploy
31+
uses: peaceiris/actions-gh-pages@v3
32+
with:
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
publish_dir: ./build

lib/monokai_sublime_slate.rb

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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

source/javascripts/app/_copy.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function copyToClipboard(container) {
2+
const el = document.createElement('textarea');
3+
el.value = container.textContent;
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('<div class="copy-clipboard"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>Copy to Clipboard</title><path d="M18 6v-6h-18v18h6v6h18v-18h-6zm-12 10h-4v-14h14v4h-10v10zm16 6h-14v-14h14v14z"></path></svg></div>');
12+
$('.copy-clipboard').on('click', function() {
13+
copyToClipboard(this.parentNode.children[1]);
14+
});
15+
}

0 commit comments

Comments
 (0)