diff --git a/Readme.md b/Readme.md index 5025b59ec..4b923a0a9 100644 --- a/Readme.md +++ b/Readme.md @@ -131,6 +131,10 @@ If you're using Slate for the first time, check out the [Getting Started](./docs - [State](./docs/reference/models/state.md) - [Text](./docs/reference/text.md) - [Transform](./docs/reference/models/transform.md) + - Serializers + - [Html](./docs/reference/serializers/html.md) + - [Plain](./docs/reference/serializers/plain.md) + - [Raw](./docs/reference/serializers/raw.md) - Plugins - [Plugins](./docs/reference/plugins/plugins.md) - [Core](./docs/reference/plugins/core.md) diff --git a/docs/reference/Readme.md b/docs/reference/Readme.md index b5803ade7..2981cc64f 100644 --- a/docs/reference/Readme.md +++ b/docs/reference/Readme.md @@ -18,6 +18,10 @@ This is the full reference documentation for all of the pieces of Slate, broken - [State](./models/state.md) - [Text](./text.md) - [Transform](./models/transform.md) +- **Serializers** + - [Html](./html.md) + - [Plain](./plain.md) + - [Raw](./raw.md) - **Plugins** - [Plugins](./plugins/plugins.md) - [Core](./plugins/core.md) diff --git a/docs/reference/serializers/html.md b/docs/reference/serializers/html.md new file mode 100644 index 000000000..4b94772a2 --- /dev/null +++ b/docs/reference/serializers/html.md @@ -0,0 +1,69 @@ + +# `Html` + +```js +import { Html } from 'slate' +``` + +The `Html` serializer lets you parse and stringify arbitrary HTML content, based on your specific schema's use case. You must pass a series of `rules` to define how your Slate schema should be serialized to and from HTML. + +For an example of the `Html` serializer in action, check out the [`paste-html` example](../../examples/paste-html). + +- [Example](#example) +- [Properties](#properties) + - [`rules`] +- [Methods](#methods) + - [`deserialize`](#deserialize) + - [`serialize`](#serialize) +- [Rules](#rules) + - [Rule Properties](#rule-properties) + - [`rule.deserialize`](#ruledeserialize) + - [`rule.serialize`](#ruleserialize) + + +## Example + +```txt +The Slate editor gives you full control over the logic you can add.\n +In its simplest form, when representing plain text, Slate is a glorified