@webfy/editorjs-codecup
v1.2.6
Published
Codecup, for EditorJS
Downloads
16
Readme
EditorJs - CodeCup
Fork of the EditorJs - CodeCup. Adapted to our specific needs.
NPM
npm i @calumk/editorjs-codecup
JS
https://cdn.jsdelivr.net/npm/@calumk/editorjs-codecup@latest
About
This is an EditorJs wrapper for CodeCup - A lovely lightweight zero-dep code formatter
It was built to be an improvement on :
- https://github.com/editor-js/code - Too Basic
- https://github.com/dev-juju/codebox - Agressive styling, and exports more data than markdown can handle
Demo
Built with:
Installation / use
import EditorJS from '@editorjs/editorjs';
import editorjsCodecup from '@calumk/editorjs-codecup';
var editor = EditorJS({
// ...
tools: {
...
code : editorjsCodecup
},
});
Data Format
The data imported/exported from the block is as follows:
| Name | Description | | -------------------------- | ---------------------------------------------------------- | | code | The 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