diff --git a/docs/api/marks/code.md b/docs/api/marks/code.md index 75778f16..537b9989 100644 --- a/docs/api/marks/code.md +++ b/docs/api/marks/code.md @@ -21,11 +21,27 @@ yarn add @tiptap/extension-code | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. | ## Commands -| Command | Parameters | Description | -| ---------- | ---------- | ------------------------- | -| setCode | — | Mark text as inline code. | -| toggleCode | — | Toggle inline code mark. | -| unsetCode | — | Remove inline code mark. | + +### setCode() +Mark text as inline code. + +```js +editor.commands.setCode() +``` + +### toggleCode() +Toggle inline code mark. + +```js +editor.commands.toggleCode() +``` + +### unsetCode() +Remove inline code mark. + +```js +editor.commands.unsetCode() +``` ## Keyboard shortcuts | Command | Windows/Linux | macOS | diff --git a/docs/api/marks/highlight.md b/docs/api/marks/highlight.md index 9b552041..a1be2e2f 100644 --- a/docs/api/marks/highlight.md +++ b/docs/api/marks/highlight.md @@ -22,11 +22,30 @@ yarn add @tiptap/extension-highlight | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. | ## Commands -| Command | Options | Description | -| --------------- | ------------------ | ------------------------- | -| setHighlight | `color` (optional) | Mark text as highlighted. | -| toggleHighlight | `color` (optional) | Toggle a text highlight. | -| unsetHighlight | — | Removes the highlight. | + +### setHighlight() +Mark text as highlighted. + +```js +editor.commands.setHighlight() +editor.commands.setHighlight({ color: '#ffcc00' }) +``` + +### toggleHighlight() +Toggle a text highlight. + +```js +editor.commands.toggleHighlight() +editor.commands.toggleHighlight({ color: '#ffcc00' }) +``` + +### unsetHighlight() + Removes the highlight. + +```js +editor.commands. unsetHighlight() +``` + ## Keyboard shortcuts | Command | Windows/Linux | macOS | diff --git a/docs/api/marks/italic.md b/docs/api/marks/italic.md index 1209aca8..ee816a7e 100644 --- a/docs/api/marks/italic.md +++ b/docs/api/marks/italic.md @@ -25,12 +25,27 @@ yarn add @tiptap/extension-italic | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. | ## Commands -| Command | Parameters | Description | -| ------------ | ---------- | -------------------- | -| setItalic | — | Mark text as italic. | -| toggleItalic | — | Toggle italic mark. | -| unsetItalic | — | Remove italic mark. | +### setItalic() +Mark the text italic. + +```js +editor.commands.setItalic() +``` + +### toggleItalic() +Toggle the italic mark. + +```js +editor.commands.toggleItalic() +``` + +### unsetItalic() +Remove the italic mark. + +```js +editor.commands.unsetItalic() +``` ## Keyboard shortcuts | Command | Windows/Linux | macOS | diff --git a/docs/api/marks/link.md b/docs/api/marks/link.md index 082bbf03..64dbc439 100644 --- a/docs/api/marks/link.md +++ b/docs/api/marks/link.md @@ -25,11 +25,29 @@ yarn add @tiptap/extension-link | linkOnPaste | `Boolean` | `true` | Adds a link to the current selection if the pasted content only contains an url. | ## Commands -| Command | Parameters | Description | -| ---------- | ------------------ | -------------------------------------------- | -| setLink | `href`
`target` | Link the selected text. | -| toggleLink | `href`
`target` | Add or remove a link from the selected text. | -| unsetLink | – | Removes a link. | + +### setLink() +Links the selected text. + +```js +editor.commands.setLink({ href: 'https://example.com' }) +editor.commands.setLink({ href: 'https://example.com', target: '_blank' }) +``` + +### toggleLink() +Adds or removes a link from the selected text. + +```js +editor.commands.toggleLink({ href: 'https://example.com' }) +editor.commands.toggleLink({ href: 'https://example.com', target: '_blank' }) +``` + +### unsetLink() +Removes a link. + +```js +editor.commands.unsetLink() +``` ## Keyboard shortcuts :::warning Doesn’t have a keyboard shortcut diff --git a/docs/api/marks/strike.md b/docs/api/marks/strike.md index f5ba7d0d..83927e04 100644 --- a/docs/api/marks/strike.md +++ b/docs/api/marks/strike.md @@ -25,11 +25,27 @@ yarn add @tiptap/extension-strike | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. | ## Commands -| Command | Parameters | Description | -| ------------ | ---------- | --------------------- | -| setStrike | — | Mark text as striked. | -| toggleStrike | — | Toggle strike mark. | -| unsetStrike | — | Remove strike mark. | + +### setStrike() +Mark text as striked. + +```js +editor.commands.setStrike() +``` + +### toggleStrike() +Toggle strike mark. + +```js +editor.commands.toggleStrike() +``` + +### unsetStrike() +Remove strike mark. + +```js +editor.commands.unsetStrike() +``` ## Keyboard shortcuts | Command | Windows/Linux | macOS | diff --git a/docs/api/marks/subscript.md b/docs/api/marks/subscript.md index 48959715..6f20d337 100644 --- a/docs/api/marks/subscript.md +++ b/docs/api/marks/subscript.md @@ -19,11 +19,27 @@ yarn add @tiptap/extension-subscript | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. | ## Commands -| Command | Parameters | Description | -| --------------- | ---------- | ----------------------- | -| setSubscript | — | Mark text as subscript. | -| toggleSubscript | — | Toggle subscript mark. | -| unsetSubscript | — | Remove subscript mark. | + +### setSubscript() +Mark text as subscript. + +```js +editor.commands.setSubscript() +``` + +### toggleSubscript() +Toggle subscript mark. + +```js +editor.commands.toggleSubscript() +``` + +### unsetSubscript() +Remove subscript mark. + +```js +editor.commands.unsetSubscript() +``` ## Keyboard shortcuts | Command | Windows/Linux | macOS | diff --git a/docs/api/marks/superscript.md b/docs/api/marks/superscript.md index cd481282..8a0f2419 100644 --- a/docs/api/marks/superscript.md +++ b/docs/api/marks/superscript.md @@ -19,11 +19,27 @@ yarn add @tiptap/extension-superscript | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. | ## Commands -| Command | Parameters | Description | -| ----------------- | ---------- | ------------------------- | -| setSuperscript | — | Mark text as superscript. | -| toggleSuperscript | — | Toggle superscript mark. | -| unsetSuperscript | — | Remove superscript mark. | + +### setSuperscript() +Mark text as superscript. + +```js +editor.commands.setSuperscript() +``` + +### toggleSuperscript() +Toggle superscript mark. + +```js +editor.commands.toggleSuperscript() +``` + +### unsetSuperscript() +Remove superscript mark. + +```js +editor.commands.unsetSuperscript() +``` ## Keyboard shortcuts | Command | Windows/Linux | macOS | diff --git a/docs/api/marks/text-style.md b/docs/api/marks/text-style.md index 95dc7303..0454c22e 100644 --- a/docs/api/marks/text-style.md +++ b/docs/api/marks/text-style.md @@ -14,9 +14,13 @@ yarn add @tiptap/extension-text-style ``` ## Commands -| Command | Parameters | Description | -| -------------------- | ---------- | --------------------------------------------- | -| removeEmptyTextStyle | – | Remove `` tags without an inline style. | + +### removeEmptyTextStyle() +Remove `` tags without an inline style. + +```js +editor.command.removeEmptyTextStyle() +``` ## Source code [packages/extension-text-style/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-text-style/) diff --git a/docs/api/marks/underline.md b/docs/api/marks/underline.md index f8e663e5..e02ff91c 100644 --- a/docs/api/marks/underline.md +++ b/docs/api/marks/underline.md @@ -25,11 +25,27 @@ yarn add @tiptap/extension-underline | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. | ## Commands -| Command | Parameters | Description | -| --------------- | ---------- | ------------------------ | -| setUnderline | — | Mark text as underlined. | -| toggleUnderline | — | Toggle underline mark. | -| unsetUnderline | — | Remove underline mark. | + +### setUnderline() +Marks a text as underlined. + +```js +editor.commands.setUnderline() +``` + +### toggleUnderline() +Toggles an underline mark. + +```js +editor.commands.toggleUnderline() +``` + +### unsetUnderline() +Removes an underline mark. + +```js +editor.commands.unsetUnderline() +``` ## Keyboard shortcuts | Command | Windows/Linux | macOS |