Skip to content

Use highlight.js #1439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ highlight:
enable: true
line_number: false
tab_replace:
hljs: true

# Category & Tag
default_category: uncategorized
Expand Down
43 changes: 0 additions & 43 deletions themes/vue/source/css/_common.styl
Original file line number Diff line number Diff line change
Expand Up @@ -74,49 +74,6 @@ input.button
color: $light
border-color: #f6f6f6

.highlight
overflow-x: auto
background-color: $codebg
padding: .4em 0 0
line-height: 1.1em
border-radius: $radius
position: relative
table, tr, td
width: 100%
border-collapse: collapse
padding: 0
margin: 0
.gutter
width: 1.5em
.code
$code-line-height = 1.5em
pre
padding: 1.2em 1.4em
line-height: $code-line-height
margin: 0
.line
min-height: $code-line-height
&.html, &.js, &.bash, &.css
.code:before
position: absolute
top: 0
right: 0
color: #ccc
text-align: right
font-size: .75em
padding: 5px 10px 0
line-height: 15px
height: 15px
font-weight: 600
&.html .code:before
content: "HTML"
&.js .code:before
content: "JS"
&.bash .code:before
content: "Shell"
&.css .code:before
content: "CSS"

#main
position: relative
z-index: 1
Expand Down
190 changes: 115 additions & 75 deletions themes/vue/source/css/_syntax.styl
Original file line number Diff line number Diff line change
@@ -1,77 +1,117 @@
.gutter pre
color: #999

pre
border-radius: $radius
position: relative

pre code
overflow-x: auto
color: #525252
.function .keyword,
.constant
color: #0092db
.keyword,
.attribute
color: #e96900
.number,
.literal
color: #AE81FF
.tag,
.tag .title,
.change,
.winutils,
.flow,
.lisp .title,
.clojure .built_in,
.nginx .title,
.tex .special
color: #2973b7
.class .title
color: white
.symbol,
.symbol .string,
.value,
.regexp
color: $green
.title
color: #A6E22E
.tag .value,
.string,
.subst,
.haskell .type,
.preprocessor,
.ruby .class .parent,
.built_in,
.sql .aggregate,
.django .template_tag,
.django .variable,
.smalltalk .class,
.javadoc,
.django .filter .argument,
.smalltalk .localvars,
.smalltalk .array,
.attr_selector,
.pseudo,
.addition,
.stream,
.envvar,
.apache .tag,
.apache .cbracket,
.tex .command,
.prompt
color: $green
.comment,
.java .annotation,
.python .decorator,
.template_comment,
.pi,
.doctype,
.deletion,
.shebang,
.apache .sqbracket,
.tex .formula
color: #b3b3b3
.coffeescript .javascript,
.javascript .xml,
.tex .formula,
.xml .javascript,
.xml .vbscript,
.xml .css,
.xml .cdata
opacity: 0.5
white-space: pre
padding: 1.2em 1.4em
line-height: 1.5em
font-size: 1em
display: block

.hljs
&-tag,
&-tag &-title,
&-change,
&-winutils,
&-flow,
&-tex &-special
color: #2973b7

&-symbol,
&-symbol &-string,
&-value,
&-regexp
&-string,
&-subst,
&-haskell &-type,
&-preprocessor,
&-ruby &-class &-parent,
&-built_in,
&-sql &-aggregate,
&-django &-template_tag,
&-django &-variable,
&-smalltalk &-class,
&-javadoc,
&-django &-filter &-argument,
&-smalltalk &-localvars,
&-smalltalk &-array,
&-attr_selector,
&-pseudo,
&-addition,
&-stream,
&-envvar,
&-apache &-tag,
&-apache &-cbracket,
&-tex &-command,
&-prompt
color: $green

&-function &-keyword,
&-constant
color: #0092db

&-keyword,
&-attribute
color: #e96900

&-number,
&-literal
color: #ae81ff

&-class &-title
color: white

&-title
color: #a6e22e

&-tag &-value,
&-comment,
&-java &-annotation,
&-python &-decorator,
&-template_comment,
&-pi,
&-doctype,
&-deletion,
&-shebang,
&-apache &-sqbracket,
&-tex &-formula
color: #b3b3b3

&-coffeescript &-javascript,
&-javascript &-xml,
&-tex &-formula,
&-xml &-javascript,
&-xml &-vbscript,
&-xml &-css,
&-xml &-cdata
opacity: 0.5

&.hljs
&.html, &.js, &.bash, &.css
&::before
font-family: $body-font
position: absolute
top: 0
right: 0
color: #ccc
text-align: right
font-size: .9em
padding: 5px 10px 0
line-height: 15px
height: 15px
font-weight: 600

&.html::before
content: "HTML"

&.js::before
content: "JS"

&.bash::before
content: "Shell"

&.css::before
content: "CSS"