editorjs-embedigo

1.0.1 • Public • Published

Embedigo plugin for Editor.js

Provides Block tool for embedded content for the Editor.js. Tool uses embedigo.xyz to handle embeds code.

What is embedigo you can read here

Thanks editor.js team for original embed plugin.

Installation

Install via NPM

Get the package

npm i --save-dev editorjs-embedigo

Include module at your application

const EditorjsEmbedigo = require('editorjs-embedigo');

Usage

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

var editor = EditorJS({
  ...

  tools: {
    ...
    embedigo: EditorjsEmbedigo,
  },

  ...
});

Also you need to include embedigo's script into your page

<script async src="//cdn.embedigo.xyz/embed.js" charset="utf-8"></script>

Available configuration

List of supported providers you can find here. All providers enabled by default, you can disable them manually if needed:

var editor = EditorJS({
  ...

  tools: {
    ...
    embedigo: {
      class: EditorjsEmbedigo,
      config: {
        services: {
          youtube_video: false,
          coub_video: false
        }
      }
    },
  },

  ...
});

Output data

Field Type Description
key string embed unique key
provider string provider name
url string source URL
html string embed html
caption string content caption
{
  "type" : "embedigo",
  "data" : {
    "caption": ""
    "html": "<div class=\"embedigo-...../>"
    "key": "aaf8fc33"
    "provider": "twitter_tweet"
    "url": "https://twitter.com/freekmurze/status/1313008788593676288"
  }
}

Package Sidebar

Install

npm i editorjs-embedigo

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

24 kB

Total Files

7

Last publish

Collaborators

  • hotrush