8000 GitHub - dinulus/editorjs-anchor: Append field with anchor to any Editor.js block
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dinulus/editorjs-anchor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 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: AnchorTune
  },
  tunes: ['anchorTune']
  // ...
});

For particular block

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

Config Params

You can add a localized string

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

Output data

Example for Header block

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

If the anchor field is empty, then the tune data will not be serialized into JSON.

About

Append field with anchor to any Editor.js block

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 87.4%
  • CSS 12.6%
0