feat(code_highlight): update to newer syntax

- use Dracula theme
- https://github.com/hexojs/hexo-util/issues/19
- https://github.com/dracula/highlightjs
This commit is contained in:
curben 2019-10-18 07:06:18 +01:00
parent 3ca86f563c
commit 3170c9f88d
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
2 changed files with 64 additions and 83 deletions

View File

@ -47,6 +47,7 @@ highlight:
line_number: false line_number: false
auto_detect: false auto_detect: false
tab_replace: tab_replace:
hljs: true
# Tag # Tag
tag_map: tag_map:

View File

@ -534,108 +534,88 @@ td {
border: 1px solid #ddd; border: 1px solid #ddd;
} }
.highlight .line.marked { code.hljs {
background: #444;
}
.highlight {
padding: 1em;
font-size: 0.9em;
overflow: auto;
line-height: 1.8;
}
.highlight .gutter pre {
color: #cacdd0;
font-size: 0.9em; font-size: 0.9em;
} }
.article-entry pre code { /* Dracula Theme v1.2.5
background: 0 0; *
text-shadow: none; * https://github.com/dracula/highlightjs
padding: 0; *
* Copyright 2016-present, All rights reserved
*
* Code licensed under the MIT license
*
* @author Denis Ciccale <dciccale@gmail.com>
* @author Zeno Rocha <hi@zenorocha.com>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
/* background: #282a36; */
} }
.highlight pre { .hljs-built_in,
border: 0; .hljs-selector-tag,
margin: 0; .hljs-section,
padding: 0; .hljs-link {
color: #8be9fd;
} }
.highlight table { .hljs-keyword {
margin: 0; color: #ff79c6;
width: 100%;
} }
.highlight td { /* .hljs,
border: 0; .hljs-subst {
padding: 0; color: #f8f8f2;
} */
.hljs-title {
color: #50fa7b;
} }
pre .comment, .hljs-string,
pre .title, .hljs-meta,
.highlight figcaption { .hljs-name,
color: #8e908c; .hljs-type,
.hljs-attr,
.hljs-symbol,
.hljs-bullet,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
color: #f1fa8c;
} }
highlight figcaption a { .hljs-comment,
float: right; .hljs-quote,
.hljs-deletion {
color: #6272a4;
} }
pre .attribute, .hljs-keyword,
pre .css .class, .hljs-selector-tag,
pre .css .id, .hljs-literal,
pre .css .pseudo, .hljs-title,
pre .html .doctype, .hljs-section,
pre .regexp, .hljs-doctag,
pre .ruby .constant, .hljs-type,
pre .tag, .hljs-name,
pre .variable, .hljs-strong {
pre .xml .doctype, font-weight: bold;
pre .xml .pi,
pre .xml .tag .title {
color: #c82829;
} }
pre .built_in, .hljs-literal,
pre .constant, .hljs-number {
pre .literal, color: #bd93f9;
pre .number,
pre .params,
pre .preprocessor {
color: #f5871f;
} }
pre .class, .hljs-emphasis {
pre .css .rules .attribute, font-style: italic;
pre .header,
pre .inheritance,
pre .ruby .class .title,
pre .ruby .symbol,
pre .string,
pre .value,
pre .xml .cdata {
color: #718c00;
}
pre .css .hexcolor {
color: #3e999f;
}
pre .coffeescript .title,
pre .function,
pre .javascript .title,
pre .perl .sub,
pre .python .decorator,
pre .python .title,
pre .ruby .function .title,
pre .ruby .title .keyword {
color: #4271ae;
}
pre .javascript .function,
pre .keyword {
color: #8959a8;
} }
/* hide mobile nav menu and its checkbox */ /* hide mobile nav menu and its checkbox */