replace NodeExtension with Node, replace MarkExtension with Mark

This commit is contained in:
Philipp Kühn
2020-11-16 11:19:43 +01:00
parent b44aafa97c
commit 8a7603edaf
31 changed files with 105 additions and 99 deletions

View File

@@ -386,24 +386,24 @@ const CustomLink = Link.extend({
There is a whole lot to learn about node views, so head over to the [dedicated section in our guide about node views](/guide/advanced-node-views) for more information. If youre looking for a real-world example, look at the source code of the [`TaskItem`](/api/nodes/task-item) node. This is using a node view to render the checkboxes.
## Start from scratch
You can also build your own extensions from scratch with the `NodeExtension`, `MarkExtension`, and `Extension` classes. Pass an option with your code and configuration.
You can also build your own extensions from scratch with the `Node`, `Mark`, and `Extension` classes. Pass an option with your code and configuration.
And if everything is working fine, dont forget to [share it with the community](https://github.com/ueberdosis/tiptap-next/issues/new/choose).
### Create a node
```js
import { NodeExtension } from '@tiptap/core'
import { Node } from '@tiptap/core'
const CustomNode = NodeExtension.create({
const CustomNode = Node.create({
// Your code goes here.
})
```
### Create a mark
```js
import { MarkExtension } from '@tiptap/core'
import { Mark } from '@tiptap/core'
const CustomMark = MarkExtension.create({
const CustomMark = Mark.create({
// Your code goes here.
})
```