docs: make all extension keyboard shortcuts a table

This commit is contained in:
Hans Pagel
2021-10-01 23:13:49 +02:00
parent bf06eef9f6
commit d3aa7903bd
4 changed files with 35 additions and 41 deletions

View File

@@ -18,11 +18,11 @@ yarn add @tiptap/extension-text-align
```
## Settings
| Option | Type | Default | Description |
| ---------------- | -------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| types | `Array` | `[]` | A list of nodes where the text align attribute should be applied to. Usually something like `['heading', 'paragraph']`.|
| alignments | `Array` | `['left', 'center', 'right', 'justify']` | A list of available options for the text align attribute. |
| defaultAlignment | `String` | `'left'` | The default text align. |
| Option | Type | Default | Description |
| ---------------- | -------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| types | `Array` | `[]` | A list of nodes where the text align attribute should be applied to. Usually something like `['heading', 'paragraph']`. |
| alignments | `Array` | `['left', 'center', 'right', 'justify']` | A list of available options for the text align attribute. |
| defaultAlignment | `String` | `'left'` | The default text align. |
## Commands
| Command | Parameters | Description |
@@ -30,17 +30,12 @@ yarn add @tiptap/extension-text-align
| textAlign | alignment | Set the text align to the specified value. |
## Keyboard shortcuts
### Windows/Linux
* `Ctrl` `Shift` `L` Left
* `Ctrl` `Shift` `E` Center
* `Ctrl` `Shift` `R` Right
* `Ctrl` `Shift` `J` Justify
### macOS
* `Cmd` `Shift` `L` Left
* `Cmd` `Shift` `E` Center
* `Cmd` `Shift` `R` Right
* `Cmd` `Shift` `J` Justify
| Command | Windows/Linux | macOS |
| ----------------------- | ---------------------------- | --------------------------- |
| setTextAlign('left') | `Ctrl` `Shift` `L` | `Cmd` `Shift` `L` |
| setTextAlign('center') | `Ctrl` `Shift` `E` | `Cmd` `Shift` `E` |
| setTextAlign('right') | `Ctrl` `Shift` `R` | `Cmd` `Shift` `R` |
| setTextAlign('justify') | `Ctrl` `Shift` `J` | `Cmd` `Shift` `J` |
## Source code
[packages/extension-text-align/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-text-align/)