docs: add HTMLAttributes

This commit is contained in:
Hans Pagel
2020-11-18 12:12:34 +01:00
parent be5a715926
commit c47e4d1f6d
25 changed files with 93 additions and 86 deletions

View File

@@ -95,7 +95,7 @@ new Editor({
| --------- | ------------------------------------------------------ | | --------- | ------------------------------------------------------ |
| `'start'` | Sets the focus to the beginning of the document. | | `'start'` | Sets the focus to the beginning of the document. |
| `'end'` | Sets the focus to the end of the document. | | `'end'` | Sets the focus to the end of the document. |
| number | Sets the focus to a specific position in the document. | | `Number` | Sets the focus to a specific position in the document. |
| `true` | Enables autofocus. | | `true` | Enables autofocus. |
| `false` | Disables autofocus. | | `false` | Disables autofocus. |
| `null` | Disables autofocus. | | `null` | Disables autofocus. |

View File

@@ -15,6 +15,7 @@ yarn add @tiptap/extension-collaboration yjs y-webrtc
``` ```
## Settings ## Settings
<!-- TODO -->
| Option | Type | Default | Description | | Option | Type | Default | Description |
| -------- | ---- | ------- | ----------- | | -------- | ---- | ------- | ----------- |
| provider | | | | | provider | | | |

View File

@@ -12,6 +12,13 @@ npm install @tiptap/extension-dropcursor
yarn add @tiptap/extension-dropcursor yarn add @tiptap/extension-dropcursor
``` ```
## Settings
| Option | Type | Default | Description |
| ------ | -------- | --------- | --------------------------------------------------------------------- |
| color | `String` | `'black'` | Color of the dropcursor. |
| width | `Number` | `1` | Width of the dropcursor. |
| class | `String` | | One or multiple CSS classes that should be applied to the dropcursor. |
## Source code ## Source code
[packages/extension-dropcursor/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-dropcursor/) [packages/extension-dropcursor/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-dropcursor/)

View File

@@ -13,10 +13,10 @@ yarn add @tiptap/extension-focus
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| --------- | ------- | --------- | ------------------------------------------------------ | | --------- | --------- | ------------- | ------------------------------------------------------ |
| className | string | has-focus | The class that is applied to the focused element. | | className | `String` | `'has-focus'` | The class that is applied to the focused element. |
| nested | boolean | true | When enabled nested elements get the focus class, too. | | nested | `Boolean` | `true` | When enabled nested elements get the focus class, too. |
## Source code ## Source code
[packages/extension-focus/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-focus/) [packages/extension-focus/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-focus/)

View File

@@ -15,9 +15,9 @@ yarn add @tiptap/extension-text-style @tiptap/extension-font-family
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ----- | ------------- | ------------------------------------------------------------------------ | | ------ | ------- | --------------- | ------------------------------------------------------------------------ |
| types | array | ['textStyle'] | A list of marks to which the font family attribute should be applied to. | | types | `Array` | `['textStyle']` | A list of marks to which the font family attribute should be applied to. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -11,10 +11,10 @@ yarn add @tiptap/extension-history
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------------- | ------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| depth | number | 100 | The amount of history events that are collected before the oldest events are discarded. Defaults to 100. | | depth | `Number` | `100` | The amount of history events that are collected before the oldest events are discarded. Defaults to 100. |
| newGroupDelay | number | 500 | The delay between changes after which a new group should be started (in milliseconds). When changes arent adjacent, a new group is always started. | | newGroupDelay | `Number` | `500` | The delay between changes after which a new group should be started (in milliseconds). When changes arent adjacent, a new group is always started. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -11,11 +11,11 @@ yarn add @tiptap/extension-text-align
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ---------------- | ------ | -------------------------------------- | -------------------------------------------------------------------- | | ---------------- | -------- | ---------------------------------------- | -------------------------------------------------------------------- |
| types | array | ['heading', 'paragraph'] | A list of nodes where the text align attribute should be applied to. | | types | `Array` | `['heading', 'paragraph']` | A list of nodes where the text align attribute should be applied to. |
| alignments | array | ['left', 'center', 'right', 'justify'] | A list of available options for the text align attribute. | | alignments | `Array` | `['left', 'center', 'right', 'justify']` | A list of available options for the text align attribute. |
| defaultAlignment | string | left | The default text align. | | defaultAlignment | `String` | `'left'` | The default text align. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -17,14 +17,14 @@ yarn add @tiptap/extension-bold
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |
| ------- | ------- | --------------- | | ------- | ---------- | --------------- |
| bold | — | Mark text bold. | | bold | — | Mark text bold. |
## Keyboard shortcuts ## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`B` * Windows/Linux: `Control`&nbsp;`B`

View File

@@ -13,14 +13,14 @@ yarn add @tiptap/extension-code
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |
| ------- | ------- | ------------------------- | | ------- | ---------- | ------------------------- |
| code | — | Mark text as inline code. | | code | — | Mark text as inline code. |
## Keyboard shortcuts ## Keyboard shortcuts
* `Alt`&nbsp;<code>`</code> * `Alt`&nbsp;<code>`</code>

View File

@@ -13,9 +13,9 @@ yarn add @tiptap/extension-highlight
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Options | Description | | Command | Options | Description |

View File

@@ -17,14 +17,14 @@ yarn add @tiptap/extension-italic
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |
| ------- | ------- | ----------------- | | ------- | ---------- | ----------------- |
| italic | — | Mark text italic. | | italic | — | Mark text italic. |
## Keyboard shortcuts ## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`I` * Windows/Linux: `Control`&nbsp;`I`

View File

@@ -15,12 +15,10 @@ yarn add @tiptap/extension-link
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ----------- | ------- | ---------------------------- | -------------------------------------------- | | -------------- | --------- | ----------------------------------------------------------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{ target: '_blank', rel: 'noopener noreferrer nofollow' }` | Custom HTML attributes that should be added to the rendered HTML tag. |
| openOnClick | boolean | true | If enabled, links will be opened on click. | | openOnClick | `Boolean` | `true` | If enabled, links will be opened on click. |
| rel | string | noopener noreferrer nofollow | Configure the `rel` attribute. |
| target | string | _blank | Set the default `target` of links. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -17,14 +17,14 @@ yarn add @tiptap/extension-strike
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |
| ------- | ------- | --------------------------- | | ------- | ---------- | --------------------------- |
| strike | — | Mark text as strikethrough. | | strike | — | Mark text as strikethrough. |
## Keyboard shortcuts ## Keyboard shortcuts
* Windows/Linux: `Control`&nbsp;`D` * Windows/Linux: `Control`&nbsp;`D`

View File

@@ -17,9 +17,9 @@ yarn add @tiptap/extension-underline
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -14,9 +14,9 @@ yarn add @tiptap/extension-blockquote
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -17,13 +17,13 @@ yarn add @tiptap/extension-bullet-list @tiptap/extension-list-item
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |
| ----------- | ---------- | --------------------- | | ---------- | ---------- | --------------------- |
| bulletList | — | Toggle a bullet list. | | bulletList | — | Toggle a bullet list. |
## Keyboard shortcuts ## Keyboard shortcuts

View File

@@ -17,10 +17,10 @@ yarn add @tiptap/extension-code-block
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------------------- | ------ | --------- | ---------------------------------------------------------------- | | ------------------- | -------- | ------------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
| languageClassPrefix | string | language- | Adds a prefix to language classes that are applied to code tags. | | languageClassPrefix | `String` | `'language-'` | Adds a prefix to language classes that are applied to code tags. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -13,10 +13,10 @@ yarn add @tiptap/extension-heading
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------------------ | --------------------------------------------- | | -------------- | -------- | -------------------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
| levels | array | [1, 2, 3, 4, 5, 6] | Specifies which heading levels are supported. | | levels | `Array` | `[1, 2, 3, 4, 5, 6]` | Specifies which heading levels are supported. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -13,9 +13,9 @@ yarn add @tiptap/extension-horizontal-rule
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -15,9 +15,10 @@ yarn add @tiptap/extension-image
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------- | ------- | ------------------------------ | | -------------- | --------- | ------- | --------------------------------------------------------------------- |
| inline | boolean | false | Renders the image node inline. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
| inline | `Boolean` | `false` | Renders the image node inline. |
## Source code ## Source code
[packages/extension-image/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-image/) [packages/extension-image/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-image/)

View File

@@ -15,9 +15,9 @@ yarn add @tiptap/extension-list-item
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Keyboard shortcuts ## Keyboard shortcuts
* New list item: `Enter` * New list item: `Enter`

View File

@@ -17,9 +17,9 @@ yarn add @tiptap/extension-ordered-list @tiptap/extension-list-item
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -15,9 +15,9 @@ yarn add @tiptap/extension-paragraph
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |

View File

@@ -17,9 +17,9 @@ yarn add @tiptap/extension-task-list @tiptap/extension-task-item
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Keyboard shortcuts ## Keyboard shortcuts
* New list item: `Enter` * New list item: `Enter`

View File

@@ -17,9 +17,9 @@ yarn add @tiptap/extension-task-list @tiptap/extension-task-item
``` ```
## Settings ## Settings
| Option | Type | Default | Description | | Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- | | -------------- | -------- | ------- | --------------------------------------------------------------------- |
| class | string | | Add a custom class to the rendered HTML tag. | | HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands ## Commands
| Command | Parameters | Description | | Command | Parameters | Description |