docs: update content
This commit is contained in:
@@ -186,6 +186,29 @@ Have a look at all of the core commands listed below. They should give you a goo
|
||||
| .selectNodeForward() | Select a node forward. |
|
||||
| .selectParentNode() | Select the parent node. |
|
||||
|
||||
## Example use cases
|
||||
|
||||
### Quote a text
|
||||
TODO
|
||||
|
||||
Add a blockquote, with a specified text, add a paragraph below, set the cursor there.
|
||||
|
||||
```js
|
||||
// Untested, work in progress, likely to change
|
||||
this.editor
|
||||
.chain()
|
||||
.focus()
|
||||
.createParagraphNear()
|
||||
.insertText(text)
|
||||
.setBlockquote()
|
||||
.insertHTML('<p></p>')
|
||||
.createParagraphNear()
|
||||
.unsetBlockquote()
|
||||
.createParagraphNear()
|
||||
.insertHTML('<p></p>')
|
||||
.run()
|
||||
```
|
||||
|
||||
## Add your own commands
|
||||
All extensions can add additional commands (and most do), check out the specific [documentation for the provided nodes](/api/nodes), [marks](/api/marks), and [extensions](/api/extensions) to learn more about those.
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
## toc
|
||||
|
||||
## Introduction
|
||||
Extensions add new capabilities to tiptap. [Nodes](/api/nodes) and [marks](/api/marks) are rendered in HTML. Extensions can’t add to the schema, but can add functionality or change the behaviour of the editor.
|
||||
Extensions add new capabilities to tiptap and you’ll read the word extension here very often. Actually, there are literal Extensions. Those can’t add to the schema, but can add functionality or change the behaviour of the editor.
|
||||
|
||||
There are also some extensions with more capabilities. We call them [nodes](/api/nodes) and [marks](/api/marks) which can render content in the editor.
|
||||
|
||||
## List of provided extensions
|
||||
| Title | Default Extension | Source Code |
|
||||
@@ -19,7 +21,7 @@ Extensions add new capabilities to tiptap. [Nodes](/api/nodes) and [marks](/api/
|
||||
| [TextAlign](/api/extensions/text-align) | – | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text-align/) |
|
||||
| [Typography](/api/extensions/typography) | – | [GitHub](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-typography/) |
|
||||
|
||||
You don’t have to use it, but we prepared a `@tiptap/starter-kit` which includes the most common extensions. See an example on [how to use `defaultExtensions()`](/examples/default).
|
||||
You don’t have to use it, but we prepared a `@tiptap/starter-kit` which includes the most common extensions. Read more about [`defaultExtensions()`](/guide/configuration#default-extensions).
|
||||
|
||||
## How extensions work
|
||||
Although tiptap tries to hide most of the complexity of ProseMirror, it’s built on top of its APIs and we recommend you to read through the [ProseMirror Guide](https://ProseMirror.net/docs/guide/) for advanced usage. You’ll have a better understanding of how everything works under the hood and get more familiar with many terms and jargon used by tiptap.
|
||||
|
||||
Reference in New Issue
Block a user