volt-code_highlight 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +35 -0
- data/Rakefile +1 -0
- data/app/code_highlight/assets/css/agate.css +137 -0
- data/app/code_highlight/assets/css/androidstudio.css +53 -0
- data/app/code_highlight/assets/css/arta.css +138 -0
- data/app/code_highlight/assets/css/ascetic.css +52 -0
- data/app/code_highlight/assets/css/atelier-cave.dark.css +113 -0
- data/app/code_highlight/assets/css/atelier-cave.light.css +113 -0
- data/app/code_highlight/assets/css/atelier-dune.dark.css +94 -0
- data/app/code_highlight/assets/css/atelier-dune.light.css +94 -0
- data/app/code_highlight/assets/css/atelier-estuary.dark.css +113 -0
- data/app/code_highlight/assets/css/atelier-estuary.light.css +113 -0
- data/app/code_highlight/assets/css/atelier-forest.dark.css +94 -0
- data/app/code_highlight/assets/css/atelier-forest.light.css +94 -0
- data/app/code_highlight/assets/css/atelier-heath.dark.css +94 -0
- data/app/code_highlight/assets/css/atelier-heath.light.css +94 -0
- data/app/code_highlight/assets/css/atelier-lakeside.dark.css +94 -0
- data/app/code_highlight/assets/css/atelier-lakeside.light.css +94 -0
- data/app/code_highlight/assets/css/atelier-plateau.dark.css +113 -0
- data/app/code_highlight/assets/css/atelier-plateau.light.css +113 -0
- data/app/code_highlight/assets/css/atelier-savanna.dark.css +113 -0
- data/app/code_highlight/assets/css/atelier-savanna.light.css +113 -0
- data/app/code_highlight/assets/css/atelier-seaside.dark.css +94 -0
- data/app/code_highlight/assets/css/atelier-seaside.light.css +94 -0
- data/app/code_highlight/assets/css/atelier-sulphurpool.dark.css +94 -0
- data/app/code_highlight/assets/css/atelier-sulphurpool.light.css +94 -0
- data/app/code_highlight/assets/css/brown_paper.css +103 -0
- data/app/code_highlight/assets/css/brown_papersq.png +0 -0
- data/app/code_highlight/assets/css/codepen-embed.css +97 -0
- data/app/code_highlight/assets/css/color-brewer.css +165 -0
- data/app/code_highlight/assets/css/dark.css +103 -0
- data/app/code_highlight/assets/css/darkula.css +152 -0
- data/app/code_highlight/assets/css/default.css +155 -0
- data/app/code_highlight/assets/css/docco.css +134 -0
- data/app/code_highlight/assets/css/far.css +110 -0
- data/app/code_highlight/assets/css/foundation.css +135 -0
- data/app/code_highlight/assets/css/github-gist.css +218 -0
- data/app/code_highlight/assets/css/github.css +123 -0
- data/app/code_highlight/assets/css/googlecode.css +144 -0
- data/app/code_highlight/assets/css/grayscale.css +128 -0
- data/app/code_highlight/assets/css/hopscotch.css +95 -0
- data/app/code_highlight/assets/css/hybrid.css +164 -0
- data/app/code_highlight/assets/css/idea.css +122 -0
- data/app/code_highlight/assets/css/ir_black.css +106 -0
- data/app/code_highlight/assets/css/kimbie.dark.css +97 -0
- data/app/code_highlight/assets/css/kimbie.light.css +97 -0
- data/app/code_highlight/assets/css/magula.css +120 -0
- data/app/code_highlight/assets/css/mono-blue.css +68 -0
- data/app/code_highlight/assets/css/monokai.css +126 -0
- data/app/code_highlight/assets/css/monokai_sublime.css +154 -0
- data/app/code_highlight/assets/css/obsidian.css +152 -0
- data/app/code_highlight/assets/css/paraiso.dark.css +96 -0
- data/app/code_highlight/assets/css/paraiso.light.css +96 -0
- data/app/code_highlight/assets/css/pojoaque.css +106 -0
- data/app/code_highlight/assets/css/pojoaque.jpg +0 -0
- data/app/code_highlight/assets/css/railscasts.css +184 -0
- data/app/code_highlight/assets/css/rainbow.css +107 -0
- data/app/code_highlight/assets/css/school_book.css +111 -0
- data/app/code_highlight/assets/css/school_book.png +0 -0
- data/app/code_highlight/assets/css/solarized_dark.css +107 -0
- data/app/code_highlight/assets/css/solarized_light.css +107 -0
- data/app/code_highlight/assets/css/sunburst.css +161 -0
- data/app/code_highlight/assets/css/tomorrow-night-blue.css +96 -0
- data/app/code_highlight/assets/css/tomorrow-night-bright.css +95 -0
- data/app/code_highlight/assets/css/tomorrow-night-eighties.css +95 -0
- data/app/code_highlight/assets/css/tomorrow-night.css +96 -0
- data/app/code_highlight/assets/css/tomorrow.css +93 -0
- data/app/code_highlight/assets/css/vs.css +92 -0
- data/app/code_highlight/assets/css/xcode.css +154 -0
- data/app/code_highlight/assets/css/zenburn.css +118 -0
- data/app/code_highlight/assets/js/highlight.pack.js +1 -0
- data/app/code_highlight/config/dependencies.rb +5 -0
- data/app/code_highlight/config/initializers/boot.rb +10 -0
- data/app/code_highlight/config/routes.rb +1 -0
- data/app/code_highlight/controllers/main_controller.rb +32 -0
- data/app/code_highlight/views/main/index.html +1 -0
- data/lib/volt/code_highlight.rb +18 -0
- data/lib/volt/code_highlight/version.rb +5 -0
- data/spec/spec_helper.rb +14 -0
- data/spec/volt/code_highlight_spec.rb +11 -0
- data/volt-code_highlight.gemspec +23 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b3a5dd2f1e26d186e6a3ed7e5543f16218651352
|
4
|
+
data.tar.gz: 09d366000f1496e59f26fbebc9f498a21bca47c3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e66a9479000e02af2a1c003edfa0aded98685b674b6caa66169f00247cf02fb2a2c2993e35948cc99ad186155d5def6d61b66250976b4d4f73cf8317bf067e98
|
7
|
+
data.tar.gz: 52ed190edb1c07c3b1aa0f2bd35ea84f3e5f391821cf562d25d2100a9b5ea0cec68fa6a5041effcdf8008221359f6ce45cbd3b760d88f0d7d4adcdf6ea781982
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
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. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Ryan Stout
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Volt::CodeHighlight
|
2
|
+
|
3
|
+
A simple code highlighting component using highlight.js
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
In your gemfile add:
|
8
|
+
|
9
|
+
```
|
10
|
+
gem 'volt-code_highlight'
|
11
|
+
```
|
12
|
+
|
13
|
+
In the component you wish to use it in, add to config/dependencies.rb
|
14
|
+
|
15
|
+
```
|
16
|
+
component 'code_highlight'
|
17
|
+
```
|
18
|
+
|
19
|
+
In a view, add something like:
|
20
|
+
|
21
|
+
```html
|
22
|
+
<:code_highlight>
|
23
|
+
def some_code
|
24
|
+
puts 'an example'
|
25
|
+
end
|
26
|
+
</:code_highlight>
|
27
|
+
```
|
28
|
+
|
29
|
+
You can also specify a "language" attribute. (see https://highlightjs.org/download/ for the list of default included languages)
|
30
|
+
|
31
|
+
Lastly, you can include a binding and the code will dynamically update.
|
32
|
+
|
33
|
+
```html
|
34
|
+
<:code_highlight language="ruby">{{ page._some_code }}</:code_highlight>
|
35
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,137 @@
|
|
1
|
+
/*!
|
2
|
+
* Agate by Taufik Nurrohman <https://github.com/tovic>
|
3
|
+
* ----------------------------------------------------
|
4
|
+
*
|
5
|
+
* #ade5fc
|
6
|
+
* #a2fca2
|
7
|
+
* #c6b4f0
|
8
|
+
* #d36363
|
9
|
+
* #fcc28c
|
10
|
+
* #fc9b9b
|
11
|
+
* #ffa
|
12
|
+
* #fff
|
13
|
+
* #333
|
14
|
+
* #62c8f3
|
15
|
+
* #888
|
16
|
+
*
|
17
|
+
*/
|
18
|
+
|
19
|
+
.hljs {
|
20
|
+
display: block;
|
21
|
+
overflow-x: auto;
|
22
|
+
padding: .5em;
|
23
|
+
background: #333;
|
24
|
+
color: white;
|
25
|
+
-webkit-text-size-adjust: none;
|
26
|
+
}
|
27
|
+
|
28
|
+
.asciidoc .hljs-title,
|
29
|
+
.hljs-label,
|
30
|
+
.hljs-tag .hljs-title,
|
31
|
+
.hljs-prompt,
|
32
|
+
.http .hljs-request {
|
33
|
+
font-weight: bold;
|
34
|
+
}
|
35
|
+
|
36
|
+
.hljs-change,
|
37
|
+
.hljs-code {
|
38
|
+
font-style: italic;
|
39
|
+
}
|
40
|
+
|
41
|
+
.hljs-tag,
|
42
|
+
.ini .hljs-title {
|
43
|
+
color: #62c8f3;
|
44
|
+
}
|
45
|
+
|
46
|
+
.hljs-id,
|
47
|
+
.hljs-cbracket,
|
48
|
+
.hljs-tag .hljs-value {
|
49
|
+
color: #ade5fc;
|
50
|
+
}
|
51
|
+
|
52
|
+
.hljs-string,
|
53
|
+
.hljs-bullet {
|
54
|
+
color: #a2fca2;
|
55
|
+
}
|
56
|
+
|
57
|
+
.hljs-type,
|
58
|
+
.hljs-variable,
|
59
|
+
.hljs-name,
|
60
|
+
.actionscript .hljs-title,
|
61
|
+
.aspectj .hljs-annotation,
|
62
|
+
.aspectj .hljs-title,
|
63
|
+
.hljs-attribute,
|
64
|
+
.hljs-change,
|
65
|
+
.hljs-blockquote,
|
66
|
+
.hljs-built_in {
|
67
|
+
color: #ffa;
|
68
|
+
}
|
69
|
+
|
70
|
+
.hljs-number,
|
71
|
+
.hljs-hexcolor,
|
72
|
+
.hljs-link_label,
|
73
|
+
.hljs-link_reference {
|
74
|
+
color: #d36363;
|
75
|
+
}
|
76
|
+
|
77
|
+
.hljs-keyword,
|
78
|
+
.hljs-literal,
|
79
|
+
.hljs-constant,
|
80
|
+
.css .hljs-tag,
|
81
|
+
.hljs-typename,
|
82
|
+
.hljs-winutils {
|
83
|
+
color: #fcc28c;
|
84
|
+
}
|
85
|
+
|
86
|
+
.hljs-comment,
|
87
|
+
.hljs-cdata,
|
88
|
+
.hljs-preprocessor,
|
89
|
+
.hljs-annotation,
|
90
|
+
.hljs-decorator,
|
91
|
+
.hljs-doctype,
|
92
|
+
.hljs-deletion,
|
93
|
+
.hljs-shebang,
|
94
|
+
.apache .hljs-sqbracket,
|
95
|
+
.tex .hljs-formula,
|
96
|
+
.hljs-header,
|
97
|
+
.hljs-horizontal_rule,
|
98
|
+
.hljs-code {
|
99
|
+
color: #888;
|
100
|
+
}
|
101
|
+
|
102
|
+
.hljs-regexp,
|
103
|
+
.hljs-attr_selector {
|
104
|
+
color: #c6b4f0;
|
105
|
+
}
|
106
|
+
|
107
|
+
.hljs-important,
|
108
|
+
.hljs-doctype,
|
109
|
+
.hljs-pi,
|
110
|
+
.hljs-chunk,
|
111
|
+
.actionscript .hljs-type,
|
112
|
+
.hljs-shebang,
|
113
|
+
.hljs-pragma,
|
114
|
+
.http .hljs-attribute {
|
115
|
+
color: #fc9b9b;
|
116
|
+
}
|
117
|
+
|
118
|
+
.hljs-deletion {
|
119
|
+
background-color: #fc9b9b;
|
120
|
+
color: #333;
|
121
|
+
}
|
122
|
+
|
123
|
+
.hljs-addition {
|
124
|
+
background-color: #a2fca2;
|
125
|
+
color: #333;
|
126
|
+
}
|
127
|
+
|
128
|
+
.hljs a,
|
129
|
+
.hljs-tag .hljs-attribute {
|
130
|
+
color: inherit;
|
131
|
+
}
|
132
|
+
|
133
|
+
.hljs a:focus,
|
134
|
+
.hljs a:hover {
|
135
|
+
color: inherit;
|
136
|
+
text-decoration: underline;
|
137
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
/*
|
2
|
+
Date: 24 Fev 2015
|
3
|
+
Author: Pedro Oliveira <kanytu@gmail . com>
|
4
|
+
*/
|
5
|
+
|
6
|
+
.hljs {
|
7
|
+
color: #a9b7c6;
|
8
|
+
background: #282b2e;
|
9
|
+
display: block;
|
10
|
+
overflow-x: auto;
|
11
|
+
padding: 0.5em;
|
12
|
+
-webkit-text-size-adjust: none;
|
13
|
+
}
|
14
|
+
|
15
|
+
.hljs-number {
|
16
|
+
color: #6897BB;
|
17
|
+
}
|
18
|
+
|
19
|
+
.hljs-keyword,
|
20
|
+
.hljs-deletion {
|
21
|
+
color: #cc7832;
|
22
|
+
}
|
23
|
+
|
24
|
+
.hljs-comment {
|
25
|
+
color: #808080;
|
26
|
+
}
|
27
|
+
|
28
|
+
.hljs-annotation {
|
29
|
+
color: #bbb529;
|
30
|
+
}
|
31
|
+
|
32
|
+
.hljs-string,
|
33
|
+
.hljs-addition {
|
34
|
+
color: #6A8759;
|
35
|
+
}
|
36
|
+
|
37
|
+
.hljs-function .hljs-title,
|
38
|
+
.hljs-change {
|
39
|
+
color: #ffc66d;
|
40
|
+
}
|
41
|
+
|
42
|
+
.hljs-tag .hljs-title,
|
43
|
+
.hljs-doctype {
|
44
|
+
color: #e8bf6a;
|
45
|
+
}
|
46
|
+
|
47
|
+
.hljs-tag .hljs-attribute {
|
48
|
+
color: #bababa;
|
49
|
+
}
|
50
|
+
|
51
|
+
.hljs-tag .hljs-value {
|
52
|
+
color: #a5c261;
|
53
|
+
}
|
@@ -0,0 +1,138 @@
|
|
1
|
+
/*
|
2
|
+
Date: 17.V.2011
|
3
|
+
Author: pumbur <pumbur@pumbur.net>
|
4
|
+
*/
|
5
|
+
|
6
|
+
.hljs {
|
7
|
+
display: block;
|
8
|
+
overflow-x: auto;
|
9
|
+
padding: 0.5em;
|
10
|
+
background: #222;
|
11
|
+
-webkit-text-size-adjust: none;
|
12
|
+
}
|
13
|
+
|
14
|
+
.profile .hljs-header *,
|
15
|
+
.ini .hljs-title,
|
16
|
+
.nginx .hljs-title {
|
17
|
+
color: #fff;
|
18
|
+
}
|
19
|
+
|
20
|
+
.hljs-comment,
|
21
|
+
.hljs-preprocessor,
|
22
|
+
.hljs-preprocessor .hljs-title,
|
23
|
+
.hljs-pragma,
|
24
|
+
.hljs-shebang,
|
25
|
+
.profile .hljs-summary,
|
26
|
+
.diff,
|
27
|
+
.hljs-pi,
|
28
|
+
.hljs-doctype,
|
29
|
+
.hljs-tag,
|
30
|
+
.css .hljs-rule,
|
31
|
+
.tex .hljs-special {
|
32
|
+
color: #444;
|
33
|
+
}
|
34
|
+
|
35
|
+
.hljs-string,
|
36
|
+
.hljs-symbol,
|
37
|
+
.diff .hljs-change,
|
38
|
+
.hljs-regexp,
|
39
|
+
.xml .hljs-attribute,
|
40
|
+
.smalltalk .hljs-char,
|
41
|
+
.xml .hljs-value,
|
42
|
+
.ini .hljs-value,
|
43
|
+
.clojure .hljs-attribute,
|
44
|
+
.coffeescript .hljs-attribute {
|
45
|
+
color: #ffcc33;
|
46
|
+
}
|
47
|
+
|
48
|
+
.hljs-number,
|
49
|
+
.hljs-addition {
|
50
|
+
color: #00cc66;
|
51
|
+
}
|
52
|
+
|
53
|
+
.hljs-built_in,
|
54
|
+
.hljs-literal,
|
55
|
+
.hljs-type,
|
56
|
+
.hljs-typename,
|
57
|
+
.go .hljs-constant,
|
58
|
+
.ini .hljs-keyword,
|
59
|
+
.lua .hljs-title,
|
60
|
+
.perl .hljs-variable,
|
61
|
+
.php .hljs-variable,
|
62
|
+
.mel .hljs-variable,
|
63
|
+
.django .hljs-variable,
|
64
|
+
.css .funtion,
|
65
|
+
.smalltalk .method,
|
66
|
+
.hljs-hexcolor,
|
67
|
+
.hljs-important,
|
68
|
+
.hljs-flow,
|
69
|
+
.hljs-inheritance,
|
70
|
+
.hljs-name,
|
71
|
+
.parser3 .hljs-variable {
|
72
|
+
color: #32aaee;
|
73
|
+
}
|
74
|
+
|
75
|
+
.hljs-keyword,
|
76
|
+
.hljs-tag .hljs-title,
|
77
|
+
.css .hljs-tag,
|
78
|
+
.css .hljs-class,
|
79
|
+
.css .hljs-id,
|
80
|
+
.css .hljs-pseudo,
|
81
|
+
.css .hljs-attr_selector,
|
82
|
+
.hljs-winutils,
|
83
|
+
.tex .hljs-command,
|
84
|
+
.hljs-request,
|
85
|
+
.hljs-status {
|
86
|
+
color: #6644aa;
|
87
|
+
}
|
88
|
+
|
89
|
+
.hljs-title,
|
90
|
+
.ruby .hljs-constant,
|
91
|
+
.vala .hljs-constant,
|
92
|
+
.hljs-parent,
|
93
|
+
.hljs-deletion,
|
94
|
+
.hljs-template_tag,
|
95
|
+
.css .hljs-keyword,
|
96
|
+
.objectivec .hljs-class .hljs-id,
|
97
|
+
.smalltalk .hljs-class,
|
98
|
+
.lisp .hljs-keyword,
|
99
|
+
.apache .hljs-tag,
|
100
|
+
.nginx .hljs-variable,
|
101
|
+
.hljs-envvar,
|
102
|
+
.bash .hljs-variable,
|
103
|
+
.go .hljs-built_in,
|
104
|
+
.vbscript .hljs-built_in,
|
105
|
+
.lua .hljs-built_in,
|
106
|
+
.rsl .hljs-built_in,
|
107
|
+
.tail,
|
108
|
+
.avrasm .hljs-label,
|
109
|
+
.tex .hljs-formula,
|
110
|
+
.tex .hljs-formula * {
|
111
|
+
color: #bb1166;
|
112
|
+
}
|
113
|
+
|
114
|
+
.hljs-doctag,
|
115
|
+
.profile .hljs-header,
|
116
|
+
.ini .hljs-title,
|
117
|
+
.apache .hljs-tag,
|
118
|
+
.parser3 .hljs-title {
|
119
|
+
font-weight: bold;
|
120
|
+
}
|
121
|
+
|
122
|
+
.coffeescript .javascript,
|
123
|
+
.javascript .xml,
|
124
|
+
.tex .hljs-formula,
|
125
|
+
.xml .javascript,
|
126
|
+
.xml .vbscript,
|
127
|
+
.xml .css,
|
128
|
+
.xml .hljs-cdata {
|
129
|
+
opacity: 0.6;
|
130
|
+
}
|
131
|
+
|
132
|
+
.hljs,
|
133
|
+
.hljs-subst,
|
134
|
+
.diff .hljs-chunk,
|
135
|
+
.css .hljs-value,
|
136
|
+
.css .hljs-attribute {
|
137
|
+
color: #aaa;
|
138
|
+
}
|