From ecd95b8c71354d0db07084ebd351fc1ed9935f59 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Thu, 20 Aug 2020 21:25:15 +0200 Subject: [PATCH] improve extensions documentation, add italic documentation --- docs/src/demos/Extensions/Italic/index.vue | 51 ++++++++++++++++++ .../src/docPages/api/extensions/blockquote.md | 2 +- docs/src/docPages/api/extensions/bold.md | 11 ++-- .../docPages/api/extensions/bullet-list.md | 2 +- docs/src/docPages/api/extensions/code.md | 2 +- docs/src/docPages/api/extensions/history.md | 4 +- .../api/extensions/horizontal-rule.md | 2 +- docs/src/docPages/api/extensions/italic.md | 54 ++++--------------- .../docPages/api/extensions/ordered-list.md | 2 +- .../docPages/api/extensions/placeholder.md | 28 +++++----- docs/src/docPages/api/extensions/strike.md | 2 +- docs/src/docPages/api/extensions/todo-list.md | 2 +- docs/src/docPages/api/extensions/underline.md | 2 +- 13 files changed, 90 insertions(+), 74 deletions(-) create mode 100644 docs/src/demos/Extensions/Italic/index.vue diff --git a/docs/src/demos/Extensions/Italic/index.vue b/docs/src/demos/Extensions/Italic/index.vue new file mode 100644 index 00000000..ed4b8593 --- /dev/null +++ b/docs/src/demos/Extensions/Italic/index.vue @@ -0,0 +1,51 @@ + + + \ No newline at end of file diff --git a/docs/src/docPages/api/extensions/blockquote.md b/docs/src/docPages/api/extensions/blockquote.md index b95265be..0e899d1f 100644 --- a/docs/src/docPages/api/extensions/blockquote.md +++ b/docs/src/docPages/api/extensions/blockquote.md @@ -7,7 +7,7 @@ The Blockquote extension enables you to use the `
` HTML tag in the e ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| blockquote | none | Wrap content in a blockquote. | +| blockquote | — | Wrap content in a blockquote. | ## Keybindings * `Control` + `→` diff --git a/docs/src/docPages/api/extensions/bold.md b/docs/src/docPages/api/extensions/bold.md index 93f4c160..749153b5 100644 --- a/docs/src/docPages/api/extensions/bold.md +++ b/docs/src/docPages/api/extensions/bold.md @@ -2,7 +2,7 @@ This extension is used to render text in **bold**. If you pass ``, `` tags, or text with inline `style` attributes setting the `font-weight` CSS rule in the editor’s initial content, they will all be rendered accordingly. ::: warning Restrictions -The extension will generate the corresponding `` HTML tags when reading contents of the `Editor` instance. All text marked as bold, regardless of the method will be normalized to `` HTML tags. +The extension will generate the corresponding `` HTML tags when reading contents of the `Editor` instance. All text marked bold, regardless of the method will be normalized to `` HTML tags. ::: ## Options @@ -11,15 +11,14 @@ The extension will generate the corresponding `` HTML tags when reading ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| bold | none | Mark text as bold. | +| bold | — | Mark text bold. | ## Keybindings * Windows & Linux: `Control` + `B` * macOS: `Command` + `B` -## Usage - - ## Source Code - [packages/extension-bold/index.ts](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-bold/index.ts) + +## Usage + \ No newline at end of file diff --git a/docs/src/docPages/api/extensions/bullet-list.md b/docs/src/docPages/api/extensions/bullet-list.md index a3f2738f..d547079b 100644 --- a/docs/src/docPages/api/extensions/bullet-list.md +++ b/docs/src/docPages/api/extensions/bullet-list.md @@ -11,7 +11,7 @@ It’s intended to be used with the `ListItem` extension. ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| bullet_list | none | Toggle a bullet list. | +| bullet_list | — | Toggle a bullet list. | ## Keybindings * `Control` + `Shift` + `8` diff --git a/docs/src/docPages/api/extensions/code.md b/docs/src/docPages/api/extensions/code.md index 0ad425dd..87d16c88 100644 --- a/docs/src/docPages/api/extensions/code.md +++ b/docs/src/docPages/api/extensions/code.md @@ -7,7 +7,7 @@ The Code extensions enables you to use the `` HTML tag in the editor. ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| code | none | Mark text as code. | +| code | — | Mark text as code. | ## Keybindings * `Alt` + ` diff --git a/docs/src/docPages/api/extensions/history.md b/docs/src/docPages/api/extensions/history.md index b7cdf189..63be4778 100644 --- a/docs/src/docPages/api/extensions/history.md +++ b/docs/src/docPages/api/extensions/history.md @@ -4,8 +4,8 @@ Enables history support. ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| undo | none | Undo the latest change. | -| redo | none | Redo the latest change. | +| undo | — | Undo the latest change. | +| redo | — | Redo the latest change. | ## Keybindings * Windows & Linux: `Control` + `Z` → Undo diff --git a/docs/src/docPages/api/extensions/horizontal-rule.md b/docs/src/docPages/api/extensions/horizontal-rule.md index d877655d..d70138b4 100644 --- a/docs/src/docPages/api/extensions/horizontal-rule.md +++ b/docs/src/docPages/api/extensions/horizontal-rule.md @@ -7,7 +7,7 @@ Enables you to use the `
` HTML tag in the editor. ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| horizontal_rule | none | Create a horizontal rule. | +| horizontal_rule | — | Create a horizontal rule. | ## Keybindings *None* diff --git a/docs/src/docPages/api/extensions/italic.md b/docs/src/docPages/api/extensions/italic.md index 88e4199d..7de517c3 100644 --- a/docs/src/docPages/api/extensions/italic.md +++ b/docs/src/docPages/api/extensions/italic.md @@ -1,5 +1,9 @@ # Italic -Enables you to use the `` HTML tag in the editor. +This extension is used to render text in *italic*. If you pass ``, `` tags, or text with inline `style` attributes setting `font-style: italic` in the editor’s initial content, they will all be rendered accordingly. + +::: warning Restrictions +The extension will generate the corresponding `` HTML tags when reading contents of the `Editor` instance. All text marked italic, regardless of the method will be normalized to `` HTML tags. +::: ## Options *None* @@ -7,52 +11,14 @@ Enables you to use the `` HTML tag in the editor. ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| italic | none | Mark text as italic. | +| italic | — | Mark text italic. | ## Keybindings * Windows & Linux: `Control` + `I` * macOS: `Command` + `I` +## Source Code +[packages/extension-italic/index.ts](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-italic/index.ts) + ## Usage -```markup - - - -``` \ No newline at end of file + diff --git a/docs/src/docPages/api/extensions/ordered-list.md b/docs/src/docPages/api/extensions/ordered-list.md index f3c32e7d..390c2c40 100644 --- a/docs/src/docPages/api/extensions/ordered-list.md +++ b/docs/src/docPages/api/extensions/ordered-list.md @@ -11,7 +11,7 @@ This extensions is intended to be used with the `ListItem` extension. ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| ordered_list | none | Toggle an ordered list. | +| ordered_list | — | Toggle an ordered list. | ## Keybindings * `Control` + `Shift` + `9` diff --git a/docs/src/docPages/api/extensions/placeholder.md b/docs/src/docPages/api/extensions/placeholder.md index 00c68d7c..b5ad0ba4 100644 --- a/docs/src/docPages/api/extensions/placeholder.md +++ b/docs/src/docPages/api/extensions/placeholder.md @@ -19,20 +19,20 @@ Each `` includes a single ``. | Command | Options | Description | | ------ | ---- | ---------------- | | createTable | ```{ rowsCount, colsCount, withHeaderRow }``` | Returns a table node of a given size. `withHeaderRow` defines whether the first row of the table will be a header row. | -| deleteTable | none | Deletes the complete table which is active | -| addColumnBefore | none | Add a column before the selection. | -| addColumnAfter | none | Add a column after the selection. | -| deleteColumn | none | Removes the selected columns. | -| addRowBefore | none | Add a table row before the selection. | -| addRowAfter | none | Add a table row after the selection. | -| toggleCellMerge | none | See mergeCells and splitCells | -| mergeCells | none | Merge the selected cells into a single cell. Only available when the selected cells' outline forms a rectangle. | -| splitCell | none | Split a selected cell, whose rowspan or colspan is greater than one into smaller cells. | -| toggleHeaderColumn | none | Toggles whether the selected column contains header cells. | -| toggleHeaderRow | none | Toggles whether the selected row contains header cells. | -| toggleHeaderCell | none | Toggles whether the selected column contains header cells. | -| setCellAttr | none | Returns a command that sets the given attribute to the given value, and is only available when the currently selected cell doesn't already have that attribute set to that value. | -| fixTables | none | Inspect all tables in the given state's document and return a transaction that fixes them, if necessary. | +| deleteTable | — | Deletes the complete table which is active | +| addColumnBefore | — | Add a column before the selection. | +| addColumnAfter | — | Add a column after the selection. | +| deleteColumn | — | Removes the selected columns. | +| addRowBefore | — | Add a table row before the selection. | +| addRowAfter | — | Add a table row after the selection. | +| toggleCellMerge | — | See mergeCells and splitCells | +| mergeCells | — | Merge the selected cells into a single cell. Only available when the selected cells' outline forms a rectangle. | +| splitCell | — | Split a selected cell, whose rowspan or colspan is greater than one into smaller cells. | +| toggleHeaderColumn | — | Toggles whether the selected column contains header cells. | +| toggleHeaderRow | — | Toggles whether the selected row contains header cells. | +| toggleHeaderCell | — | Toggles whether the selected column contains header cells. | +| setCellAttr | — | Returns a command that sets the given attribute to the given value, and is only available when the currently selected cell doesn't already have that attribute set to that value. | +| fixTables | — | Inspect all tables in the given state's document and return a transaction that fixes them, if necessary. | ## Usage ::: warning diff --git a/docs/src/docPages/api/extensions/strike.md b/docs/src/docPages/api/extensions/strike.md index b19bc52d..463de394 100644 --- a/docs/src/docPages/api/extensions/strike.md +++ b/docs/src/docPages/api/extensions/strike.md @@ -7,7 +7,7 @@ Enables you to use the `` HTML tag in the editor. ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| strike | none | Mark text as strikethrough. | +| strike | — | Mark text as strikethrough. | ## Keybindings * Windows & Linux: `Control` + `D` diff --git a/docs/src/docPages/api/extensions/todo-list.md b/docs/src/docPages/api/extensions/todo-list.md index a3669e70..89f0f89a 100644 --- a/docs/src/docPages/api/extensions/todo-list.md +++ b/docs/src/docPages/api/extensions/todo-list.md @@ -11,7 +11,7 @@ This extensions is intended to be used with the `TodoItem` extension. ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| todo_list | none | Toggle todo list. | +| todo_list | — | Toggle todo list. | ## Keybindings *None* diff --git a/docs/src/docPages/api/extensions/underline.md b/docs/src/docPages/api/extensions/underline.md index 6ff6419b..8e639900 100644 --- a/docs/src/docPages/api/extensions/underline.md +++ b/docs/src/docPages/api/extensions/underline.md @@ -7,7 +7,7 @@ Enables you to use the `` HTML tag in the editor. ## Commands | Command | Options | Description | | ------ | ---- | ---------------- | -| underline | none | Mark text as underlined. | +| underline | — | Mark text as underlined. | ## Keybindings * Windows & Linux: `Control` + `U`