mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-25 16:19:44 +02:00
Code tool updated (#45)
This commit is contained in:
parent
1895fdceaa
commit
a4031f151f
12 changed files with 51 additions and 43 deletions
|
@ -1,6 +1,7 @@
|
|||
import hljs from 'highlight.js/lib/highlight';
|
||||
import javascript from 'highlight.js/lib/languages/javascript';
|
||||
import style from 'highlight.js/styles/github-gist.css';
|
||||
import xml from 'highlight.js/lib/languages/xml';
|
||||
import style from 'highlight.js/styles/atom-one-dark.css';
|
||||
|
||||
/**
|
||||
* @class CodeStyles
|
||||
|
@ -11,11 +12,12 @@ export default class CodeStyler {
|
|||
* @param {string} selector - CSS selector for code blocks
|
||||
* @param {string[]} languages - list of languages to highlight, see hljs.listLanguages()
|
||||
*/
|
||||
constructor({selector, languages = [ 'javascript' ]}) {
|
||||
constructor({selector, languages = [ 'javascript', 'xml' ]}) {
|
||||
this.codeBlocksSelector = selector;
|
||||
this.languages = languages;
|
||||
this.langsAvailable = {
|
||||
javascript
|
||||
javascript,
|
||||
xml
|
||||
};
|
||||
|
||||
this.init();
|
||||
|
|
|
@ -57,20 +57,20 @@ export default class Editor {
|
|||
class: CodeTool,
|
||||
shortcut: 'CMD+SHIFT+D'
|
||||
},
|
||||
inlineCode: {
|
||||
class: InlineCode,
|
||||
shortcut: 'CMD+SHIFT+C'
|
||||
},
|
||||
rawTool: {
|
||||
class: RawTool,
|
||||
shortcut: 'CMD+SHIFT+R'
|
||||
},
|
||||
delimiter: Delimiter,
|
||||
embed: Embed,
|
||||
inlineCode: {
|
||||
class: InlineCode,
|
||||
shortcut: 'CMD+SHIFT+C'
|
||||
},
|
||||
marker: {
|
||||
class: Marker,
|
||||
shortcut: 'CMD+SHIFT+M'
|
||||
},
|
||||
delimiter: Delimiter,
|
||||
embed: Embed
|
||||
}
|
||||
},
|
||||
data: {
|
||||
blocks: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue