Code Tool for Editor.js 2.0. power by codemirror.
- line number โ๏ธ
- code folder
- theme selector (on-the-way )
- language selector (on-the-way)
- copy (on-the-way)
- tab/shift+tab support
Add a new Tool to the tools
property of the Editor.js initial config.
npm i @7polo/editorjs-code2
var editor = EditorJS({
...
tools: {
...
code: {
class: Code,
config: {
defaultTheme: 'okaidia',
defaultLanguage: 'java'
}
}
}
});
This Tool returns code.
{
"type" : "code",
"data" : {
"code": "body {\n font-size: 14px;\n line-height: 16px;\n}",
"language": "css",
"theme": "tomorrow"
}
}