docs(docs): 📝 add missing documentation for commands

This commit is contained in:
Dominik Biedebach
2022-06-08 12:41:14 +02:00
parent 43f8843c3e
commit 4abd7c8827
12 changed files with 151 additions and 44 deletions

View File

@@ -1,5 +1,26 @@
# toggleMark
The `toggleMark` command toggles a specific mark on and off at the current selection.
:::warning
Oops, we didnt find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, its still a side project for us. Lets change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
:::
## Parameters
`typeOrName: string | MarkType`
The type of mark that should be toggled.
`attributes?: Record<string, any>`
The attributes that should be applied to the mark. **This is optional.**
`options?: Record<string, any>`
* `extendEmptyMarkRange: boolean` - Removes the mark even across the current selection. Defaults to `false`
## Usage
```js
// toggles a bold mark
editor.commands.toggleMark('bold')
// toggles bold mark with a color attribute
editor.commands.toggleMark('bold', { color: 'red' })
// toggles a bold mark with a color attribute and removes the mark across the current selection
editor.commands.toggleMark('bold', { color: 'red' }, { extendEmptyMarkRange: true })
```