mr8bit / codehighlight-editorjs

CodeHighlight for the Editor.js (https://editorjs.io).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CodeHighlight with Select code and highlight for Editor.js

Code Highlight for the Editor.js allows to include code examples in your articles.

Use this tool so simple, just select code

And write code

Installation

Download to your project's source dir

  1. Upload folder dist from repository
  2. Add dist/bundle.js file to your page.

Usage

Add a new Tool to the tools property of the Editor.js initial config.

var editor = EditorJS({
  ...
  
  tools: {
    ...
    code: CodeTool,
  }
  
  ...
});

Output data

This Tool returns code.

{
    "type" : "code",
    "data" : {
        "code": "body {\n font-size: 14px;\n line-height: 16px;\n}",
        "language": "css"
    }
}

About

CodeHighlight for the Editor.js (https://editorjs.io).

License:MIT License


Languages

Language:JavaScript 86.3%Language:CSS 13.7%