From bf06eef9f621d6aaff7d3bf6ab2f3f676d8dfa2f Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Fri, 1 Oct 2021 23:04:47 +0200 Subject: [PATCH] docs: make the mark keyboard shortcuts a table --- docs/api/marks/bold.md | 31 ++++++++++++++++++++++++------- docs/api/marks/code.md | 5 +++-- docs/api/marks/highlight.md | 5 +++-- docs/api/marks/italic.md | 5 +++-- docs/api/marks/strike.md | 5 +++-- docs/api/marks/subscript.md | 9 +++++---- docs/api/marks/superscript.md | 5 +++-- docs/api/marks/underline.md | 5 +++-- 8 files changed, 47 insertions(+), 23 deletions(-) diff --git a/docs/api/marks/bold.md b/docs/api/marks/bold.md index 1a3030b46..a50dce7fc 100644 --- a/docs/api/marks/bold.md +++ b/docs/api/marks/bold.md @@ -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/) diff --git a/docs/api/marks/code.md b/docs/api/marks/code.md index 4a3b34349..75778f16d 100644 --- a/docs/api/marks/code.md +++ b/docs/api/marks/code.md @@ -28,8 +28,9 @@ yarn add @tiptap/extension-code | unsetCode | — | Remove inline code mark. | ## Keyboard shortcuts -* Windows/Linux: `Control` `E` -* macOS: `Cmd` `E` +| Command | Windows/Linux | macOS | +| ------------ | ------------------ | -------------- | +| toggleCode() | `Control` `E` | `Cmd` `E` | ## Source code [packages/extension-code/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-code/) diff --git a/docs/api/marks/highlight.md b/docs/api/marks/highlight.md index 662f6e8fb..9b5520414 100644 --- a/docs/api/marks/highlight.md +++ b/docs/api/marks/highlight.md @@ -29,8 +29,9 @@ yarn add @tiptap/extension-highlight | unsetHighlight | — | Removes the highlight. | ## Keyboard shortcuts -* Windows/Linux: `Control` `Shift` `H` -* macOS: `Cmd` `Shift` `H` +| Command | Windows/Linux | macOS | +| ----------------- | ------------------------------- | --------------------------- | +| toggleHighlight() | `Control` `Shift` `H` | `Cmd` `Shift` `H` | ## Source code [packages/extension-highlight/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-highlight/) diff --git a/docs/api/marks/italic.md b/docs/api/marks/italic.md index d2ea667aa..1209aca84 100644 --- a/docs/api/marks/italic.md +++ b/docs/api/marks/italic.md @@ -33,8 +33,9 @@ yarn add @tiptap/extension-italic ## Keyboard shortcuts -* Windows/Linux: `Control` `I` -* macOS: `Cmd` `I` +| Command | Windows/Linux | macOS | +| -------------- | ------------------ | -------------- | +| toggleItalic() | `Control` `I` | `Cmd` `I` | ## Source code [packages/extension-italic/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-italic/) diff --git a/docs/api/marks/strike.md b/docs/api/marks/strike.md index 2feba2e50..f5ba7d0d5 100644 --- a/docs/api/marks/strike.md +++ b/docs/api/marks/strike.md @@ -32,8 +32,9 @@ yarn add @tiptap/extension-strike | unsetStrike | — | Remove strike mark. | ## Keyboard shortcuts -* Windows/Linux: `Control` `Shift` `X` -* macOS: `Cmd` `Shift` `X` +| Command | Windows/Linux | macOS | +| -------------- | ------------------------------- | --------------------------- | +| toggleStrike() | `Control` `Shift` `X` | `Cmd` `Shift` `X` | ## Source code [packages/extension-strike/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-strike/) diff --git a/docs/api/marks/subscript.md b/docs/api/marks/subscript.md index 7a8a076cc..489597153 100644 --- a/docs/api/marks/subscript.md +++ b/docs/api/marks/subscript.md @@ -19,15 +19,16 @@ yarn add @tiptap/extension-subscript | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. | ## Commands -| Command | Parameters | Description | -| --------------- | ---------- | ------------------------- | +| Command | Parameters | Description | +| --------------- | ---------- | ----------------------- | | setSubscript | — | Mark text as subscript. | | toggleSubscript | — | Toggle subscript mark. | | unsetSubscript | — | Remove subscript mark. | ## Keyboard shortcuts -* Windows/Linux: `Control` `,` -* macOS: `Cmd` `,` +| Command | Windows/Linux | macOS | +| ----------------- | ------------------ | -------------- | +| toggleSubscript() | `Control` `,` | `Cmd` `,` | ## Source code [packages/extension-subscript/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-subscript/) diff --git a/docs/api/marks/superscript.md b/docs/api/marks/superscript.md index 9f471d4b6..cd481282e 100644 --- a/docs/api/marks/superscript.md +++ b/docs/api/marks/superscript.md @@ -26,8 +26,9 @@ yarn add @tiptap/extension-superscript | unsetSuperscript | — | Remove superscript mark. | ## Keyboard shortcuts -* Windows/Linux: `Control` `.` -* macOS: `Cmd` `.` +| Command | Windows/Linux | macOS | +| ------------------- | ------------------ | -------------- | +| toggleSuperscript() | `Control` `.` | `Cmd` `.` | ## Source code [packages/extension-superscript/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-superscript/) diff --git a/docs/api/marks/underline.md b/docs/api/marks/underline.md index c36587851..f8e663e55 100644 --- a/docs/api/marks/underline.md +++ b/docs/api/marks/underline.md @@ -32,8 +32,9 @@ yarn add @tiptap/extension-underline | unsetUnderline | — | Remove underline mark. | ## Keyboard shortcuts -* Windows/Linux: `Control` `U` -* macOS: `Cmd` `U` +| Command | Windows/Linux | macOS | +| ----------------- | ------------------ | -------------- | +| toggleUnderline() | `Control` `U` | `Cmd` `U` | ## Source code [packages/extension-underline/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-underline/)