0.0.15 • Published 10 months ago

@kalebu2468/editor-lessons v0.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Lesson Tool

Version of EditorJS that the plugin is compatible with

Provides Lesson Blocks for the Editor.js.

Installation

Get the package

yarn add @kalebu2468/editor-lessons

Include module at your application

import Lessons from "@kalebu2468/editor-lessons";

Usage

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

var editor = EditorJS({
  ...

  tools: {
    ...
    lessons: Lessons,
  },

  ...
});

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: {
    ...
    lessons: {
      class: Lessons,
    },
  },

  ...
});

Config Params

All properties are optional.

FieldTypeDescription
placeholderstringlesson's placeholder string
levelsnumber[]enabled lesson levels
defaultLevelnumberdefault lesson level
var editor = EditorJS({
  ...

  tools: {
    ...
    lessons: {
      class: Lessons,
      config: {
        placeholder: 'Enter a lesson',
        levels: [2, 3, 4],
        defaultLevel: 3
      }
    }
  }

  ...
});

Tool's settings

An image showing the lesson block tool

You can select one of six levels for heading.

Output data

FieldTypeDescription
textstringlesson's text
levelnumberlevel of lesson
{
  "type": "lessons",
  "data": {
    "text": "Why Telegram is the best messenger",
    "level": 2
  }
}
0.0.14

10 months ago

0.0.15

10 months ago

0.0.13

10 months ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.8

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.1

1 year ago

2.8.1

1 year ago