From d3aa7903bde92a049439149d761bc5df102d820c Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Fri, 1 Oct 2021 23:13:49 +0200 Subject: [PATCH] docs: make all extension keyboard shortcuts a table --- docs/api/extensions/collaboration.md | 11 ++++----- docs/api/extensions/history.md | 34 ++++++++++++++-------------- docs/api/extensions/text-align.md | 27 +++++++++------------- docs/api/extensions/typography.md | 4 +++- 4 files changed, 35 insertions(+), 41 deletions(-) diff --git a/docs/api/extensions/collaboration.md b/docs/api/extensions/collaboration.md index e3766fe0..8f9a06cf 100644 --- a/docs/api/extensions/collaboration.md +++ b/docs/api/extensions/collaboration.md @@ -33,13 +33,10 @@ yarn add @tiptap/extension-collaboration yjs y-websocket | redo | — | Redo the last change. | ## Keyboard shortcuts -### Undo -* Windows/Linux: `Control` `Z` -* macOS: `Cmd` `Z` - -### Redo -* Windows/Linux: `Shift` `Control` `Z` or `Control` `Y` -* macOS: `Shift` `Cmd` `Z` or `Cmd` `Y` +| Command | Windows/Linux | macOS | +| ------- | ----------------------------------------------------- | --------------------------------------------- | +| undo() | `Control` `Z` | `Cmd` `Z` | +| redo() | `Shift` `Control` `Z`
`Control` `Y` | `Shift` `Cmd` `Z`
`Cmd` `Y` | ## Source code [packages/extension-collaboration/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-collaboration/) diff --git a/docs/api/extensions/history.md b/docs/api/extensions/history.md index fbd4de6b..8e4ca237 100644 --- a/docs/api/extensions/history.md +++ b/docs/api/extensions/history.md @@ -20,25 +20,25 @@ yarn add @tiptap/extension-history | newGroupDelay | `Number` | `500` | The delay between changes after which a new group should be started (in milliseconds). When changes aren’t adjacent, a new group is always started. | ## Commands -| Command | Parameters | Description | -| ------- | ---------- | --------------------- | -| undo | — | Undo the last change. | -| redo | — | Redo the last change. | + +### undo() +Undo the last change. + +```js +editor.commands.undo() +``` +### redo() +Redo the last change. + +```js +editor.commands.redo() +``` ## Keyboard shortcuts -### Undo -* Windows/Linux: `Control` `Z` -* macOS: `Cmd` `Z` -#### Russian keyboard layouts -* Windows/Linux: `Control` `я` -* macOS: `Cmd` `я` - -### Redo -* Windows/Linux: `Shift` `Control` `Z` or `Control` `Y` -* macOS: `Shift` `Cmd` `Z` or `Cmd` `Y` -#### Russian keyboard layouts -* Windows/Linux: `Shift` `Control` `я` -* macOS: `Shift` `Cmd` `я` +| Command | Windows/Linux | macOS | +| ------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| undo() | `Control` `Z`
`Control` `я` | `Cmd` `Z`
`Cmd` `я` | +| redo() | `Shift` `Control` `Z`
`Control` `Y`
`Shift` `Control` `я` | `Shift` `Cmd` `Z`
`Cmd` `Y`
`Shift` `Cmd` `я` | ## Source code [packages/extension-history/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-history/) diff --git a/docs/api/extensions/text-align.md b/docs/api/extensions/text-align.md index f9298c02..1b120070 100644 --- a/docs/api/extensions/text-align.md +++ b/docs/api/extensions/text-align.md @@ -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/) diff --git a/docs/api/extensions/typography.md b/docs/api/extensions/typography.md index eb7fff23..0568223d 100644 --- a/docs/api/extensions/typography.md +++ b/docs/api/extensions/typography.md @@ -39,7 +39,9 @@ yarn add @tiptap/extension-typography | superscriptThree | Converts `^3` a superscript three `³`. | ## Keyboard shortcuts -* `Backspace` reverts the applied input rule +| Command | Windows/Linux | macOS | +| --------------- | ------------- | ----------- | +| undoInputRule() | `Backspace` | `Backspace` | ## Source code [packages/extension-typography/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-typography/)