Skip to content

Commit b9f5e60

Browse files
vuejs-jp-botpotato4d
authored andcommitted
Use highlight.js (#1968) (#1439)
* Use highlight.js for more semantics * Update hexo version * More tweaks * Better formatting * Fix wrong section seperation
1 parent 90035ac commit b9f5e60

File tree

3 files changed

+116
-118
lines changed

3 files changed

+116
-118
lines changed

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ highlight:
3939
enable: true
4040
line_number: false
4141
tab_replace:
42+
hljs: true
4243

4344
# Category & Tag
4445
default_category: uncategorized

themes/vue/source/css/_common.styl

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -74,49 +74,6 @@ input.button
7474
color: $light
7575
border-color: #f6f6f6
7676

77-
.highlight
78-
overflow-x: auto
79-
background-color: $codebg
80-
padding: .4em 0 0
81-
line-height: 1.1em
82-
border-radius: $radius
83-
position: relative
84-
table, tr, td
85-
width: 100%
86-
border-collapse: collapse
87-
padding: 0
88-
margin: 0
89-
.gutter
90-
width: 1.5em
91-
.code
92-
$code-line-height = 1.5em
93-
pre
94-
padding: 1.2em 1.4em
95-
line-height: $code-line-height
96-
margin: 0
97-
.line
98-
min-height: $code-line-height
99-
&.html, &.js, &.bash, &.css
100-
.code:before
101-
position: absolute
102-
top: 0
103-
right: 0
104-
color: #ccc
105-
text-align: right
106-
font-size: .75em
107-
padding: 5px 10px 0
108-
line-height: 15px
109-
height: 15px
110-
font-weight: 600
111-
&.html .code:before
112-
content: "HTML"
113-
&.js .code:before
114-
content: "JS"
115-
&.bash .code:before
116-
content: "Shell"
117-
&.css .code:before
118-
content: "CSS"
119-
12077
#main
12178
position: relative
12279
z-index: 1

themes/vue/source/css/_syntax.styl

Lines changed: 115 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,117 @@
1-
.gutter pre
2-
color: #999
3-
41
pre
2+
border-radius: $radius
3+
position: relative
4+
5+
pre code
6+
overflow-x: auto
57
color: #525252
6-
.function .keyword,
7-
.constant
8-
color: #0092db
9-
.keyword,
10-
.attribute
11-
color: #e96900
12-
.number,
13-
.literal
14-
color: #AE81FF
15-
.tag,
16-
.tag .title,
17-
.change,
18-
.winutils,
19-
.flow,
20-
.lisp .title,
21-
.clojure .built_in,
22-
.nginx .title,
23-
.tex .special
24-
color: #2973b7
25-
.class .title
26-
color: white
27-
.symbol,
28-
.symbol .string,
29-
.value,
30-
.regexp
31-
color: $green
32-
.title
33-
color: #A6E22E
34-
.tag .value,
35-
.string,
36-
.subst,
37-
.haskell .type,
38-
.preprocessor,
39-
.ruby .class .parent,
40-
.built_in,
41-
.sql .aggregate,
42-
.django .template_tag,
43-
.django .variable,
44-
.smalltalk .class,
45-
.javadoc,
46-
.django .filter .argument,
47-
.smalltalk .localvars,
48-
.smalltalk .array,
49-
.attr_selector,
50-
.pseudo,
51-
.addition,
52-
.stream,
53-
.envvar,
54-
.apache .tag,
55-
.apache .cbracket,
56-
.tex .command,
57-
.prompt
58-
color: $green
59-
.comment,
60-
.java .annotation,
61-
.python .decorator,
62-
.template_comment,
63-
.pi,
64-
.doctype,
65-
.deletion,
66-
.shebang,
67-
.apache .sqbracket,
68-
.tex .formula
69-
color: #b3b3b3
70-
.coffeescript .javascript,
71-
.javascript .xml,
72-
.tex .formula,
73-
.xml .javascript,
74-
.xml .vbscript,
75-
.xml .css,
76-
.xml .cdata
77-
opacity: 0.5
8+
white-space: pre
9+
padding: 1.2em 1.4em
10+
line-height: 1.5em
11+
font-size: 1em
12+
display: block
13+
14+
.hljs
15+
&-tag,
16+
&-tag &-title,
17+
&-change,
18+
&-winutils,
19+
&-flow,
20+
&-tex &-special
21+
color: #2973b7
22+
23+
&-symbol,
24+
&-symbol &-string,
25+
&-value,
26+
&-regexp
27+
&-string,
28+
&-subst,
29+
&-haskell &-type,
30+
&-preprocessor,
31+
&-ruby &-class &-parent,
32+
&-built_in,
33+
&-sql &-aggregate,
34+
&-django &-template_tag,
35+
&-django &-variable,
36+
&-smalltalk &-class,
37+
&-javadoc,
38+
&-django &-filter &-argument,
39+
&-smalltalk &-localvars,
40+
&-smalltalk &-array,
41+
&-attr_selector,
42+
&-pseudo,
43+
&-addition,
44+
&-stream,
45+
&-envvar,
46+
&-apache &-tag,
47+
&-apache &-cbracket,
48+
&-tex &-command,
49+
&-prompt
50+
color: $green
51+
52+
&-function &-keyword,
53+
&-constant
54+
color: #0092db
55+
56+
&-keyword,
57+
&-attribute
58+
color: #e96900
59+
60+
&-number,
61+
&-literal
62+
color: #ae81ff
63+
64+
&-class &-title
65+
color: white
66+
67+
&-title
68+
color: #a6e22e
69+
70+
&-tag &-value,
71+
&-comment,
72+
&-java &-annotation,
73+
&-python &-decorator,
74+
&-template_comment,
75+
&-pi,
76+
&-doctype,
77+
&-deletion,
78+
&-shebang,
79+
&-apache &-sqbracket,
80+
&-tex &-formula
81+
color: #b3b3b3
82+
83+
&-coffeescript &-javascript,
84+
&-javascript &-xml,
85+
&-tex &-formula,
86+
&-xml &-javascript,
87+
&-xml &-vbscript,
88+
&-xml &-css,
89+
&-xml &-cdata
90+
opacity: 0.5
91+
92+
&.hljs
93+
&.html, &.js, &.bash, &.css
94+
&::before
95+
font-family: $body-font
96+
position: absolute
97+
top: 0
98+
right: 0
99+
color: #ccc
100+
text-align: right
101+
font-size: .9em
102+
padding: 5px 10px 0
103+
line-height: 15px
104+
height: 15px
105+
font-weight: 600
106+
107+
&.html::before
108+
content: "HTML"
109+
110+
&.js::before
111+
content: "JS"
112+
113+
&.bash::before
114+
content: "Shell"
115+
116+
&.css::before
117+
content: "CSS"

0 commit comments

Comments
 (0)