@groupher/editor-code
v1.0.30
Published
Code Tool for Editor.js, with language select and highlight
Maintainers
Readme
Code Tool
Provides Code Blocks for the Editor.js.

Installation
Install via NPM
Get the package
npm i --save-dev @groupher/editor-codeInclude module at your application
const Code = require('@groupher/editor-code');Download to your project's source dir
- Upload folder
distfrom repository - Add
dist/bundle.jsfile to your page.
Usage
Add a new Tool to the tools property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
code: Code,
},
...
});Output data
| Field | Type | Description |
| --------- | -------- | -------------------- |
| text | string | code's text |
| lang | string | code's language |
{
"type" : "quote",
"data" : {
"text" : ""body { color: tomato; margin-left: 20px;};",
"lang" : "css"
}
}