This commit is contained in:
Hans Pagel
2020-09-24 16:09:32 +02:00
parent 2848b814b6
commit 5e1f01580f
2 changed files with 4 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
There are a few use cases where you need to work with the underlying schema. Youll need that if youre using the tiptap collaborative text editing features or if you want to manually render your content as HTML.
## With an Editor
## Option 1: With an Editor
If you need this on the client side and need an editor instance anyway, its available through the editor:
```js
@@ -23,7 +23,7 @@ const editor = new Editor({
const schema = editor.schema
```
## Without an Editor
## Option 2: Without an Editor
If you just want to have the schema *without* initializing an actual editor, you can use the `getSchema` helper function. It needs an array of available extensions and conveniently generates a ProseMirror schema for you:
```js

View File

@@ -173,9 +173,9 @@
- title: Schema
link: /api/schema
items:
- title: getSchema
- title: Get Schema
link: /api/schema/get-schema
- title: generateHtml
- title: Generate HTML
link: /api/schema/generate-html
- title: Keyboard Shortcuts
link: /api/keyboard-shortcuts