1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-12 10:14:02 +02:00

update serializers docs

This commit is contained in:
Ian Storm Taylor
2016-07-17 15:39:28 -07:00
parent 93e2487c6e
commit 2ee317c0a0

View File

@@ -11,7 +11,7 @@ For an example of the `Html` serializer in action, check out the [`paste-html` e
- [Example](#example) - [Example](#example)
- [Properties](#properties) - [Properties](#properties)
- [`rules`] - [`rules`](#rules)
- [Methods](#methods) - [Methods](#methods)
- [`deserialize`](#deserialize) - [`deserialize`](#deserialize)
- [`serialize`](#serialize) - [`serialize`](#serialize)
@@ -24,14 +24,18 @@ For an example of the `Html` serializer in action, check out the [`paste-html` e
## Example ## Example
```txt ```txt
The Slate editor gives you full control over the logic you can add.\n The Slate editor gives you full control over the logic you can add.\nIn its simplest form, when representing plain text, Slate is a glorified <textarea>. But you can augment it to be much more than that.\nCheck out http://slatejs.org for examples!
In its simplest form, when representing plain text, Slate is a glorified <textarea>. But you can augment it to be much more than that.\n
Check out http://slatejs.org for examples!
``` ```
## Properties ## Properties
```js
new Html({
rules: Array
})
```
### `rules` ### `rules`
`Array` `Array`
@@ -57,6 +61,13 @@ To initialize an `Html` serialize, you must pass it an array of rules, defining
### Rule Properties ### Rule Properties
```js
{
deserialize: Function,
serialize: Function
}
```
Each rule must define two properties: Each rule must define two properties:
#### `rule.deserialize` #### `rule.deserialize`