@kalebu2468/editorjs-topic

0.0.17 • Public • Published

Topic Tool

Version of EditorJS that the plugin is compatible with

Provides Topic Blocks for the Editor.js.

Installation

Get the package

yarn add @kalebu2468/editorjs-topic

Include module at your application

import Topic from "@editorjs/editorjs-topic";

Usage

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

var editor = EditorJS({
  ...

  tools: {
    ...
    topics: Topics,
  },

  ...
});

Shortcut

You can insert this Block by a useful shortcut. Set it up with the tools[].shortcut property of the Editor's initial config.

var editor = EditorJS({
  ...

  tools: {
    ...
    topics: {
      class: Topics,
    },
  },

  ...
});

Config Params

All properties are optional.

Field Type Description
placeholder string topic's placeholder string
levels number[] enabled topic levels
defaultLevel number default topic level
var editor = EditorJS({
  ...

  tools: {
    ...
    topics: {
     class: Topics,
        config: {
          placeholder: "Enter a Topic",
          levels: [1],
          defaultLevel: 1,
        },
    }
  }

  ...
});

Output data

Field Type Description
text string topic's text
level number level of topic
{
  "type": "topic",
  "data": {
    "text": "Why Telegram is the best messenger",
    "level": 1
  }
}

Package Sidebar

Install

npm i @kalebu2468/editorjs-topic

Weekly Downloads

25

Version

0.0.17

License

MIT

Unpacked Size

24 kB

Total Files

5

Last publish

Collaborators

  • kalebu2468