docs: make all node keyboard shortcuts a table

This commit is contained in:
Hans Pagel 2021-10-01 22:57:27 +02:00
parent 6863626a7a
commit a89e2eed29
14 changed files with 44 additions and 30 deletions

View File

@ -13,7 +13,7 @@ Funfact: We built a [keyboard shortcut learning app](https://mouseless.app), to
Most of the core extensions register their own keyboard shortcuts. Depending on what set of extension you use, not all of the below listed keyboard shortcuts work for your editor.
### Essentials
| Action | Windows/Linux | macOS |
| Command | Windows/Linux | macOS |
| ------------------------ | ------------------------------- | --------------------------- |
| Copy | `Control` `C` | `Cmd` `C` |
| Cut | `Control` `X` | `Cmd` `X` |
@ -24,7 +24,7 @@ Most of the core extensions register their own keyboard shortcuts. Depending on
| Add a line break | `Shift` `Enter` | `Shift` `Enter` |
### Text Formatting
| Action | Windows/Linux | macOS |
| Command | Windows/Linux | macOS |
| ------------- | ------------------------------- | --------------------------- |
| Bold | `Control` `B` | `Cmd` `B` |
| Italicize | `Control` `I` | `Cmd` `I` |
@ -34,7 +34,7 @@ Most of the core extensions register their own keyboard shortcuts. Depending on
| Code | `Control` `E` | `Cmd` `E` |
### Paragraph Formatting
| Action | Windows/Linux | macOS |
| Command | Windows/Linux | macOS |
| ----------------------- | ------------------------------- | --------------------------- |
| Apply normal text style | `Control` `Alt` `0` | `Cmd` `Alt` `0` |
| Apply heading style 1 | `Control` `Alt` `1` | `Cmd` `Alt` `1` |
@ -58,7 +58,7 @@ Most of the core extensions register their own keyboard shortcuts. Depending on
<!--| Toggle task| `Control`&nbsp;`Enter` | `Cmd`&nbsp;`Enter` | -->
### Text Selection
| Action | Windows/Linux | macOS |
| Command | Windows/Linux | macOS |
| ------------------------------------------------- | ------------------------------- | --------------------------- |
| Select all | `Control`&nbsp;`A` | `Cmd`&nbsp;`A` |
| Extend selection one character to left | `Shift`&nbsp;`←` | `Shift`&nbsp;`←` |

View File

@ -51,7 +51,7 @@ editor.commands.unsetBlockquote()
```
## Keyboard shortcuts
| Action | Windows/Linux | macOS |
| Command | Windows/Linux | macOS |
| ----------------- | ------------------------------- | --------------------------- |
| Toggle Blockquote | `Control`&nbsp;`Shift`&nbsp;`B` | `Cmd`&nbsp;`Shift`&nbsp;`B` |

View File

@ -28,8 +28,9 @@ This extension requires the [`ListItem`](/api/nodes/list-item) node.
| bulletList | — | Toggle a bullet list. |
## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`8`
* macOS: `Cmd`&nbsp;`Shift`&nbsp;`8`
| Command | Windows/Linux | macOS |
| ---------------- | ------------------------------- | --------------------------- |
| toggleBulletList | `Control`&nbsp;`Shift`&nbsp;`8` | `Cmd`&nbsp;`Shift`&nbsp;`8` |
## Source code
[packages/extension-bullet-list/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-bullet-list/)

View File

@ -27,8 +27,9 @@ yarn add @tiptap/extension-code-block-lowlight
| codeBlock | — | Wrap content in a code block. |
## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`Alt`&nbsp;`C`
* macOS: `Cmd`&nbsp;`Alt`&nbsp;`C`
| Command | Windows/Linux | macOS |
| --------------- | ----------------------------- | ------------------------- |
| toggleCodeBlock | `Control`&nbsp;`Alt`&nbsp;`C` | `Cmd`&nbsp;`Alt`&nbsp;`C` |
## Source code
[packages/extension-code-block-lowlight/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-code-block-lowlight/)

View File

@ -31,8 +31,9 @@ yarn add @tiptap/extension-code-block
| codeBlock | — | Wrap content in a code block. |
## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`Alt`&nbsp;`C`
* macOS: `Cmd`&nbsp;`Alt`&nbsp;`C`
| Command | Windows/Linux | macOS |
| --------------- | ----------------------------- | ------------------------- |
| toggleCodeBlock | `Control`&nbsp;`Alt`&nbsp;`C` | `Cmd`&nbsp;`Alt`&nbsp;`C` |
## Source code
[packages/extension-code-block/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-code-block/)

View File

@ -25,9 +25,9 @@ yarn add @tiptap/extension-hard-break
| setHardBreak | — | Add a line break. |
## Keyboard shortcuts
* `Shift`&nbsp;`Enter`
* Windows/Linux: `Control`&nbsp;`Enter`
* macOS: `Cmd`&nbsp;`Enter`
| Command | Windows/Linux | macOS |
| ------------ | ---------------------------------------------- | ------------------------------------------ |
| setHardBreak | `Shift`&nbsp;`Enter`<br>`Control`&nbsp;`Enter` | `Shift`&nbsp;`Enter`<br>`Cmd`&nbsp;`Enter` |
## Source code
[packages/extension-hard-break/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-hard-break/)

View File

@ -27,8 +27,14 @@ yarn add @tiptap/extension-heading
| heading | level | Creates a heading node with the specified level. |
## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`Alt`&nbsp;`1-6`
* macOS: `Cmd`&nbsp;`Alt`&nbsp;`1-6`
| Command | Windows/Linux | macOS |
| --------------------------- | ----------------------------- | ------------------------- |
| toggleHeading({ level: 1 }) | `Control`&nbsp;`Alt`&nbsp;`1` | `Cmd`&nbsp;`Alt`&nbsp;`1` |
| toggleHeading({ level: 2 }) | `Control`&nbsp;`Alt`&nbsp;`2` | `Cmd`&nbsp;`Alt`&nbsp;`2` |
| toggleHeading({ level: 3 }) | `Control`&nbsp;`Alt`&nbsp;`3` | `Cmd`&nbsp;`Alt`&nbsp;`3` |
| toggleHeading({ level: 4 }) | `Control`&nbsp;`Alt`&nbsp;`4` | `Cmd`&nbsp;`Alt`&nbsp;`4` |
| toggleHeading({ level: 5 }) | `Control`&nbsp;`Alt`&nbsp;`5` | `Cmd`&nbsp;`Alt`&nbsp;`5` |
| toggleHeading({ level: 6 }) | `Control`&nbsp;`Alt`&nbsp;`6` | `Cmd`&nbsp;`Alt`&nbsp;`6` |
## Source code
[packages/extension-heading/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-heading/)

View File

@ -25,9 +25,6 @@ yarn add @tiptap/extension-horizontal-rule
| -------------- | ---------- | ------------------------- |
| horizontalRule | — | Create a horizontal rule. |
## Keyboard shortcuts
*None*
## Source code
[packages/extension-horizontal-rule/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-horizontal-rule/)

View File

@ -21,9 +21,11 @@ This extension requires the [`BulletList`](/api/nodes/bullet-list) or [`OrderedL
| HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Keyboard shortcuts
* New list item: `Enter`
* Sink a list item: `Tab`
* Lift a list item: `Shift`&nbsp;`Tab`
| Command | Windows/Linux | macOS |
| --------------- | ------------------ | ------------------ |
| splitListItem() | `Enter` | `Enter` |
| sinkListItem() | `Tab` | `Tab` |
| liftListItem() | `Shift`&nbsp;`Tab` | `Shift`&nbsp;`Tab` |
## Source code
[packages/extension-list-item/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-list-item/)

View File

@ -28,8 +28,9 @@ This extension requires the [`ListItem`](/api/nodes/list-item) node.
| orderedList | — | Toggle an ordered list. |
## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`7`
* macOS: `Cmd`&nbsp;`Shift`&nbsp;`7`
| Command | Windows/Linux | macOS |
| ----------------- | ------------------------------- | --------------------------- |
| toggleOrderedList | `Control`&nbsp;`Shift`&nbsp;`7` | `Cmd`&nbsp;`Shift`&nbsp;`7` |
## Source code
[packages/extension-ordered-list/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-ordered-list/)

View File

@ -28,8 +28,9 @@ yarn add @tiptap/extension-paragraph
| paragraph | — | Transforms all selected nodes to paragraphs. |
## Keyboard shortcuts
* Windows & Linux: `Control`&nbsp;`Alt`&nbsp;`0`
* macOS: `Cmd`&nbsp;`Alt`&nbsp;`0`
| Command | Windows/Linux | macOS |
| -------------- | ----------------------------- | ------------------------- |
| setParagraph() | `Control`&nbsp;`Alt`&nbsp;`0` | `Cmd`&nbsp;`Alt`&nbsp;`0` |
## Source code
[packages/extension-paragraph/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-paragraph/)

View File

@ -50,7 +50,6 @@ This extension requires the [`TableRow`](/api/nodes/table-row), [`TableHeader`](
| goToPreviousCell | | |
| fixTables | | |
## Source code
[packages/extension-table/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-table/)

View File

@ -23,7 +23,11 @@ This extension requires the [`TaskList`](/api/nodes/task-list) node.
| HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Keyboard shortcuts
* New list item: `Enter`
| Command | Windows/Linux | macOS |
| --------------- | ------------------ | ------------------ |
| splitListItem() | `Enter` | `Enter` |
| sinkListItem() | `Tab` | `Tab` |
| liftListItem() | `Shift`&nbsp;`Tab` | `Shift`&nbsp;`Tab` |
## Source code
[packages/extension-task-item/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-task-item/)

View File

@ -28,8 +28,9 @@ This extension requires the [`TaskItem`](/api/nodes/task-item) extension.
| taskList | — | Toggle a task list. |
## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`Shift`&nbsp;`9`
* macOS: `Cmd`&nbsp;`Shift`&nbsp;`9`
| Command | Windows/Linux | macOS |
| ---------------- | ------------------------------- | --------------------------- |
| toggleTaskList() | `Control`&nbsp;`Shift`&nbsp;`9` | `Cmd`&nbsp;`Shift`&nbsp;`9` |
## Source code
[packages/extension-task-list/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-task-list/)