From f2a39743e1966dda30d8c8aec0dfe25bb1e0fc85 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 26 Jan 2021 00:57:47 +0100 Subject: [PATCH] docs: rename all the things --- .../{StoreContent => Content}/ExportHTML/index.spec.js | 4 ++-- .../{StoreContent => Content}/ExportHTML/index.vue | 0 .../{StoreContent => Content}/ExportJSON/index.spec.js | 4 ++-- .../{StoreContent => Content}/ExportJSON/index.vue | 0 .../src/demos/Guide/Content/GenerateHTML/index.spec.js | 7 +++++++ .../Schema => Guide/Content}/GenerateHTML/index.vue | 0 .../{StoreContent => Content}/ReadOnly/index.spec.js | 4 ++-- .../Guide/{StoreContent => Content}/ReadOnly/index.vue | 0 docs/src/docPages/api/utilities/html.md | 8 ++++++++ .../docPages/guide/{store-content.md => content.md} | 10 +++++----- docs/src/docPages/guide/extend-extensions.md | 2 +- docs/src/links.yaml | 10 +++++++--- 12 files changed, 34 insertions(+), 15 deletions(-) rename docs/src/demos/Guide/{StoreContent => Content}/ExportHTML/index.spec.js (76%) rename docs/src/demos/Guide/{StoreContent => Content}/ExportHTML/index.vue (100%) rename docs/src/demos/Guide/{StoreContent => Content}/ExportJSON/index.spec.js (84%) rename docs/src/demos/Guide/{StoreContent => Content}/ExportJSON/index.vue (100%) create mode 100644 docs/src/demos/Guide/Content/GenerateHTML/index.spec.js rename docs/src/demos/{Api/Schema => Guide/Content}/GenerateHTML/index.vue (100%) rename docs/src/demos/Guide/{StoreContent => Content}/ReadOnly/index.spec.js (83%) rename docs/src/demos/Guide/{StoreContent => Content}/ReadOnly/index.vue (100%) create mode 100644 docs/src/docPages/api/utilities/html.md rename docs/src/docPages/guide/{store-content.md => content.md} (94%) diff --git a/docs/src/demos/Guide/StoreContent/ExportHTML/index.spec.js b/docs/src/demos/Guide/Content/ExportHTML/index.spec.js similarity index 76% rename from docs/src/demos/Guide/StoreContent/ExportHTML/index.spec.js rename to docs/src/demos/Guide/Content/ExportHTML/index.spec.js index 5236faca..755542f6 100644 --- a/docs/src/demos/Guide/StoreContent/ExportHTML/index.spec.js +++ b/docs/src/demos/Guide/Content/ExportHTML/index.spec.js @@ -1,6 +1,6 @@ -context('/demos/Guide/StoreContent/ExportHTML', () => { +context('/demos/Guide/Content/ExportHTML', () => { before(() => { - cy.visit('/demos/Guide/StoreContent/ExportHTML') + cy.visit('/demos/Guide/Content/ExportHTML') }) beforeEach(() => { diff --git a/docs/src/demos/Guide/StoreContent/ExportHTML/index.vue b/docs/src/demos/Guide/Content/ExportHTML/index.vue similarity index 100% rename from docs/src/demos/Guide/StoreContent/ExportHTML/index.vue rename to docs/src/demos/Guide/Content/ExportHTML/index.vue diff --git a/docs/src/demos/Guide/StoreContent/ExportJSON/index.spec.js b/docs/src/demos/Guide/Content/ExportJSON/index.spec.js similarity index 84% rename from docs/src/demos/Guide/StoreContent/ExportJSON/index.spec.js rename to docs/src/demos/Guide/Content/ExportJSON/index.spec.js index a47badbf..5c75fe73 100644 --- a/docs/src/demos/Guide/StoreContent/ExportJSON/index.spec.js +++ b/docs/src/demos/Guide/Content/ExportJSON/index.spec.js @@ -1,6 +1,6 @@ -context('/demos/Guide/StoreContent/ExportJSON', () => { +context('/demos/Guide/Content/ExportJSON', () => { before(() => { - cy.visit('/demos/Guide/StoreContent/ExportJSON') + cy.visit('/demos/Guide/Content/ExportJSON') }) beforeEach(() => { diff --git a/docs/src/demos/Guide/StoreContent/ExportJSON/index.vue b/docs/src/demos/Guide/Content/ExportJSON/index.vue similarity index 100% rename from docs/src/demos/Guide/StoreContent/ExportJSON/index.vue rename to docs/src/demos/Guide/Content/ExportJSON/index.vue diff --git a/docs/src/demos/Guide/Content/GenerateHTML/index.spec.js b/docs/src/demos/Guide/Content/GenerateHTML/index.spec.js new file mode 100644 index 00000000..efcc0d8b --- /dev/null +++ b/docs/src/demos/Guide/Content/GenerateHTML/index.spec.js @@ -0,0 +1,7 @@ +context('/demos/Guide/Content/GenerateHTML', () => { + before(() => { + cy.visit('/demos/Guide/Content/GenerateHTML') + }) + + // TODO: Write tests +}) diff --git a/docs/src/demos/Api/Schema/GenerateHTML/index.vue b/docs/src/demos/Guide/Content/GenerateHTML/index.vue similarity index 100% rename from docs/src/demos/Api/Schema/GenerateHTML/index.vue rename to docs/src/demos/Guide/Content/GenerateHTML/index.vue diff --git a/docs/src/demos/Guide/StoreContent/ReadOnly/index.spec.js b/docs/src/demos/Guide/Content/ReadOnly/index.spec.js similarity index 83% rename from docs/src/demos/Guide/StoreContent/ReadOnly/index.spec.js rename to docs/src/demos/Guide/Content/ReadOnly/index.spec.js index 32a2847e..b6b74b49 100644 --- a/docs/src/demos/Guide/StoreContent/ReadOnly/index.spec.js +++ b/docs/src/demos/Guide/Content/ReadOnly/index.spec.js @@ -1,6 +1,6 @@ -context('/demos/Guide/StoreContent/ReadOnly', () => { +context('/demos/Guide/Content/ReadOnly', () => { beforeEach(() => { - cy.visit('/demos/Guide/StoreContent/ReadOnly') + cy.visit('/demos/Guide/Content/ReadOnly') }) it.skip('should be read-only', () => { diff --git a/docs/src/demos/Guide/StoreContent/ReadOnly/index.vue b/docs/src/demos/Guide/Content/ReadOnly/index.vue similarity index 100% rename from docs/src/demos/Guide/StoreContent/ReadOnly/index.vue rename to docs/src/demos/Guide/Content/ReadOnly/index.vue diff --git a/docs/src/docPages/api/utilities/html.md b/docs/src/docPages/api/utilities/html.md new file mode 100644 index 00000000..b869a4c2 --- /dev/null +++ b/docs/src/docPages/api/utilities/html.md @@ -0,0 +1,8 @@ +# HTML +TODO + +## Source code +[packages/html/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/html/) + +## Usage + diff --git a/docs/src/docPages/guide/store-content.md b/docs/src/docPages/guide/content.md similarity index 94% rename from docs/src/docPages/guide/store-content.md rename to docs/src/docPages/guide/content.md index cb8805fb..865aa55f 100644 --- a/docs/src/docPages/guide/store-content.md +++ b/docs/src/docPages/guide/content.md @@ -1,4 +1,4 @@ -# Store content +# Export content ## toc @@ -40,7 +40,7 @@ editor.setContent({ Here is an interactive example where you can see that in action: - + ### Option 2: HTML HTML can be easily rendered in other places, for example in emails and it’s wildly used, so it’s probably easier to switch the editor at some point. Anyway, every editor instance provides a method to get HTML from the current document: @@ -64,7 +64,7 @@ editor.commands.setContent(`

Example Text

`) Use this interactive example to fiddle around: - + ### Not an option: Markdown Unfortunately, **tiptap doesn’t support Markdown as an input or output format**. We considered to add support for it, but those are the reasons why we decided to not do it: @@ -101,7 +101,7 @@ const editor = new Editor({ ### Option 1: Read-only instance of tiptap To render the saved content, set the editor to read-only. That’s how you can achieve the exact same rendering as it’s in the editor, without duplicating your CSS and other code. - + ### Option 2: Generate HTML from ProseMirror JSON If you need to render the content on the server side, for example to generate the HTML for a blog post which has been written in tiptap, you’ll probably want to do just that without an actual editor instance. @@ -112,7 +112,7 @@ That’s what the `generateHTML()` is for. It’s a helper function which render Import a lightweight implementation of `generateHTML()` from `@tiptap/core` if you’re using the function in a browser context only. ::: - + ## Migration If you’re migrating existing content to tiptap we would recommend to get your existing output to HTML. That’s probably the best format to get your initial content into tiptap, because ProseMirror ensures there is nothing wrong with it. Even if there are some tags or attributes that aren’t allowed (based on your configuration), tiptap just throws them away quietly. diff --git a/docs/src/docPages/guide/extend-extensions.md b/docs/src/docPages/guide/extend-extensions.md index ba2e76b4..12dae775 100644 --- a/docs/src/docPages/guide/extend-extensions.md +++ b/docs/src/docPages/guide/extend-extensions.md @@ -37,7 +37,7 @@ The same applies to every aspect of an existing extension, except to the name. L ### Name The extension name is used in a whole lot of places and changing it isn’t too easy. If you want to change the name of an existing extension, we would recommended to copy the whole extension and change the name in all occurrences. -The extension name is also part of the JSON. If you [store your content as JSON](/guide/store-content#option-1-json), you need to change the name there too. +The extension name is also part of the JSON. If you [store your content as JSON](/guide/content#option-1-json), you need to change the name there too. ### Settings All settings can be configured through the extension anyway, but if you want to change the default settings, for example to provide a library on top of tiptap for other developers, you can do it like that: diff --git a/docs/src/links.yaml b/docs/src/links.yaml index 0bd66b10..809dce3d 100644 --- a/docs/src/links.yaml +++ b/docs/src/links.yaml @@ -83,8 +83,8 @@ - title: Accessibility link: /guide/accessibility type: draft - - title: Store content - link: /guide/store-content + - title: Export content + link: /guide/content - title: Collaborative editing link: /guide/collaborative-editing type: pro @@ -208,10 +208,14 @@ link: /api/extensions/typography - title: Utilities link: /api/utilities - redirect: /api/utilities/suggestion + redirect: /api/utilities/html items: + - title: HTML + link: /api/utilities/html + type: draft - title: Suggestion link: /api/utilities/suggestion + type: new - title: Events link: /api/events - title: Schema