diff --git a/dependencies-cdn.js b/dependencies-cdn.js index cb11c845..dd4bd32c 100644 --- a/dependencies-cdn.js +++ b/dependencies-cdn.js @@ -51,7 +51,7 @@ module.exports = [ name: 'element-ui', library: 'ELEMENT', css: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.0/lib/theme-chalk/index.css', - js: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.0/lib/index.min.js' + js: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.0/lib/index.js' }, { name: 'vue-grid-layout', @@ -59,17 +59,11 @@ module.exports = [ css: '', js: 'https://unpkg.com/vue-grid-layout@2.3.4/dist/vue-grid-layout.umd.min.js' }, - { - name: 'highlight.js', - library: 'hljs', - css: 'https://cdn.jsdelivr.net/npm/highlight.js@9.17.1/styles/github.min.css', - js: 'https://cdn.jsdelivr.net/npm/highlight.js@9.17.1/lib/index.min.js' - }, { name: 'mockjs', library: 'Mock', css: '', - js: 'https://cdn.jsdelivr.net/npm/mockjs@1.1.0/dist/mock-min.js' + js: 'https://cdn.jsdelivr.net/npm/mockjs@1.1.0/dist/mock.min.js' }, { name: 'lodash', @@ -117,6 +111,6 @@ module.exports = [ name: 'hotkeys-js', library: 'hotkeys', css: '', - js: 'https://cdn.jsdelivr.net/npm/hotkeys-js@3.7.3/dist/hotkeys.min.js' + js: 'https://cdn.jsdelivr.net/npm/hotkeys-js@3.7.3/dist/hotkeys.js' } ] diff --git a/src/components/d2-highlight/index.vue b/src/components/d2-highlight/index.vue index a2902d71..43c3e012 100644 --- a/src/components/d2-highlight/index.vue +++ b/src/components/d2-highlight/index.vue @@ -8,6 +8,7 @@ // http://highlightjs.readthedocs.io/en/latest/api.html#configure-options import highlight from 'highlight.js' import htmlFormat from './libs/htmlFormat' +import './libs/style.github.css' export default { name: 'd2-highlight', props: { diff --git a/src/components/d2-highlight/libs/style.github.css b/src/components/d2-highlight/libs/style.github.css new file mode 100644 index 00000000..791932b8 --- /dev/null +++ b/src/components/d2-highlight/libs/style.github.css @@ -0,0 +1,99 @@ +/* + +github.com style (c) Vasily Polovnyov + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + color: #333; + background: #f8f8f8; +} + +.hljs-comment, +.hljs-quote { + color: #998; + font-style: italic; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-subst { + color: #333; + font-weight: bold; +} + +.hljs-number, +.hljs-literal, +.hljs-variable, +.hljs-template-variable, +.hljs-tag .hljs-attr { + color: #008080; +} + +.hljs-string, +.hljs-doctag { + color: #d14; +} + +.hljs-title, +.hljs-section, +.hljs-selector-id { + color: #900; + font-weight: bold; +} + +.hljs-subst { + font-weight: normal; +} + +.hljs-type, +.hljs-class .hljs-title { + color: #458; + font-weight: bold; +} + +.hljs-tag, +.hljs-name, +.hljs-attribute { + color: #000080; + font-weight: normal; +} + +.hljs-regexp, +.hljs-link { + color: #009926; +} + +.hljs-symbol, +.hljs-bullet { + color: #990073; +} + +.hljs-built_in, +.hljs-builtin-name { + color: #0086b3; +} + +.hljs-meta { + color: #999; + font-weight: bold; +} + +.hljs-deletion { + background: #fdd; +} + +.hljs-addition { + background: #dfd; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +}