1.0.1 • Published 4 years ago

editorjs-embedigo v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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

FieldTypeDescription
keystringembed unique key
providerstringprovider name
urlstringsource URL
htmlstringembed html
captionstringcontent caption
{
  "type" : "embedigo",
  "data" : {
    "caption": ""
    "html": "<div class=\"embedigo-...../>"
    "key": "aaf8fc33"
    "provider": "twitter_tweet"
    "url": "https://twitter.com/freekmurze/status/1313008788593676288"
  }
}