mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 06:03:22 +08:00
docs: update content
This commit is contained in:
parent
2955ef274a
commit
44c1567a01
@ -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.
|
||||
|
@ -35,7 +35,7 @@
|
||||
Headless
|
||||
</h3>
|
||||
<p>
|
||||
We don’t tell you what a menu should look like or where it should be rendered in the DOM. That’s why tiptap is headless and comes without any CSS. You are in full control over markup, styling and behaviour.
|
||||
It’s headless and comes without any CSS. You are in full control over markup, styling and behaviour.
|
||||
</p>
|
||||
<div>
|
||||
<btn type="tertiary" icon="arrow-right" to="/guide/styling">
|
||||
@ -49,7 +49,7 @@
|
||||
Framework-agnostic
|
||||
</h3>
|
||||
<p>
|
||||
No matter what framework you use, you’ll enjoy tiptap. Out of the box, it works with plain JavaScript and Vue.js, but it’s also possible to use it in <g-link to="/installation/react">React</g-link>, <g-link to="/installation/svelte">Svelte</g-link> and others.
|
||||
Out of the box, tiptap works with plain JavaScript and Vue.js, but it’s also possible to use it in <g-link to="/installation/react">React</g-link>, <g-link to="/installation/svelte">Svelte</g-link> and others.
|
||||
</p>
|
||||
<div>
|
||||
<btn type="tertiary" icon="arrow-right" to="/installation">
|
||||
@ -63,7 +63,7 @@
|
||||
TypeScript
|
||||
</h3>
|
||||
<p>
|
||||
tiptap 2 is written in TypeScript. That helps to find bugs early and gives a nice autocomplete for the API (if your IDE supports that) on top of the extensive human written documentation.
|
||||
TypeScript helps to find bugs early and gives you a nice autocomplete for the API on top of the extensive human written documentation.
|
||||
</p>
|
||||
<div>
|
||||
<btn type="tertiary" icon="arrow-right" to="/guide/typescript">
|
||||
@ -77,7 +77,7 @@
|
||||
Collaborative
|
||||
</h3>
|
||||
<p>
|
||||
Real-time collaboration, syncing between different devices and working offline used to be hard. We provide everything you need to keep everything in sync, conflict-free with the power of <g-link to="https://github.com/yjs/yjs">Y.js</g-link>.
|
||||
Real-time collaboration, syncing between different devices and working offline isn’t hard anymore. Keep everything in sync with the magic of <g-link to="https://github.com/yjs/yjs">Y.js</g-link>.
|
||||
</p>
|
||||
<div>
|
||||
<btn type="tertiary" icon="arrow-right" to="/guide/collaborative-editing">
|
||||
@ -91,7 +91,7 @@
|
||||
Community
|
||||
</h3>
|
||||
<p>
|
||||
Over the years, a lovely community has grown around tiptap. There’s so much content shared, so many people helping out in issues and a ton of community extensions, you’ll be surprised how much that can help.
|
||||
There’s so much content shared, so many people helping out in issues and a ton of community extensions, you’ll be surprised how much that all can help.
|
||||
</p>
|
||||
<div>
|
||||
<btn type="tertiary" icon="arrow-right" to="https://github.com/ueberdosis/tiptap-next">
|
||||
@ -108,7 +108,7 @@
|
||||
Quickstart
|
||||
</h2>
|
||||
<p>
|
||||
For quick demos or to give it just a spin, grab the latest build from a CDN. Here is a quick example to get you started with tiptap:
|
||||
For quick demos or to give it just a spin, grab the latest build from a CDN. Here is an example to get you started with tiptap:
|
||||
</p>
|
||||
<!-- eslint-disable -->
|
||||
<prism language="html"><!DOCTYPE html>
|
||||
@ -134,7 +134,7 @@
|
||||
<!-- eslint-enable -->
|
||||
<div>
|
||||
<btn type="tertiary" icon="arrow-right" to="/installation">
|
||||
Learn More
|
||||
Learn more
|
||||
</btn>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user