1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-18 05:59:13 +01:00
slate/Readme.md

43 lines
2.8 KiB
Markdown
Raw Normal View History

2016-06-28 08:42:38 -07:00
2016-06-28 09:17:55 -07:00
2016-06-28 10:00:15 -07:00
[![Slate](support/banner.png)]()
2016-06-28 08:42:38 -07:00
2016-06-28 09:41:23 -07:00
Slate is a completely customizable framework for building rich text editors in the browser. You can think of it like a pluggable implementation of `contenteditable`, built with React and Immutable. Slate lets you build editors like [Medium](https://medium.com/), [Dropbox Paper](https://www.dropbox.com/paper), or [Canvas](https://usecanvas.com/). It was inspired by libraries like [Draft.js](https://facebook.github.io/draft-js/) and [Prosemirror](http://prosemirror.net/).
2016-06-28 08:51:15 -07:00
- [Principles](#principles)
- [Examples](#examples)
2016-06-28 09:28:26 -07:00
- [Plugins](#plugins)
- [Documentation](#documentation)
2016-06-28 09:35:51 -07:00
- [Contributing](#contributing)
2016-06-28 09:28:26 -07:00
2016-06-28 09:35:51 -07:00
_Slate is currently in **beta**, while work is being done on: cross-browser support, atomic node support, and collaboration support. It's useable now, but you might need to pull request one or two fixes for your use case._
2016-06-28 08:42:38 -07:00
2016-06-28 14:38:05 -07:00
### Principles
2016-06-28 08:42:38 -07:00
2016-06-28 14:38:05 -07:00
**First-class plugins.** The most important factor of Slate is that plugins are first-class entities—the core editor logic is even implemented as its own plugin. This means that you're able to fully customize the editing experience. So you can build complex interations like those found in the Medium or Canvas editors.
2016-06-28 08:42:38 -07:00
2016-06-28 14:38:05 -07:00
**Stateless and immutable.** By using React and Immutable.js, the Slate editor is built in a stateless fashion using immutable data structures, which leads to better performance, and also a much easier time writing plugins.
2016-06-28 09:27:00 -07:00
2016-06-28 14:38:05 -07:00
**Nested document model.** The document model used for Slate is a nested, recursive tree, just like the DOM itself. This means that creating complex components like tables or nested block quotes is possible for building advanced use cases. But it's also easy to keep it simple by only using a single level of hierachy.
**Schema-less core.** The core of Slate doesn't assume anything about the schema of the data you'll be editing, which means that there are any assumptions baked into the library that will trip you up when you need to go beyond the most basic usage.
**Collaboration friendly.** The data model Slate uses—specifically how transforms are applied to the document—has been designed to allow for collaborative editing to be layered on top, so you won't need to rethink everything if you decide to make your editor collaborative.
### Examples
2016-06-28 08:42:38 -07:00
2016-06-28 09:27:00 -07:00
To get a sense for how you might use Slate, check out a few of the examples:
2016-06-28 08:42:38 -07:00
2016-06-28 09:35:51 -07:00
- [Rich Text](examples/rich-text)
- [Plain Text](examples/plain-text)
- [Auto-markdown](examples/auto-markdown)
- [Links](examples/links)
- [Tables](examples/tables)
2016-06-28 09:27:00 -07:00
2016-06-28 09:35:51 -07:00
## Documentation
2016-06-28 09:36:16 -07:00
If you're using Slate for the first time, check out the [Getting Started Guide](docs/getting-started.md) to familiarize yourself with Slate's architecture and mental models. After that, you'll probably just want the [API Reference](docs/reference.md).