2.1.2 • Published 7 years ago

codex.editor.header v2.1.2

Weekly downloads
26
License
MIT
Repository
github
Last release
7 years ago

npm.io

Header Tool

Provides Headings Blocks for the CodeX Editor.

Installation

Install via NPM

Get the package

npm i --save-dev codex.editor.header

Include module at your application

const Header = require('codex.editor.header');

Download to your project's source dir

  1. Upload folder dist from repository
  2. Add dist/bundle.js file to your page.

Load from CDN

You can load specific version of package from jsDelivr CDN.

https://cdn.jsdelivr.net/npm/codex.editor.header@2.0.4

Then require this script on page with CodeX Editor.

<script src="..."></script>

Usage

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

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    header: Header,
  },
  
  ...
});

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 = CodexEditor({
  ...
  
  tools: {
    ...
    header: {
      class: Header,
      shortcut: 'CMD+SHIFT+H',
    },
  },
  
  ...
});

Config Params

FieldTypeDescription
placeholderstringheader's placeholder string
var editor = CodexEditor({
  ...
  
  tools: {
    ...
    header: {
      class: Header,
      config: {
        placeholder: 'Enter a header'
      }
    }
  }
  
  ...
});

Tool's settings

npm.io

You can select one of three levels for heading.

Output data

FieldTypeDescription
textstringheader's text
levelnumberlevel of header: 2 for H2, 3 for H3, 4 for H4
{
    "type" : "header",
    "data" : {
        "text" : "Why Telegram is the best messenger",
        "level" : 2
    }
}
2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

8 years ago