From 48b54d1186abe272583d72207ab07586daa5422e Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Fri, 29 Jan 2021 21:52:34 +0100 Subject: [PATCH 1/6] docs: update the installation page --- docs/src/docPages/overview/installation.md | 92 ++++++---------------- 1 file changed, 26 insertions(+), 66 deletions(-) diff --git a/docs/src/docPages/overview/installation.md b/docs/src/docPages/overview/installation.md index a6d24ad9..93868f52 100644 --- a/docs/src/docPages/overview/installation.md +++ b/docs/src/docPages/overview/installation.md @@ -3,10 +3,20 @@ ## toc ## Introduction -You’re free to use tiptap with the framework of your choice. Depending on what you want to do, there are a few different ways to install tiptap in your project. Choose the way that fits your workflow. +Depending on how your development setup looks like, there are a few different ways to install tiptap. We have put together integration guides for a few popular frameworks to get you started quickly. You can even use it without any front-end framework. Choose the way that fits your workflow and start building cool things! -## Option 1: Vanilla JavaScript -Use tiptap with vanilla JavaScript for a very lightweight and raw experience. If you feel like it, you can even use it to connect tiptap with other frameworks not mentioned here. +## Integration guides +* [Vue.js](/guide/getting-started/vue-cli) +* [Nuxt.js](/guide/getting-started/nuxtjs) +* [React](/guide/getting-started/react) (Draft) +* [Svelte](/guide/getting-started/svelte) (Draft) +* [Alpine.js](/guide/getting-started/alpinejs) (Draft) +* [Livewire](/guide/getting-started/livewire) (Draft) + +Don’t see your framework here? That shouldn’t stop you from installing tiptap. Just use the Vanilla JavaScript version, that should work fine, too. + +## Vanilla JavaScript +Use tiptap with vanilla JavaScript for a very lightweight and raw experience. If you feel like it, you can use that version to connect tiptap with other frameworks not mentioned here, too. ```bash # with npm @@ -16,7 +26,7 @@ npm install @tiptap/core @tiptap/starter-kit yarn add @tiptap/core @tiptap/starter-kit ``` -Great, that should be enough to start. Here is the most essential code you need to get a running instance of tiptap: +Great, that’s all you need for now. Here is the boilerplate code to start your first tiptap instance: ```js import { Editor } from '@tiptap/core' @@ -29,45 +39,8 @@ new Editor({ }) ``` -## Option 2: Vue.js -To use tiptap with Vue.js (and tools that are based on Vue.js) install tiptap together with the Vue.js adapter in your project. We even prepared a Vue.js starter kit, which gives you a good headstart. - -```bash -# with npm -npm install @tiptap/core @tiptap/vue @tiptap/vue-starter-kit - -# with Yarn -yarn add @tiptap/core @tiptap/vue @tiptap/vue-starter-kit -``` - -Create a new component and add the following content to get a basic version of tiptap: - - - -### Nuxt.js -Note that tiptap needs to run in the client, not on the server. It’s required to wrap the editor in a `` tag. - -[Read more](https://nuxtjs.org/api/components-client-only) - -## Option 3: CodeSandbox -CodeSandbox is an online coding environment. It’s great to fiddle around without setting up a local project and to share your code with others. - - - -It’s also amazing for bug reports. Try to recreate a bug there and share it with us before when you [file an issue on GitHub](https://github.com/ueberdosis/tiptap-next/issues/new/choose). That helps us to reproduce the bug quickly, and fix them faster. - - -## Option 4: CDN (Draft) -To pull in tiptap for quick demos or just giving it a spin, grab the latest build via CDN. We use two different provides: - -### Skypack (ES Modules) -Skypack enables you to use ES modules, which should be supported in all modern browsers. The packages are smaller, that’s great, too. So here is how to use it: +## CDN +For testing purposes or demos, use our [Skypack](https://www.skypack.dev/) CDN builds. Here are the few lines of code you need to get started: ```html @@ -89,27 +62,14 @@ Skypack enables you to use ES modules, which should be supported in all modern b ``` -### ~~Unpkg (UMD, deprecated)~~ -We also have an UMD build on unpkg. Those UMD builds are larger, but should work even in older browsers. As tiptap doesn’t work in older browsers anyway, we tend to remove those builds. What do you think? Anyway, here‘s how you can use it: +## CodeSandbox +CodeSandbox is an online coding environment. It’s great to fiddle around without setting up a local project and to share your code with others. -```html - - - - - - - -
- - - -``` + + +It’s also amazing for bug reports. Try to recreate a bug there and share it with us before you [file an issue on GitHub](https://github.com/ueberdosis/tiptap-next/issues/new/choose). That helps us to reproduce the bug easily, and release a fix faster. From 435e9a6049c1c2983680605ed8914d2a4ff57f4a Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Fri, 29 Jan 2021 22:05:47 +0100 Subject: [PATCH 2/6] docs: update the integration guides --- .../guide/getting-started/alpinejs.md | 3 ++ .../guide/getting-started/intertiajs.md | 5 ++++ .../guide/getting-started/livewire.md | 3 ++ .../docPages/guide/getting-started/nextjs.md | 3 ++ .../docPages/guide/getting-started/nuxtjs.md | 2 +- .../docPages/guide/getting-started/react.md | 3 ++ .../docPages/guide/getting-started/svelte.md | 8 +++++- .../getting-started/{vue-cli.md => vuejs.md} | 28 +++++-------------- docs/src/links.yaml | 6 ++-- 9 files changed, 35 insertions(+), 26 deletions(-) rename docs/src/docPages/guide/getting-started/{vue-cli.md => vuejs.md} (79%) diff --git a/docs/src/docPages/guide/getting-started/alpinejs.md b/docs/src/docPages/guide/getting-started/alpinejs.md index 5a73adf2..74de0b44 100644 --- a/docs/src/docPages/guide/getting-started/alpinejs.md +++ b/docs/src/docPages/guide/getting-started/alpinejs.md @@ -2,6 +2,9 @@ ## toc +## Introduction +The following guide describes how to integrate tiptap with your [Alpine.js](https://github.com/alpinejs/alpine) project. + TODO https://codesandbox.io/s/alpine-tiptap-2ro5e?file=/index.html:0-1419 diff --git a/docs/src/docPages/guide/getting-started/intertiajs.md b/docs/src/docPages/guide/getting-started/intertiajs.md index 1b1a7cd7..d4f05a50 100644 --- a/docs/src/docPages/guide/getting-started/intertiajs.md +++ b/docs/src/docPages/guide/getting-started/intertiajs.md @@ -2,6 +2,11 @@ ## toc +## Introduction +The following guide describes how to integrate tiptap with your [Inertia.js](https://inertiajs.com/) project. + +## toc + TODO ## Introduction diff --git a/docs/src/docPages/guide/getting-started/livewire.md b/docs/src/docPages/guide/getting-started/livewire.md index 4085a9a8..bba3daef 100644 --- a/docs/src/docPages/guide/getting-started/livewire.md +++ b/docs/src/docPages/guide/getting-started/livewire.md @@ -2,6 +2,9 @@ ## toc +## Introduction +The following guide describes how to integrate tiptap with your [Livewire](https://laravel-livewire.com/) project. + TODO editor.blade.php diff --git a/docs/src/docPages/guide/getting-started/nextjs.md b/docs/src/docPages/guide/getting-started/nextjs.md index db54da0d..10ad2d60 100644 --- a/docs/src/docPages/guide/getting-started/nextjs.md +++ b/docs/src/docPages/guide/getting-started/nextjs.md @@ -2,6 +2,9 @@ ## toc +## Introduction +The following guide describes how to integrate tiptap with your [Next.js](https://nextjs.org/) project. + TODO diff --git a/docs/src/docPages/guide/getting-started/nuxtjs.md b/docs/src/docPages/guide/getting-started/nuxtjs.md index 2d31d488..6893d922 100644 --- a/docs/src/docPages/guide/getting-started/nuxtjs.md +++ b/docs/src/docPages/guide/getting-started/nuxtjs.md @@ -3,7 +3,7 @@ ## toc ## Introduction -The following guide describes how to integrate tiptap with your Nuxt.js project. +The following guide describes how to integrate tiptap with your [Nuxt.js](https://nuxtjs.org/) project. ## Requirements * [Node](https://nodejs.org/en/download/) installed on your machine diff --git a/docs/src/docPages/guide/getting-started/react.md b/docs/src/docPages/guide/getting-started/react.md index 26366565..b7d6acfc 100644 --- a/docs/src/docPages/guide/getting-started/react.md +++ b/docs/src/docPages/guide/getting-started/react.md @@ -2,6 +2,9 @@ ## toc +## Introduction +The following guide describes how to integrate tiptap with your [React](https://reactjs.org/) project. + TODO diff --git a/docs/src/docPages/guide/getting-started/svelte.md b/docs/src/docPages/guide/getting-started/svelte.md index 3e991fd7..d7dcafcc 100644 --- a/docs/src/docPages/guide/getting-started/svelte.md +++ b/docs/src/docPages/guide/getting-started/svelte.md @@ -1,5 +1,10 @@ # Svelte +## toc + +## Introduction +The following guide describes how to integrate tiptap with your Svelte project. + TODO Svelte REPL: https://svelte.dev/repl/c839da77db2444e5b23a752266613639?version=3.31.2 @@ -15,7 +20,7 @@ App.svelte Editor.svelte ```html - ``` -## 5. Add it to your app +## 4. Add it to your app Now, let’s replace the content of `src/App.vue` with the following example code to use our new `Tiptap` component in our app. ```html @@ -112,7 +98,7 @@ export default { You should now see tiptap in your browser. You’ve successfully set up tiptap! Time to give yourself a pat on the back. Let’s start to configure your editor in the next step. -## 6. Use v-model (optional) +## 5. Use v-model (optional) You’re probably used to bind your data with `v-model` in forms, that’s also possible with tiptap. Here is a working example component, that you can integrate in your project: diff --git a/docs/src/links.yaml b/docs/src/links.yaml index 0c547d71..8688b4ac 100644 --- a/docs/src/links.yaml +++ b/docs/src/links.yaml @@ -6,11 +6,11 @@ link: /overview/installation - title: Upgrade Guide link: /overview/upgrade-guide - - title: Contributing - link: /overview/contributing - title: Become a sponsor link: /sponsor type: sponsor + - title: Contributing + link: /overview/contributing - title: Examples link: /examples @@ -50,7 +50,7 @@ link: /guide/getting-started items: - title: Vue.js 2 - link: /guide/getting-started/vue-cli + link: /guide/getting-started/vuejs skip: true - title: Nuxt.js link: /guide/getting-started/nuxtjs From 5b81deeeeb3af2ac527501ce256531da713950f5 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 2 Feb 2021 13:49:53 +0100 Subject: [PATCH 3/6] docs: update all getting started links, fix #131 --- docs/src/docPages/guide/getting-started.md | 6 +++--- .../guide/getting-started/{alpinejs.md => alpine.md} | 0 .../getting-started/{intertiajs.md => intertia.md} | 0 .../guide/getting-started/{nextjs.md => next.md} | 0 .../guide/getting-started/{nuxtjs.md => nuxt.md} | 0 .../guide/getting-started/{vuejs.md => vue.md} | 2 +- docs/src/docPages/overview/installation.md | 6 +++--- docs/src/links.yaml | 10 +++++----- 8 files changed, 12 insertions(+), 12 deletions(-) rename docs/src/docPages/guide/getting-started/{alpinejs.md => alpine.md} (100%) rename docs/src/docPages/guide/getting-started/{intertiajs.md => intertia.md} (100%) rename docs/src/docPages/guide/getting-started/{nextjs.md => next.md} (100%) rename docs/src/docPages/guide/getting-started/{nuxtjs.md => nuxt.md} (100%) rename docs/src/docPages/guide/getting-started/{vuejs.md => vue.md} (99%) diff --git a/docs/src/docPages/guide/getting-started.md b/docs/src/docPages/guide/getting-started.md index 1fb1573b..f2a9188c 100644 --- a/docs/src/docPages/guide/getting-started.md +++ b/docs/src/docPages/guide/getting-started.md @@ -6,11 +6,11 @@ tiptap 2 is framework-agnostic and even works with plain JavaScript, if that’s your thing. We’re working on guides for all the different frameworks and workflows, but here is the general one. The following steps should help you to integrate tiptap in your JavaScript project. ## Alternative Guides -* [Vue CLI](/guide/getting-started/vue-cli) -* [Nuxt.js](/guide/getting-started/nuxtjs) +* [Vue CLI](/guide/getting-started/vue) +* [Nuxt.js](/guide/getting-started/nuxt) * [React](/guide/getting-started/react) (Draft) * [Svelte](/guide/getting-started/svelte) (Draft) -* [Alpine.js](/guide/getting-started/alpinejs) (Draft) +* [Alpine.js](/guide/getting-started/alpine) (Draft) * [Livewire](/guide/getting-started/livewire) (Draft) ## Requirements diff --git a/docs/src/docPages/guide/getting-started/alpinejs.md b/docs/src/docPages/guide/getting-started/alpine.md similarity index 100% rename from docs/src/docPages/guide/getting-started/alpinejs.md rename to docs/src/docPages/guide/getting-started/alpine.md diff --git a/docs/src/docPages/guide/getting-started/intertiajs.md b/docs/src/docPages/guide/getting-started/intertia.md similarity index 100% rename from docs/src/docPages/guide/getting-started/intertiajs.md rename to docs/src/docPages/guide/getting-started/intertia.md diff --git a/docs/src/docPages/guide/getting-started/nextjs.md b/docs/src/docPages/guide/getting-started/next.md similarity index 100% rename from docs/src/docPages/guide/getting-started/nextjs.md rename to docs/src/docPages/guide/getting-started/next.md diff --git a/docs/src/docPages/guide/getting-started/nuxtjs.md b/docs/src/docPages/guide/getting-started/nuxt.md similarity index 100% rename from docs/src/docPages/guide/getting-started/nuxtjs.md rename to docs/src/docPages/guide/getting-started/nuxt.md diff --git a/docs/src/docPages/guide/getting-started/vuejs.md b/docs/src/docPages/guide/getting-started/vue.md similarity index 99% rename from docs/src/docPages/guide/getting-started/vuejs.md rename to docs/src/docPages/guide/getting-started/vue.md index 3dfda933..237b4f80 100644 --- a/docs/src/docPages/guide/getting-started/vuejs.md +++ b/docs/src/docPages/guide/getting-started/vue.md @@ -1,4 +1,4 @@ -# Vue CLI +# Vue.js ## toc diff --git a/docs/src/docPages/overview/installation.md b/docs/src/docPages/overview/installation.md index 93868f52..fd34c7c5 100644 --- a/docs/src/docPages/overview/installation.md +++ b/docs/src/docPages/overview/installation.md @@ -6,11 +6,11 @@ Depending on how your development setup looks like, there are a few different ways to install tiptap. We have put together integration guides for a few popular frameworks to get you started quickly. You can even use it without any front-end framework. Choose the way that fits your workflow and start building cool things! ## Integration guides -* [Vue.js](/guide/getting-started/vue-cli) -* [Nuxt.js](/guide/getting-started/nuxtjs) +* [Vue.js](/guide/getting-started/vue) +* [Nuxt.js](/guide/getting-started/nuxt) * [React](/guide/getting-started/react) (Draft) * [Svelte](/guide/getting-started/svelte) (Draft) -* [Alpine.js](/guide/getting-started/alpinejs) (Draft) +* [Alpine.js](/guide/getting-started/alpine) (Draft) * [Livewire](/guide/getting-started/livewire) (Draft) Don’t see your framework here? That shouldn’t stop you from installing tiptap. Just use the Vanilla JavaScript version, that should work fine, too. diff --git a/docs/src/links.yaml b/docs/src/links.yaml index 8688b4ac..a4bf733c 100644 --- a/docs/src/links.yaml +++ b/docs/src/links.yaml @@ -50,13 +50,13 @@ link: /guide/getting-started items: - title: Vue.js 2 - link: /guide/getting-started/vuejs + link: /guide/getting-started/vue skip: true - title: Nuxt.js - link: /guide/getting-started/nuxtjs + link: /guide/getting-started/nuxt skip: true - title: Inertia.js - link: /guide/getting-started/intertiajs + link: /guide/getting-started/intertia type: draft skip: true - title: React @@ -64,7 +64,7 @@ type: draft skip: true - title: Next.js - link: /guide/getting-started/nextjs + link: /guide/getting-started/next type: draft skip: true - title: Svelte @@ -72,7 +72,7 @@ type: draft skip: true - title: Alpine.js - link: /guide/getting-started/alpinejs + link: /guide/getting-started/alpine type: draft skip: true - title: Livewire From 22ed56769cce7741f72abce0bba0eef4d2cbdfd9 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 2 Feb 2021 14:08:45 +0100 Subject: [PATCH 4/6] docs: update content --- docs/src/docPages/api/schema.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/src/docPages/api/schema.md b/docs/src/docPages/api/schema.md index 1e0a26df..ce0f80e7 100644 --- a/docs/src/docPages/api/schema.md +++ b/docs/src/docPages/api/schema.md @@ -145,6 +145,17 @@ Node.create({ }) ``` +For some cases where you want features that aren’t available in marks, for example a node view, try if an inline node would work: + +```js +Node.create({ + name: 'customInlineNode', + group: 'inline', + inline: true, + content: 'text*', +}) +``` + #### Atom Nodes with `atom: true` aren’t directly editable and should be treated as a single unit. It’s not so likely to use that in a editor context, but this is how it would look like: From a9708f65354485b16adcbe46749e975aa9011204 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 2 Feb 2021 14:48:58 +0100 Subject: [PATCH 5/6] docs: minor improvements to the demo style --- docs/src/demos/Examples/Book/index.vue | 9 ++++ .../Examples/CollaborativeEditing/index.vue | 9 ++++ docs/src/demos/Examples/Community/index.vue | 9 ++++ docs/src/demos/Examples/Default/index.vue | 9 ++++ docs/src/demos/Examples/Formatting/index.vue | 9 ++++ .../Examples/MarkdownShortcuts/index.vue | 9 ++++ docs/src/demos/Examples/Tables/index.vue | 54 ++++++++++--------- .../demos/Guide/Content/ExportHTML/index.vue | 9 ++++ .../demos/Guide/Content/ExportJSON/index.vue | 9 ++++ 9 files changed, 100 insertions(+), 26 deletions(-) diff --git a/docs/src/demos/Examples/Book/index.vue b/docs/src/demos/Examples/Book/index.vue index 44b31291..1e3a53b5 100644 --- a/docs/src/demos/Examples/Book/index.vue +++ b/docs/src/demos/Examples/Book/index.vue @@ -109,6 +109,15 @@ export default { padding: 0 1rem; } + h1, + h2, + h3, + h4, + h5, + h6 { + line-height: 1.1; + } + code { background-color: rgba(#616161, 0.1); color: #616161; diff --git a/docs/src/demos/Examples/CollaborativeEditing/index.vue b/docs/src/demos/Examples/CollaborativeEditing/index.vue index bba1e2ac..5f962783 100644 --- a/docs/src/demos/Examples/CollaborativeEditing/index.vue +++ b/docs/src/demos/Examples/CollaborativeEditing/index.vue @@ -265,6 +265,15 @@ export default { padding: 0 1rem; } + h1, + h2, + h3, + h4, + h5, + h6 { + line-height: 1.1; + } + code { background-color: rgba(#616161, 0.1); color: #616161; diff --git a/docs/src/demos/Examples/Community/index.vue b/docs/src/demos/Examples/Community/index.vue index d64d4a4f..b7bcf223 100644 --- a/docs/src/demos/Examples/Community/index.vue +++ b/docs/src/demos/Examples/Community/index.vue @@ -147,6 +147,15 @@ export default { > * + * { margin-top: 0.75em; } + + h1, + h2, + h3, + h4, + h5, + h6 { + line-height: 1.1; + } } .mention { diff --git a/docs/src/demos/Examples/Default/index.vue b/docs/src/demos/Examples/Default/index.vue index b3bb8114..1f0bd869 100644 --- a/docs/src/demos/Examples/Default/index.vue +++ b/docs/src/demos/Examples/Default/index.vue @@ -139,6 +139,15 @@ export default { padding: 0 1rem; } + h1, + h2, + h3, + h4, + h5, + h6 { + line-height: 1.1; + } + code { background-color: rgba(#616161, 0.1); color: #616161; diff --git a/docs/src/demos/Examples/Formatting/index.vue b/docs/src/demos/Examples/Formatting/index.vue index 0e795b82..6c1b48a7 100644 --- a/docs/src/demos/Examples/Formatting/index.vue +++ b/docs/src/demos/Examples/Formatting/index.vue @@ -124,6 +124,15 @@ export default { padding: 0 1rem; } + h1, + h2, + h3, + h4, + h5, + h6 { + line-height: 1.1; + } + code { background-color: rgba(#616161, 0.1); color: #616161; diff --git a/docs/src/demos/Examples/MarkdownShortcuts/index.vue b/docs/src/demos/Examples/MarkdownShortcuts/index.vue index 59062178..8f55d2ae 100644 --- a/docs/src/demos/Examples/MarkdownShortcuts/index.vue +++ b/docs/src/demos/Examples/MarkdownShortcuts/index.vue @@ -65,6 +65,15 @@ export default { padding: 0 1rem; } + h1, + h2, + h3, + h4, + h5, + h6 { + line-height: 1.1; + } + code { background-color: rgba(#616161, 0.1); color: #616161; diff --git a/docs/src/demos/Examples/Tables/index.vue b/docs/src/demos/Examples/Tables/index.vue index 07288eaf..8e89ac38 100644 --- a/docs/src/demos/Examples/Tables/index.vue +++ b/docs/src/demos/Examples/Tables/index.vue @@ -4,56 +4,56 @@ insertTable -