1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 13:51:59 +02:00

docs: organize Editor configuration into headings and subheading

This commit is contained in:
Sunny Hirai 2021-05-25 18:48:11 -07:00
parent ffbb92f28a
commit a55c4a2e71

View File

@ -2,25 +2,34 @@
`Element` objects are a type of node in a Slate document that contain other `Element` nodes or `Text` nodes.
Element nodes behave differently depending on the [Slate editor's configuration](./editor.md#schema-specific-instance-methods-to-override). An element can be:
- "block" or "inline" as defined by `editor.isInline`
- either "void" or "not void" as defined by `editor.isVoid`
A "block" element can only be siblings with other "block" elements. AN "inline" node can be siblings with `Text` nodes or other "inline" elements.
In a not "void" element, Slate handles the rendering of its `children` (e.g. in a paragraph where the `Text` and `Inline` children are rendered by Slate). In a "void" element, the `children` are rendered by the `Element`s render code.
```typescript
interface Element {
children: Node[]
}
```
- [Configuration](element.md#configuration)
- [Block vs. Inline](element.md#block-vs-inline)
- [Void vs Not Void](element.md#void-vs-not-void)
- [Static methods](element.md#static-methods)
- [Retrieval methods](element.md#retrieval-methods)
- [Check methods](element.md#check-methods)
## Configuration
Element nodes behave differently depending on the [Slate editor's configuration](./editor.md#schema-specific-instance-methods-to-override). An element can be:
- "block" or "inline" as defined by `editor.isInline`
- either "void" or "not void" as defined by `editor.isVoid`
### Block vs. Inline
A "block" element can only be siblings with other "block" elements. AN "inline" node can be siblings with `Text` nodes or other "inline" elements.
### Void vs Not Void
In a not "void" element, Slate handles the rendering of its `children` (e.g. in a paragraph where the `Text` and `Inline` children are rendered by Slate). In a "void" element, the `children` are rendered by the `Element`s render code.
## Static methods
### Retrieval methods