1.0.1 • Published 1 year ago

@init-kz/editorjs-code-highlight v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

EditorJs - init-code-highlight-ts

NPM

npm i @init-kz/editorjs-code-highlight

About

This is an EditorJs wrapper for init-code-highlight-ts - A lovely lightweight zero-dep code formatter

It was built to be an improvement on :

Built with:


Installation / use

import EditorJS from '@editorjs/editorjs';
import editorjsCode from '@init-kz/editorjs-code-highlight';

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

Data Format

The data imported/exported from the block is as follows:

NameDescription
codeThe code that is displayed in the editor, with line breaks
language (optional)The programming language
showlinenumbers (optional)Will show/hide the line numbers (Default true)
showCopyButton (optional)will show/hide the copy button (Defauly true)

Since language and linenumbers are optional, existing code blocks can safley use this plugin