Table of contents

Base concepts

Editor.js is a block-style editor for rich media stories. It outputs clean data in JSON instead of heavy HTML markup. And more important thing is that Editor.js is designed to be API extendable and pluggable.

So there are a few key features:

  1. Clean data output
  2. API pluggable
  3. Open source

In other editors, the workspace is provided by single contenteditable element in where you can create different HTML markup. All of us saw permanent bugs with moving text fragments or scaling images, while page parts are jumping and twitches. Or highlighting big parts of the text in the case when you just want to make few words to be a heading or bold.

Bugs in popular editor. Try in yours.

The Editor.js workspace consists of separate Blocks: paragraphs, headings, images, lists, quotes, etc. Each of them is an independent contenteditable element (or more complex structure) provided by Plugin and united by Editor's Core.

At the same time, most useful features as arrow-navigation, copy & paste, cross block selection, and others works almost as in the familiar editors.

But the more interesting thing is, as mentioned above, that Editor.js returns clean data instead of HTML-markup. Take a look at the example.

If our entry consists of few paragraphs and a heading, in popular Medium editor after saving we will have something like this:

<section name="0ed1" class="section section--body section--first"> <div class="section-divider"> <hr class="section-divider"> </div> <div class="section-content"> <div class="section-inner sectionLayout--insetColumn"> <h3 name="f8e8" class="graf graf--h3 graf--leading graf--title"> <br> </h3> <p name="982b" class="graf graf--p graf-after--h3"> The example of text that was written in <strong class="markup--strong markup--p-strong">one of popular</strong> text editors. </p> <h3 name="c2ad" class="graf graf--h3 graf-after--p"> With the header of course </h3> <p name="83d3" class="graf graf--p graf-after--h3"> So what do we have? </p> </div> </div> </section> <section name="d1d2" class="section section--body"> ... </section>

Let's compare with the same data returned by Editor.js:

{ "time" : 1550476186479, "blocks" : [ { "type" : "paragraph", "data" : { "text" : "The example of text that was written in <b>one of popular</b> text editors." } }, { "type" : "header", "data" : { "text" : "With the header of course", "level" : 2 } }, { "type" : "paragraph", "data" : { "text" : "So what do we have?" } } ], "version" : "2.8.1" }

As you can see, there are only data we need: a list of structural Blocks with their content description.

You can use this data to easily render in Web, native mobile/desktop application, pass to Audio Readers, create templates for Facebook Instant Articles, AMP, RSS, create chat-bots, and many others.

Also, the clean data can be useful for backend processing: sanitizing, validation, injecting an advertising or other stuff, extracting Headings, make covers for social networks from Image Blocks, and other.

A key value of the Editor is the API. All main functional units of the editor — Blocks, Inline Formatting Tools, Block Tunes — are provided by external plugins that use Editor's API.

We decide to extract all these Tools to separate scripts to make Editor's Core more abstract and make API more powerful. Any challenges and tasks you are facing can be implemented by your own plugins using the API. 

At the same time, API is created to be easy-to-understand and simple-to-use.

Editor.js is more than just an editor. It is a big open-source community of developers and contributors. Anyone can suggest an improvement or a bug fix. Anyone can create new cool API features and plugins.

We will support each developer of Editor.js plugins: the best solutions will be collected to the Awesome List and promoted to the community. Together we can create a big suite of different Blocks, Inline Tools, Block Tunes that can hit a wide specter of tasks.

Thanks for your interest. Hope you enjoy Editor.js.