docs: rename all the things

This commit is contained in:
Hans Pagel 2021-01-26 00:57:47 +01:00
parent 4c34bfd8d2
commit f2a39743e1
12 changed files with 34 additions and 15 deletions

View File

@ -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(() => {

View File

@ -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(() => {

View File

@ -0,0 +1,7 @@
context('/demos/Guide/Content/GenerateHTML', () => {
before(() => {
cy.visit('/demos/Guide/Content/GenerateHTML')
})
// TODO: Write tests
})

View File

@ -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', () => {

View File

@ -0,0 +1,8 @@
# HTML
TODO
## Source code
[packages/html/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/html/)
## Usage
<demo name="Guide/Content/GenerateHTML" highlight="6,43-48"/>

View File

@ -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:
<demo name="Guide/StoreContent/ExportJSON" :show-source="false"/>
<demo name="Guide/Content/ExportJSON" :show-source="false"/>
### Option 2: HTML
HTML can be easily rendered in other places, for example in emails and its wildly used, so its 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(`<p>Example Text</p>`)
Use this interactive example to fiddle around:
<demo name="Guide/StoreContent/ExportHTML" :show-source="false"/>
<demo name="Guide/Content/ExportHTML" :show-source="false"/>
### Not an option: Markdown
Unfortunately, **tiptap doesnt 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. Thats how you can achieve the exact same rendering as its in the editor, without duplicating your CSS and other code.
<demo name="Guide/StoreContent/ReadOnly" highlight="3-6,22,28,41-47" />
<demo name="Guide/Content/ReadOnly" highlight="3-6,22,28,41-47" />
### 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, youll probably want to do just that without an actual editor instance.
@ -112,7 +112,7 @@ Thats what the `generateHTML()` is for. Its a helper function which render
Import a lightweight implementation of `generateHTML()` from `@tiptap/core` if youre using the function in a browser context only.
:::
<demo name="Api/Schema/GenerateHTML" highlight="6,43-48"/>
<demo name="Guide/Content/GenerateHTML" highlight="6,43-48"/>
## Migration
If youre migrating existing content to tiptap we would recommend to get your existing output to HTML. Thats 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 arent allowed (based on your configuration), tiptap just throws them away quietly.

View File

@ -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 isnt 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:

View File

@ -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