diff --git a/docs/src/demos/Examples/Minimal/React/index.jsx b/docs/src/demos/Examples/Minimal/React/index.jsx new file mode 100644 index 00000000..309c7b31 --- /dev/null +++ b/docs/src/demos/Examples/Minimal/React/index.jsx @@ -0,0 +1,28 @@ +import React from 'react' +import { useEditor, EditorContent } from '@tiptap/react' +import Document from '@tiptap/extension-document' +import Paragraph from '@tiptap/extension-paragraph' +import Text from '@tiptap/extension-text' +import './styles.scss' + +export default () => { + const editor = useEditor({ + extensions: [ + Document, + Paragraph, + Text, + ], + content: ` +

+ This is a radically reduced version of tiptap. It has support for a document, with paragraphs and text. That’s it. It’s probably too much for real minimalists though. +

+

+ The paragraph extension is not really required, but you need at least one node. Sure, that node can be something different. +

+ `, + }) + + return ( + + ) +} diff --git a/docs/src/demos/Examples/Minimal/React/styles.scss b/docs/src/demos/Examples/Minimal/React/styles.scss new file mode 100644 index 00000000..46b51a4e --- /dev/null +++ b/docs/src/demos/Examples/Minimal/React/styles.scss @@ -0,0 +1,6 @@ +/* Basic editor styles */ +.ProseMirror { + > * + * { + margin-top: 0.75em; + } +} diff --git a/docs/src/demos/Examples/Minimal/Vue/index.spec.js b/docs/src/demos/Examples/Minimal/Vue/index.spec.js new file mode 100644 index 00000000..30dc194a --- /dev/null +++ b/docs/src/demos/Examples/Minimal/Vue/index.spec.js @@ -0,0 +1,7 @@ +context('/demos/Examples/Minimal/Vue', () => { + before(() => { + cy.visit('/demos/Examples/Minimal/Vue') + }) + + // TODO: Write tests +}) diff --git a/docs/src/demos/Examples/Minimal/index.vue b/docs/src/demos/Examples/Minimal/Vue/index.vue similarity index 100% rename from docs/src/demos/Examples/Minimal/index.vue rename to docs/src/demos/Examples/Minimal/Vue/index.vue diff --git a/docs/src/demos/Examples/Minimal/index.spec.js b/docs/src/demos/Examples/Minimal/index.spec.js deleted file mode 100644 index 1de9bce0..00000000 --- a/docs/src/demos/Examples/Minimal/index.spec.js +++ /dev/null @@ -1,7 +0,0 @@ -context('/demos/Examples/Minimal', () => { - before(() => { - cy.visit('/demos/Examples/Minimal') - }) - - // TODO: Write tests -}) diff --git a/docs/src/docPages/examples/minimal.md b/docs/src/docPages/examples/minimal.md index 00feb801..f7578e57 100644 --- a/docs/src/docPages/examples/minimal.md +++ b/docs/src/docPages/examples/minimal.md @@ -1,3 +1,6 @@ # Minimal setup - +