Skip to content

nfantone/editorjs-anchor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anchor Block Tune for Editor.js 2.20

Append field with anchor to any block.

Preview

Preview image

Required

  • Editor.js v2.20+

Installation

Download to your project's source dir

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

Usage

For all blocks

var editor = EditorJS({
  // ...
  tools: {
    // ...
    anchorTune: AnchorBlockTune
  },
  tunes: ['anchorTune']
  // ...
});

For particular block

var editor = EditorJS({
  // ...
  tools: {
    // ...
    anchorTune: AnchorBlockTune,
    header: {
      class: Header,
      tunes: ['anchorTune']
    }
  }
  // ...
});

Config Params

You can add a localized string

new Editorjs({
  // ...
  tools: {
    anchorTune: AnchorBlockTune
  },
  i18n: {
    tools: {
      anchorTune: {
        'Anchor': 'Якорь'
      }
    }
  },
})

Output data

Example for Header

{
  "type": "header",
  "data": {
    "text": "Header",
    "level": 2
  },
  "tunes": {
    "anchorTune": {
      "anchor": "header-anchor"
    }
  }
}

About

Anchor Block Tune for Editor.js 2.20+

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 90.8%
  • CSS 9.2%