editor.js README

The project's README from github.com/codex-team/editor.js. As one markdown file: README.md.

Editor.js Logo

editorjs.io | documentation | changelog

npm Minzipped size Backers on Open Collective Sponsors on Open Collective

About

Editor.js is an open-source text editor offering a variety of features to help users create and format content efficiently. It has a modern, block-style interface that allows users to easily add and arrange different types of content, such as text, images, lists, quotes, etc. Each Block is provided via a separate plugin making Editor.js extremely flexible.

Editor.js outputs a clean JSON data instead of heavy HTML markup. Use it in Web, iOS, Android, AMP, Instant Articles, speech readers, AI chatbots — everywhere. Easy to sanitize, extend and integrate with your logic.

Editor.js Overview

Installation

It's quite simple:

  1. Install Editor.js
  2. Install tools you need
  3. Initialize Editor's instance

Install using NPM, Yarn, or CDN:

npm i @editorjs/editorjs

Choose and install tools:

See the 😎 Awesome Editor.js list for more tools.

Initialize the Editor:

<div id="editorjs"></div>
import EditorJS from '@editorjs/editorjs'

const editor = new EditorJS({
  tools: {
   // ... your tools
  }
})

See details about Installation and Configuration at the documentation.

Saving Data

Call editor.save() and handle returned Promise with saved data.

const data = await editor.save()

Example

Take a look at the example.html to view more detailed examples.

Roadmap

Support Editor.js

Like Editor.js?

You can support project improvement and development of new features with a donation to our team.

Donate via OpenCollective
Donate via Crypto
Donate via Patreon

Why donate

Donations to open-source products have several advantages for your business:

Sponsors

Support us by becoming a sponsor. Your logo will show up here with a link to your website.

Mister Auto UPLUCID, K.K. Kane Jamison Content Harmony

Become a Sponsor

Backers

Thank you to all our backers

Become a Backer

Contributors

This project exists thanks to all the people who contribute.

Need something special?

Hire CodeX experts to resolve technical challenges and match your product requirements.

Contact us via [email protected] and share your details

Community

About CodeX

CodeX is a team of digital specialists around the world interested in building high-quality open source products on a global market. We are open for young people who want to constantly improve their skills and grow professionally with experiments in cutting-edge technologies.

🌐 Join 👋 Twitter Instagram
codex.so codex.so/join @codex_team @codex_team

editor.js (codex-team/editor.js)

Searching Database…

Что это такое?Бесплатный редактор с открытым исходным кодом для веба, работающий по блочному принципу: автор собирает контент из блоков — текста, картинок, списков, цитат, — а на выходе получается аккуратный JSON вместо тяжёлой HTML-разметки.
Чем блочный редактор отличается от обычного WYSIWYG-поля?Контент — это не один сплошной документ, а набор независимых блоков (Blocks), и каждый блок предоставляет отдельный плагин (tool). Поэтому вы сами решаете, какие типы блоков будут доступны, и можете расширять редактор своими.
Как подключить его к своему веб-приложению?Установите Editor.js через NPM, Yarn или CDN, поставьте нужные пакеты-инструменты, затем создайте экземпляр Editor на своей странице; в документации подробно разобраны установка и настройка.
Блоки контента идут в комплекте?Нет — каждый тип блока это отдельный плагин (tool), который ставится вместе с ядром. Официальные инструменты покрывают заголовки, картинки, таблицы, чек-листы и embeds; сторонние инструменты собраны в списке Awesome Editor.js.
Чего пока не хватает или что ещё в работе?Совместное редактирование, менеджер отмены и повтора действий (undo/redo), а также перетаскивание и выделение между блоками — всё это пока в планах, а не в релизе.
Где он работает и куда можно отдать сохранённый контент?Он работает в браузере как JavaScript-компонент вашего веб-приложения; поскольку на выходе JSON, один и тот же контент можно отображать в Web, iOS, Android, AMP, Instant Articles, в программах чтения с экрана и в AI-чатботах.
Это бесплатно, в том числе для коммерческих проектов?Да — лицензия Apache-2.0, бесплатно и с открытым исходным кодом; команда развивает проект на пожертвования и спонсорские взносы, а не берёт деньги с пользователей.
Как получить контент после того, как редактирование закончено?Вызовите editor.save() — он вернёт Promise, который разрешится сохранёнными данными в формате JSON; их можно хранить или отправлять туда, куда нужно вашему приложению.
Могу ли я написать свои собственные типы блоков?Да — каждый Block это плагин на основе API редактора, а в репозитории есть @editorjs/create-tool для быстрого старта новых Tools, так что собственные блоки — полноценный вариант использования.
Какие сервисы он умеет встраивать?Официальный инструмент Embeds поддерживает YouTube, Twitch, Vimeo, Gfycat, Instagram, Twitter и другие; есть также отдельные инструменты Link embed и Simple Image, которым не нужен бэкенд.
Creator
codex-team
Size
20.2 MB
Stars
32K
Age
10y
Commits · 90 Days