docs: move content example to the guide
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
context('/examples/export-html-or-json', () => {
|
||||
context('/guide/store-content', () => {
|
||||
before(() => {
|
||||
cy.visit('/examples/export-html-or-json')
|
||||
cy.visit('/guide/store-content')
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -1,3 +0,0 @@
|
||||
# Export HTML or JSON
|
||||
|
||||
<demo name="Examples/ExportHtmlOrJson" highlight="52-60"/>
|
||||
@@ -3,9 +3,10 @@
|
||||
## toc
|
||||
|
||||
## Introduction
|
||||
You can store your content as a JSON object or as a good old HTML string. Both work fine. And of course, you can pass both formats to the editor to restore your content.
|
||||
You can store your content as a JSON object or as a good old HTML string. Both work fine. And of course, you can pass both formats to the editor to restore your content. Here is an interactive example, that exports the content as HTML and JSON when the document is changed:
|
||||
|
||||
You can store your content as JSON and restore the content from HTML, or the other way around. I don’t know why you would do that, but tiptap wouldn’t care.
|
||||
## Example
|
||||
<demo name="Guide/StoreContent" highlight="52-60"/>
|
||||
|
||||
## Option 1: JSON
|
||||
JSON is probably easier to loop through, for example to look for a mention and it’s more like what tiptap uses under the hood. Anyway, if you want to use JSON to store the content we provide a method to retrieve the content as JSON:
|
||||
|
||||
Reference in New Issue
Block a user