From 789296be4e0d6f8dbe9e82c978ef8924d3a865ed Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 23 Sep 2020 09:52:04 +0200 Subject: [PATCH] add installation instructions to all extensions --- docs/src/docPages/api/extensions/bold.md | 9 +++++++++ docs/src/docPages/api/extensions/bullet-list.md | 9 +++++++++ docs/src/docPages/api/extensions/code-block.md | 9 +++++++++ docs/src/docPages/api/extensions/code.md | 9 +++++++++ docs/src/docPages/api/extensions/document.md | 9 +++++++++ docs/src/docPages/api/extensions/hard-break.md | 9 +++++++++ docs/src/docPages/api/extensions/heading.md | 9 +++++++++ docs/src/docPages/api/extensions/history.md | 9 +++++++++ docs/src/docPages/api/extensions/italic.md | 9 +++++++++ docs/src/docPages/api/extensions/link.md | 9 +++++++++ docs/src/docPages/api/extensions/list-item.md | 9 +++++++++ docs/src/docPages/api/extensions/mention.md | 2 +- docs/src/docPages/api/extensions/ordered-list.md | 9 +++++++++ docs/src/docPages/api/extensions/paragraph.md | 9 +++++++++ docs/src/docPages/api/extensions/strike.md | 9 +++++++++ docs/src/docPages/api/extensions/text.md | 9 +++++++++ docs/src/docPages/api/extensions/underline.md | 9 +++++++++ docs/src/docPages/overview/upgrade-guide.md | 6 ------ 18 files changed, 145 insertions(+), 7 deletions(-) diff --git a/docs/src/docPages/api/extensions/bold.md b/docs/src/docPages/api/extensions/bold.md index b9005f1c..18d1afd2 100644 --- a/docs/src/docPages/api/extensions/bold.md +++ b/docs/src/docPages/api/extensions/bold.md @@ -7,6 +7,15 @@ Type `**two asterisks**` or `__two underlines__` and it will magically transform 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. ::: +## Installation +```bash +# With npm +npm install @tiptap/extension-bold + +# Or: With Yarn +yarn add @tiptap/extension-bold +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/bullet-list.md b/docs/src/docPages/api/extensions/bullet-list.md index 34ffa757..132eaa1c 100644 --- a/docs/src/docPages/api/extensions/bullet-list.md +++ b/docs/src/docPages/api/extensions/bullet-list.md @@ -7,6 +7,15 @@ Type `* ​`, `- ​` or `+ ​` at the beginning of a new line and it will magi The `BulletList` extension is intended to be used with the [`ListItem`](/api/extensions/list-item) extension. Make sure to import that one too, otherwise you’ll get a SyntaxError. ::: +## Installation +```bash +# With npm +npm install @tiptap/extension-bullet-list + +# Or: With Yarn +yarn add @tiptap/extension-bullet-list +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/code-block.md b/docs/src/docPages/api/extensions/code-block.md index 06f2047a..9208fcbe 100644 --- a/docs/src/docPages/api/extensions/code-block.md +++ b/docs/src/docPages/api/extensions/code-block.md @@ -7,6 +7,15 @@ Type three backticks and a space ``` and a code b The CodeBlock extension doesn’t come with styling and has no syntax highlighting built-in. It’s on our roadmap though. ::: +## Installation +```bash +# With npm +npm install @tiptap/extension-code-block + +# Or: With Yarn +yarn add @tiptap/extension-code-block +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/code.md b/docs/src/docPages/api/extensions/code.md index 68b27b52..ad39a293 100644 --- a/docs/src/docPages/api/extensions/code.md +++ b/docs/src/docPages/api/extensions/code.md @@ -3,6 +3,15 @@ The Code extensions enables you to use the `` HTML tag in the editor. If y Type something with \`back-ticks around\` and it will magically transform to `inline code` while you type. +## Installation +```bash +# With npm +npm install @tiptap/extension-code + +# Or: With Yarn +yarn add @tiptap/extension-code +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/document.md b/docs/src/docPages/api/extensions/document.md index 2ac899a5..246932a8 100644 --- a/docs/src/docPages/api/extensions/document.md +++ b/docs/src/docPages/api/extensions/document.md @@ -7,6 +7,15 @@ The node is very tiny though. It defines a name of the node (`document`), is con Tiptap 1 tried to hide that node from you, but it has always been there. A tiny, but important change though: **We renamed the default type from `doc` to `document`.** To keep it like that, use your own implementation of the `Document` node or migrate the stored JSON to use the new name. ::: +## Installation +```bash +# With npm +npm install @tiptap/extension-document + +# Or: With Yarn +yarn add @tiptap/extension-document +``` + ## Source code [packages/extension-document/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-document/) diff --git a/docs/src/docPages/api/extensions/hard-break.md b/docs/src/docPages/api/extensions/hard-break.md index 1bf9c857..3e3a24de 100644 --- a/docs/src/docPages/api/extensions/hard-break.md +++ b/docs/src/docPages/api/extensions/hard-break.md @@ -1,6 +1,15 @@ # HardBreak The HardBreak extensions adds support for the `
` HTML tag, which forces a line break. +## Installation +```bash +# With npm +npm install @tiptap/extension-hard-break + +# Or: With Yarn +yarn add @tiptap/extension-hard-break +``` + ## Options *None* diff --git a/docs/src/docPages/api/extensions/heading.md b/docs/src/docPages/api/extensions/heading.md index 26cf08c3..dc47e60c 100644 --- a/docs/src/docPages/api/extensions/heading.md +++ b/docs/src/docPages/api/extensions/heading.md @@ -3,6 +3,15 @@ The Heading extension adds support for headings of different levels. Headings ar Type `# ​` at the beginning of a new line and it will magically transform to a headline, same for `## ​`, `### ​`, `#### ​`, `##### ​` and `###### ​`. +## Installation +```bash +# With npm +npm install @tiptap/extension-heading + +# Or: With Yarn +yarn add @tiptap/extension-heading +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------------------ | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/history.md b/docs/src/docPages/api/extensions/history.md index 9009198f..ac27723d 100644 --- a/docs/src/docPages/api/extensions/history.md +++ b/docs/src/docPages/api/extensions/history.md @@ -1,6 +1,15 @@ # History This extension provides history support. All changes to the document will be tracked and can be removed with `undo`. Undone changes can be applied with `redo` again. +## Installation +```bash +# With npm +npm install @tiptap/extension-history + +# Or: With Yarn +yarn add @tiptap/extension-history +``` + ## Options *None* diff --git a/docs/src/docPages/api/extensions/italic.md b/docs/src/docPages/api/extensions/italic.md index 9d2f57c8..2d92c53f 100644 --- a/docs/src/docPages/api/extensions/italic.md +++ b/docs/src/docPages/api/extensions/italic.md @@ -5,6 +5,15 @@ Use this extension to render text in *italic*. If you pass ``, `` tags, o 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. ::: +## Installation +```bash +# With npm +npm install @tiptap/extension-italic + +# Or: With Yarn +yarn add @tiptap/extension-italic +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/link.md b/docs/src/docPages/api/extensions/link.md index b796eb3a..cbf58a60 100644 --- a/docs/src/docPages/api/extensions/link.md +++ b/docs/src/docPages/api/extensions/link.md @@ -1,6 +1,15 @@ # Link Enables you to use the `` HTML tag in the editor. +## Installation +```bash +# With npm +npm install @tiptap/extension-link + +# Or: With Yarn +yarn add @tiptap/extension-link +``` + ## Options | Option | Type | Default | Description | | ----------- | ------- | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/list-item.md b/docs/src/docPages/api/extensions/list-item.md index 4a072695..9b990e1d 100644 --- a/docs/src/docPages/api/extensions/list-item.md +++ b/docs/src/docPages/api/extensions/list-item.md @@ -5,6 +5,15 @@ Enables you to use the `
  • ` HTML tag in the editor. This extensions is intended to be used with the `BulletList` or `OrderedList` extension. ::: +## Installation +```bash +# With npm +npm install @tiptap/extension-list-item + +# Or: With Yarn +yarn add @tiptap/extension-list-item +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/mention.md b/docs/src/docPages/api/extensions/mention.md index be48d4db..3c2c0838 100644 --- a/docs/src/docPages/api/extensions/mention.md +++ b/docs/src/docPages/api/extensions/mention.md @@ -1,2 +1,2 @@ # Mention -Enables you to use mentions in the editor. \ No newline at end of file +Enables you to use mentions in the editor. diff --git a/docs/src/docPages/api/extensions/ordered-list.md b/docs/src/docPages/api/extensions/ordered-list.md index f53326fd..0d0cb59d 100644 --- a/docs/src/docPages/api/extensions/ordered-list.md +++ b/docs/src/docPages/api/extensions/ordered-list.md @@ -5,6 +5,15 @@ Enables you to use the `
      ` HTML tag in the editor. This extensions is intended to be used with the `ListItem` extension. ::: +## Installation +```bash +# With npm +npm install @tiptap/extension-ordered-list + +# Or: With Yarn +yarn add @tiptap/extension-ordered-list +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/paragraph.md b/docs/src/docPages/api/extensions/paragraph.md index 3ab58b99..479bd940 100644 --- a/docs/src/docPages/api/extensions/paragraph.md +++ b/docs/src/docPages/api/extensions/paragraph.md @@ -1,6 +1,15 @@ # Paragraph Yes, the schema is very strict. Without this extension you won’t even be able to use paragraphs in the editor. +## Installation +```bash +# With npm +npm install @tiptap/extension-paragraph + +# Or: With Yarn +yarn add @tiptap/extension-paragraph +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/strike.md b/docs/src/docPages/api/extensions/strike.md index 9da05886..2db6b9a5 100644 --- a/docs/src/docPages/api/extensions/strike.md +++ b/docs/src/docPages/api/extensions/strike.md @@ -7,6 +7,15 @@ Type `~text between tildes~` and it will be magically ~~striked through~~ while The extension will generate the corresponding `` HTML tags when reading contents of the `Editor` instance. All text striked through, regardless of the method will be normalized to `` HTML tags. ::: +## Installation +```bash +# With npm +npm install @tiptap/extension-strike + +# Or: With Yarn +yarn add @tiptap/extension-strike +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/api/extensions/text.md b/docs/src/docPages/api/extensions/text.md index 53a67f0e..b6165074 100644 --- a/docs/src/docPages/api/extensions/text.md +++ b/docs/src/docPages/api/extensions/text.md @@ -5,6 +5,15 @@ Tiptap 1 tried to hide that node from you, but it has always been there. ::: +## Installation +```bash +# With npm +npm install @tiptap/extension-text + +# Or: With Yarn +yarn add @tiptap/extension-text +``` + ## Source code [packages/extension-text/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text/) diff --git a/docs/src/docPages/api/extensions/underline.md b/docs/src/docPages/api/extensions/underline.md index 0aa359b9..6913e46e 100644 --- a/docs/src/docPages/api/extensions/underline.md +++ b/docs/src/docPages/api/extensions/underline.md @@ -5,6 +5,15 @@ Use this extension to render text underlined. If you pass `` tags, or The extension will generate the corresponding `` HTML tags when reading contents of the `Editor` instance. All text marked underlined, regardless of the method will be normalized to `` HTML tags. ::: +## Installation +```bash +# With npm +npm install @tiptap/extension-underline + +# Or: With Yarn +yarn add @tiptap/extension-underline +``` + ## Options | Option | Type | Default | Description | | ------ | ------ | ------- | -------------------------------------------- | diff --git a/docs/src/docPages/overview/upgrade-guide.md b/docs/src/docPages/overview/upgrade-guide.md index 92690df9..d8f4b54e 100644 --- a/docs/src/docPages/overview/upgrade-guide.md +++ b/docs/src/docPages/overview/upgrade-guide.md @@ -13,7 +13,6 @@ Yes, it’s tedious work to upgrade your favorite text editor to a new API, but The new API will look pretty familiar too you, but there are a ton of changes though. To make the upgrade a little bit easier, here is everything you need to know: ### 1. Explicitly register the Document, Text and Paragraph extensions - Tiptap 1 tried to hide a few required extensions from you with the default setting `useBuiltInExtensions: true`. That setting has been removed and you’re required to import all extensions. Be sure to explicitly import at least the [Document](/api/extensions/document), [Paragraph](/api/extensions/paragraph) and [Text](/api/extensions/text) extensions. ```js @@ -31,8 +30,6 @@ new Editor({ }) ``` - - ### 2. New document type **We renamed the default `Document` type from `doc` to `document`.** To keep it like that, use your own implementation of the `Document` node or migrate the stored JSON to use the new name. @@ -81,13 +78,11 @@ const CustomExtension = new Node() Don’t forget to call `create()` in the end! Read more about [all the nifty details building custom extensions](/guide/custom-extensions) in our guide. ### 4. Blockquotes must not be nested anymore - :::warning Breaking Change Currently, blockquotes must not be nested anymore. That said, we’re working on bringing it back. If you use nested blockquotes in your app, don’t upgrade yet. ::: ### 5. Renamed API methods - [We renamed a lot of commands](/api/commands), hopefully you can migrate to the new API with search & replace. Here is a list of what changed: | Old method name | New method name | @@ -96,7 +91,6 @@ Currently, blockquotes must not be nested anymore. That said, we’re working on | ~~`getJSON`~~ | `json` | ### 6. .focus() isn’t called on every command anymore - We tried to hide the `.focus()` command from you with tiptap 1 and executed that on every other command. That led to issues in specific use cases, where you want to run a command, but don’t want to focus the editor. With tiptap 2.x you have to explicitly call the `focus()` and you probably want to do that in a lot of places. Here is an example: ```js