scribe

A rich text editor framework for the web platform

  • 所有者: guardian/scribe
  • 平台:
  • 许可证: Apache License 2.0
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

THIS PROJECT IS DEPRECATED - You can find more information about this in our blog post, Leaving Scribe. In summary:

  • We have no plans to add features to Scribe but may make critical updates throughout the period that we continue to use instances of Scribe internally
  • We recommend forking the project in order to do any feature work as we will not be moving the Scribe repository out of the Guardian organisation
  • In time we hope to be able to open source the new text editor we are working on

Scribe

A rich text editor framework for the web platform, with patches for
browser inconsistencies and sensible defaults.

Status

Build Status Join the chat at https://gitter.im/guardian/scribe

Description

For an introduction, you may want to read the blog post Inside the Guardian’s CMS: meet Scribe, an extensible rich text editor.

Please note: There is a lot of missing documentation for Scribe and many of its plugins. We plan to improve this, however in the meantime we encourage you to look at the code. Scribe is very small in comparison to other libraries of its kind.

You can join us on IRC at [#scribejs] on freenode, or via the Google Group.

See an example.

Scribe only actively supports a sub-set of browsers.

Core

At the core of Scribe we have:

Patches

Scribe patches many browser inconsistencies in the native command API.

Installation

bower install scribe

Alternatively, you can access the distribution files through GitHub releases.

Usage Example

Scribe is an AMD module:

require(['scribe', 'scribe-plugin-blockquote-command', 'scribe-plugin-toolbar'],
  function (Scribe, scribePluginBlockquoteCommand, scribePluginToolbar) {
  var scribeElement = document.querySelector('.scribe');
  // Create an instance of Scribe
  var scribe = new Scribe(scribeElement);

  // Use some plugins
  scribe.use(scribePluginBlockquoteCommand());
  var toolbarElement = document.querySelector('.toolbar');
  scribe.use(scribePluginToolbar(toolbarElement));
});

You can see a live example here, or view the code here.

Also be sure to check the examples directory for an
AMD syntax example as well as a CommonJS (browserify) example.

Options

For detailed documentation see the wiki page on options.

Architecture

A plugin is simply a function that receives Scribe as an argument:

function myPlugin(scribe) {}

A consumer can then use your plugin with Scribe.use:

scribe.use(myPlugin);

Plugins may package whatever functionality you desire, and you are free to use
native APIs to do so. However, you are required to wrap any DOM manipulation in
a transaction, so that we can capture state changes for the history. For
example:

function myPlugin(scribe) {
  scribe.transactionManager.run(function () {
    // Do some fancy DOM manipulation
  });
}

Browser Support

Moved to the Github Wiki

Plugins

Scribe has a rich plugin ecosystem that expands and customises what it can do.

See the wiki for a list of plugins and how to create new ones

FAQ

See the wiki's FAQ

主要指标

概览
名称与所有者guardian/scribe
主编程语言JavaScript
编程语言JavaScript (语言数: 3)
平台
许可证Apache License 2.0
所有者活动
创建于2013-11-11 11:13:38
推送于2020-03-08 04:04:14
最后一次提交2019-01-30 15:02:19
发布数99
最新版本名称v3.3.1 (发布于 2018-08-10 12:26:31)
第一版名称v0.0.1 (发布于 )
用户参与
星数3.5k
关注者数153
派生数244
提交数1.8k
已启用问题?
问题数224
打开的问题数104
拉请求数257
打开的拉请求数3
关闭的拉请求数44
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?