docs: make the mark keyboard shortcuts a table

This commit is contained in:
Hans Pagel
2021-10-01 23:04:47 +02:00
parent a89e2eed29
commit bf06eef9f6
8 changed files with 47 additions and 23 deletions

View File

@@ -25,15 +25,32 @@ yarn add @tiptap/extension-bold
| HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands
| Command | Parameters | Description |
| ---------- | ---------- | ------------------ |
| setBold | — | Mark text as bold. |
| toggleBold | — | Toggle bold mark. |
| unsetBold | — | Remove bold mark. |
### setBold()
Mark text as bold.
```js
editor.commands.setBold()
```
### toggleBold()
Toggle the bold mark.
```js
editor.commands.toggleBold()
```
### unsetBold()
Remove the bold mark.
```js
editor.commands.unsetBold()
```
## Keyboard shortcuts
* Windows/Linux: `Control` `B`
* macOS: `Cmd` `B`
| Command | Windows/Linux | macOS |
| ------------ | ------------------ | -------------- |
| toggleBold() | `Control` `B` | `Cmd` `B` |
## Source code
[packages/extension-bold/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-bold/)