Giter Site home page Giter Site logo

editorjs-oembed's Introduction

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"
  }
}

editorjs-oembed's People

Contributors

hotrush avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.