@juratbek/editorjs-inline-code

1.0.1 • Public • Published

InlineCode Tool

Inline Tool for marking code-fragments for the Editor.js.

Installation

Get the package

npm i @juratbek/editorjs-inline-code
yarn add @juratbek/editorjs-inline-code

Include module at your application

import InlineCode from "@juratbek/editorjs-inline-code";

Optionally, you can load this tool from CDN JsDelivr CDN

Usage

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

var editor = EditorJS({
  ...

  tools: {
    ...
    inlineCode: {
      class: InlineCode,
      shortcut: 'CMD+M',
    },
  },

  ...
});

Config Params

This Tool has no config params

Output data

Marked text will be wrapped with a span tag with an inline-code class.

{
  "type": "text",
  "data": {
    "text": "Create a directory for your module, enter it and run <span class=\"inline-code\">npm init</span> command."
  }
}

Package Sidebar

Install

npm i @juratbek/editorjs-inline-code

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

9.24 kB

Total Files

5

Last publish

Collaborators

  • upperuz