@7polo/editorjs-dragdrop 中文文档教程
Code
Editor.js 2.0 的代码工具,带有语言选择器、与 PrismJs 语言代码兼容的主题选择器
Feature
- Line Number ✌️
- theme selector
- language selector
Usage
添加一个新的工具到 tools
Editor.js 初始配置的属性。
npm i @7polo/editorjs-code
var editor = EditorJS({
...
tools: {
...
code: Code,
}
...
});
Config Params
还没有配置!
Output data
此工具返回代码。
{
"type" : "code",
"data" : {
"code": "body {\n font-size: 14px;\n line-height: 16px;\n}",
"language": "css",
"theme": "tomorrow"
}
}
Code
Code Tool for Editor.js 2.0 with language selector、theme selector compatible with PrismJs Language Codes
Feature
- Line Number ✌️
- theme selector
- language selector
Usage
Add a new Tool to the tools
property of the Editor.js initial config.
npm i @7polo/editorjs-code
var editor = EditorJS({
...
tools: {
...
code: Code,
}
...
});
Config Params
no configuration yet!
Output data
This Tool returns code.
{
"type" : "code",
"data" : {
"code": "body {\n font-size: 14px;\n line-height: 16px;\n}",
"language": "css",
"theme": "tomorrow"
}
}