From 5571e1dd27c52dc6da08ad8be21207ae4aa9f0c8 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Sun, 7 Feb 2021 15:55:50 +0100 Subject: [PATCH] merge installation and the getting started guide --- .../demos/Overview/Installation/index.spec.js | 4 +- docs/src/docPages/guide/getting-started.md | 51 ------------- docs/src/docPages/installation.md | 56 ++++++++++++++ .../alpine.md | 0 docs/src/docPages/installation/cdn.md | 22 ++++++ docs/src/docPages/installation/codesandbox.md | 11 +++ .../livewire.md | 0 .../getting-started => installation}/next.md | 0 .../getting-started => installation}/nuxt.md | 0 .../getting-started => installation}/react.md | 0 .../svelte.md | 0 .../getting-started => installation}/vue.md | 0 .../getting-started => installation}/vue2.md | 0 docs/src/docPages/introduction.md | 2 +- docs/src/docPages/overview/installation.md | 75 ------------------- docs/src/docPages/sponsor.md | 4 +- docs/src/layouts/App/index.vue | 2 +- docs/src/links.yaml | 35 +-------- docs/src/pages/index.vue | 19 +++-- 19 files changed, 109 insertions(+), 172 deletions(-) delete mode 100644 docs/src/docPages/guide/getting-started.md create mode 100644 docs/src/docPages/installation.md rename docs/src/docPages/{guide/getting-started => installation}/alpine.md (100%) create mode 100644 docs/src/docPages/installation/cdn.md create mode 100644 docs/src/docPages/installation/codesandbox.md rename docs/src/docPages/{guide/getting-started => installation}/livewire.md (100%) rename docs/src/docPages/{guide/getting-started => installation}/next.md (100%) rename docs/src/docPages/{guide/getting-started => installation}/nuxt.md (100%) rename docs/src/docPages/{guide/getting-started => installation}/react.md (100%) rename docs/src/docPages/{guide/getting-started => installation}/svelte.md (100%) rename docs/src/docPages/{guide/getting-started => installation}/vue.md (100%) rename docs/src/docPages/{guide/getting-started => installation}/vue2.md (100%) delete mode 100644 docs/src/docPages/overview/installation.md diff --git a/docs/src/demos/Overview/Installation/index.spec.js b/docs/src/demos/Overview/Installation/index.spec.js index da07d3c5..0de4b35b 100644 --- a/docs/src/demos/Overview/Installation/index.spec.js +++ b/docs/src/demos/Overview/Installation/index.spec.js @@ -1,5 +1,5 @@ -context('/overview/installation', () => { +context('/installation', () => { before(() => { - cy.visit('/overview/installation') + cy.visit('/installation') }) }) diff --git a/docs/src/docPages/guide/getting-started.md b/docs/src/docPages/guide/getting-started.md deleted file mode 100644 index f2a9188c..00000000 --- a/docs/src/docPages/guide/getting-started.md +++ /dev/null @@ -1,51 +0,0 @@ -# Getting started - -## toc - -## Introduction -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) -* [Nuxt.js](/guide/getting-started/nuxt) -* [React](/guide/getting-started/react) (Draft) -* [Svelte](/guide/getting-started/svelte) (Draft) -* [Alpine.js](/guide/getting-started/alpine) (Draft) -* [Livewire](/guide/getting-started/livewire) (Draft) - -## Requirements -* [Node](https://nodejs.org/en/download/) installed on your machine - -## 1. Install the dependencies -For the following example you’ll need the `@tiptap/core` (the actual editor) and the `@tiptap/starter-kit` which has everything to get started quickly, for example a few default extensions. - -```bash -# install with npm -npm install @tiptap/core @tiptap/starter-kit - -# install with Yarn -yarn add @tiptap/core @tiptap/starter-kit -``` - -## 2. Add a container -You need a place somewhere in your app, where we should place tiptap. Place the following HTML there: - -```html -
-``` - -## 3. Initialize the editor -Now, let’s initialize the editor in JavaScript: - -```js -import { Editor } from '@tiptap/core' -import { defaultExtensions } from '@tiptap/starter-kit' - -new Editor({ - element: document.querySelector('.element'), - extensions: defaultExtensions(), - content: '

Your content.

', -}) -``` - -When you open the project in your browser, you should now see tiptap in action. Time to give yourself a pat on the back. Let’s start to configure your editor in the next step. diff --git a/docs/src/docPages/installation.md b/docs/src/docPages/installation.md new file mode 100644 index 00000000..79144ba8 --- /dev/null +++ b/docs/src/docPages/installation.md @@ -0,0 +1,56 @@ +# Getting started + +## toc + +## Introduction +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. The following steps should help you to integrate tiptap in your JavaScript project. + +## Integration guides +* [CDN](/installation/cdn) +* [CodeSandbox](/installation/codesandbox) +* [Vue 2](/installation/vue2) +* [Vue 3](/installation/vue) (Draft) +* [Nuxt.js](/installation/nuxt) +* [React](/installation/react) (Draft) +* [Svelte](/installation/svelte) (Draft) +* [Alpine.js](/installation/alpine) (Draft) +* [Livewire](/installation/livewire) (Draft) + +## Vanilla JavaScript + +### Requirements +* [Node](https://nodejs.org/en/download/) installed on your machine + +### 1. Install the dependencies +For the following example you will need `@tiptap/core` (the actual editor) and `@tiptap/starter-kit` which has everything to get started quickly, for example the most common extensions. + +```bash +# install with npm +npm install @tiptap/core @tiptap/starter-kit + +# install with Yarn +yarn add @tiptap/core @tiptap/starter-kit +``` + +### 2. Add a container +Add the following HTML where you want the editor to be mounted: + +```html +
+``` + +### 3. Initialize the editor +Now, let’s initialize the editor in JavaScript: + +```js +import { Editor } from '@tiptap/core' +import { defaultExtensions } from '@tiptap/starter-kit' + +new Editor({ + element: document.querySelector('.element'), + extensions: defaultExtensions(), + content: '

Your content.

', +}) +``` + +When you open the project in your browser, you should now see tiptap in action. Time to give yourself a pat on the back. diff --git a/docs/src/docPages/guide/getting-started/alpine.md b/docs/src/docPages/installation/alpine.md similarity index 100% rename from docs/src/docPages/guide/getting-started/alpine.md rename to docs/src/docPages/installation/alpine.md diff --git a/docs/src/docPages/installation/cdn.md b/docs/src/docPages/installation/cdn.md new file mode 100644 index 00000000..502ccdbd --- /dev/null +++ b/docs/src/docPages/installation/cdn.md @@ -0,0 +1,22 @@ +# 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 + + + + + +
+ + + +``` diff --git a/docs/src/docPages/installation/codesandbox.md b/docs/src/docPages/installation/codesandbox.md new file mode 100644 index 00000000..fdba82ec --- /dev/null +++ b/docs/src/docPages/installation/codesandbox.md @@ -0,0 +1,11 @@ +# 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 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. diff --git a/docs/src/docPages/guide/getting-started/livewire.md b/docs/src/docPages/installation/livewire.md similarity index 100% rename from docs/src/docPages/guide/getting-started/livewire.md rename to docs/src/docPages/installation/livewire.md diff --git a/docs/src/docPages/guide/getting-started/next.md b/docs/src/docPages/installation/next.md similarity index 100% rename from docs/src/docPages/guide/getting-started/next.md rename to docs/src/docPages/installation/next.md diff --git a/docs/src/docPages/guide/getting-started/nuxt.md b/docs/src/docPages/installation/nuxt.md similarity index 100% rename from docs/src/docPages/guide/getting-started/nuxt.md rename to docs/src/docPages/installation/nuxt.md diff --git a/docs/src/docPages/guide/getting-started/react.md b/docs/src/docPages/installation/react.md similarity index 100% rename from docs/src/docPages/guide/getting-started/react.md rename to docs/src/docPages/installation/react.md diff --git a/docs/src/docPages/guide/getting-started/svelte.md b/docs/src/docPages/installation/svelte.md similarity index 100% rename from docs/src/docPages/guide/getting-started/svelte.md rename to docs/src/docPages/installation/svelte.md diff --git a/docs/src/docPages/guide/getting-started/vue.md b/docs/src/docPages/installation/vue.md similarity index 100% rename from docs/src/docPages/guide/getting-started/vue.md rename to docs/src/docPages/installation/vue.md diff --git a/docs/src/docPages/guide/getting-started/vue2.md b/docs/src/docPages/installation/vue2.md similarity index 100% rename from docs/src/docPages/guide/getting-started/vue2.md rename to docs/src/docPages/installation/vue2.md diff --git a/docs/src/docPages/introduction.md b/docs/src/docPages/introduction.md index 1178e26b..adfb721d 100644 --- a/docs/src/docPages/introduction.md +++ b/docs/src/docPages/introduction.md @@ -18,7 +18,7 @@ Create exactly the rich text editor you want out of customizable building blocks ## Features **Headless.** We don’t tell you what a menu should look like or where it should be rendered in the DOM. That’s why tiptap is headless and comes without any CSS. You are in full control over markup, styling and behaviour. -**Framework-agnostic.** No matter what framework you use, you’ll enjoy tiptap. Out of the box, it works with plain JavaScript and Vue.js, but it’s also possible to use it in [React](/guide/getting-started/react), Svelte and others. +**Framework-agnostic.** No matter what framework you use, you’ll enjoy tiptap. Out of the box, it works with plain JavaScript and Vue.js, but it’s also possible to use it in [React](/installation/react), Svelte and others. **TypeScript.** tiptap 2 is written in TypeScript. That helps us to find bugs early and gives you a nice autocomplete for the API (if your IDE supports that) on top of the extensive human written documentation. diff --git a/docs/src/docPages/overview/installation.md b/docs/src/docPages/overview/installation.md deleted file mode 100644 index cbe6b928..00000000 --- a/docs/src/docPages/overview/installation.md +++ /dev/null @@ -1,75 +0,0 @@ -# Installation - -## toc - -## Introduction -There are a few different ways to install tiptap, depending on your development setup. We have put together integration guides for a few popular frameworks to get you started quickly. You can even use tiptap without any front-end framework, too. Choose the way that fits your workflow and start building cool things! - -## Integration guides -* [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/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. - -## 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 -npm install @tiptap/core @tiptap/starter-kit - -# with Yarn -yarn add @tiptap/core @tiptap/starter-kit -``` - -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' -import { defaultExtensions } from '@tiptap/starter-kit' - -new Editor({ - element: document.querySelector('.element'), - extensions: defaultExtensions(), - content: '

Your content.

', -}) -``` - -## 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 - - - - - -
- - - -``` - -## 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 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. diff --git a/docs/src/docPages/sponsor.md b/docs/src/docPages/sponsor.md index 32fbeda9..f6a852fe 100644 --- a/docs/src/docPages/sponsor.md +++ b/docs/src/docPages/sponsor.md @@ -1,4 +1,6 @@ -# Become a sponsor +# Become a sponsor 💖 + +## Introduction To deliver a top-notch developer experience and user experience, we put ~~hundreds~~ thousands of hours of unpaid work into tiptap. Your funding helps us to make this work more and more financially sustainable. This enables us to provide helpful support, maintain all our packages, keep everything up to date, and develop new features and extensions for tiptap. Give back to the open source community and [sponsor us on GitHub](https://github.com/sponsors/ueberdosis)! ♥ diff --git a/docs/src/layouts/App/index.vue b/docs/src/layouts/App/index.vue index 9e141d00..4dacb684 100644 --- a/docs/src/layouts/App/index.vue +++ b/docs/src/layouts/App/index.vue @@ -46,7 +46,7 @@ - + Documentation diff --git a/docs/src/links.yaml b/docs/src/links.yaml index 33cbe0f3..1df746b3 100644 --- a/docs/src/links.yaml +++ b/docs/src/links.yaml @@ -1,7 +1,7 @@ - title: Overview items: - title: Installation - link: /overview/installation + link: /installation - title: Upgrade Guide link: /overview/upgrade-guide - title: Become a sponsor @@ -46,39 +46,6 @@ - title: Guide items: - - title: Getting started - link: /guide/getting-started - items: - - title: Vue.js 2 - link: /guide/getting-started/vue2 - skip: true - - title: Vue.js 3 - link: /guide/getting-started/vue - type: draft - skip: true - - title: Nuxt.js - link: /guide/getting-started/nuxt - skip: true - - title: React - link: /guide/getting-started/react - type: draft - skip: true - - title: Next.js - link: /guide/getting-started/next - type: draft - skip: true - - title: Svelte - link: /guide/getting-started/svelte - type: draft - skip: true - - title: Alpine.js - link: /guide/getting-started/alpine - type: draft - skip: true - - title: Livewire - link: /guide/getting-started/livewire - type: draft - skip: true - title: Configure the editor link: /guide/configuration - title: Create a toolbar diff --git a/docs/src/pages/index.vue b/docs/src/pages/index.vue index 1ea3b3b9..31097f0e 100644 --- a/docs/src/pages/index.vue +++ b/docs/src/pages/index.vue @@ -9,7 +9,7 @@ tiptap gives you full control about every single aspect of your text editor experience. It’s customizable, comes with a ton of extensions, is open-source, has an extensive documentation, and is simply a joy to use. Join our welcoming community and start building cool things! It’s free.

- + Get Started

- No matter what framework you use, you’ll enjoy tiptap. Out of the box, it works with plain JavaScript and Vue.js, but it’s also possible to use it in React, Svelte and others. + No matter what framework you use, you’ll enjoy tiptap. Out of the box, it works with plain JavaScript and Vue.js, but it’s also possible to use it in React, Svelte and others.

- + Installation
@@ -63,7 +63,7 @@ TypeScript

- tiptap 2 is written in TypeScript. That helps us to find bugs early and gives you a nice autocomplete for the API (if your IDE supports that) on top of the extensive human written documentation. + tiptap 2 is written in TypeScript. That helps to find bugs early and gives a nice autocomplete for the API (if your IDE supports that) on top of the extensive human written documentation.

@@ -77,7 +77,7 @@ Collaborative

- Real-time collaboration, syncing between different devices and working offline used to be hard. We provide everything you need to keep everything in sync, conflict-free with the power of Y.js. Our production-grade setup requires less than 20 lines of code. + Real-time collaboration, syncing between different devices and working offline used to be hard. We provide everything you need to keep everything in sync, conflict-free with the power of Y.js.

@@ -93,6 +93,11 @@

Over the years, a lovely community has grown around tiptap. There’s so much content shared, so many people helping out in issues and a ton of community extensions, you’ll be surprised how much that can help.

+
+ + GitHub + +
@@ -128,7 +133,7 @@ </html>
- + Learn More
@@ -189,7 +194,7 @@
- And Many More + And many more