docs: use regular case for Tiptap

This commit is contained in:
Hans Pagel
2021-10-19 22:30:45 +02:00
parent 3fe97621e7
commit f45c8d0ca7
77 changed files with 203 additions and 203 deletions

View File

@@ -6,7 +6,7 @@ tableOfContents: true
# Alpine.js
## Introduction
The following guide describes how to integrate tiptap with your [Alpine.js](https://github.com/alpinejs/alpine) project.
The following guide describes how to integrate Tiptap with your [Alpine.js](https://github.com/alpinejs/alpine) project.
For the sake of this guide well use [Vite](https://vitejs.dev/) to quickly set up a project, but you can use whatever youre used to. Vite is just really fast and we love it.
@@ -20,15 +20,15 @@ If you already have an existing Alpine.js project, thats fine too. Just skip
For the sake of this guide, lets start with a fresh [Vite](https://vitejs.dev/) project called `tiptap-example`. Vite sets up everything we need, just select the Vanilla JavaScript template.
```bash
npm init vite@latest tiptap-example -- --template vanilla
cd tiptap-example
npm init vite@latest Tiptap-example -- --template vanilla
cd Tiptap-example
npm install
npm run dev
```
## 2. Install the dependencies
Okay, enough of the boring boilerplate work. Lets finally install tiptap! For the following example youll need `alpinejs`, the `@tiptap/core` package and the `@tiptap/starter-kit` which has the most common extensions to get started quickly.
Okay, enough of the boring boilerplate work. Lets finally install Tiptap! For the following example youll need `alpinejs`, the `@tiptap/core` package and the `@tiptap/starter-kit` which has the most common extensions to get started quickly.
```bash
# install with npm
@@ -41,9 +41,9 @@ yarn add alpinejs @tiptap/core @tiptap/starter-kit
If you followed step 1, you can now start your project with `npm run dev` or `yarn dev`, and open [http://localhost:3000](http://localhost:3000) in your favorite browser. This might be different, if youre working with an existing project.
## 3. Initialize the editor
To actually start using tiptap, youll need to write a little bit of JavaScript. Lets put the following example code in a file called `main.js`.
To actually start using Tiptap, youll need to write a little bit of JavaScript. Lets put the following example code in a file called `main.js`.
This is the fastest way to get tiptap up and running with Alpine.js. It will give you a very basic version of tiptap. No worries, you will be able to add more functionality soon.
This is the fastest way to get Tiptap up and running with Alpine.js. It will give you a very basic version of Tiptap. No worries, you will be able to add more functionality soon.
```js
import Alpine from 'alpinejs'
@@ -127,4 +127,4 @@ Now, lets replace the content of the `index.html` with the following example
</html>
```
You should now see tiptap in your browser. Time to give yourself a pat on the back! :)
You should now see Tiptap in your browser. Time to give yourself a pat on the back! :)

View File

@@ -24,4 +24,4 @@ For testing purposes or demos, use our [Skypack](https://www.skypack.dev/) CDN b
</html>
```
You should now see tiptap in your browser. Time to give yourself a pat on the back! :)
You should now see Tiptap in your browser. Time to give yourself a pat on the back! :)

View File

@@ -6,7 +6,7 @@ tableOfContents: true
# Livewire
## Introduction
The following guide describes how to integrate tiptap with your [Livewire](https://laravel-livewire.com/) project.
The following guide describes how to integrate Tiptap with your [Livewire](https://laravel-livewire.com/) project.
TODO

View File

@@ -6,7 +6,7 @@ tableOfContents: true
# Next.js
## Introduction
The following guide describes how to integrate tiptap with your [Next.js](https://nextjs.org/) project.
The following guide describes how to integrate Tiptap with your [Next.js](https://nextjs.org/) project.
## Requirements
* [Node](https://nodejs.org/en/download/) installed on your machine
@@ -18,14 +18,14 @@ If you already have an existing Next.js project, thats fine too. Just skip th
For the sake of this guide, lets start with a new Next.js project called `tiptap-example`. The following command sets up everything we need to get started.
```bash
# create a project
npx create-next-app tiptap-example
npx create-next-app Tiptap-example
# change directory
cd tiptap-example
cd Tiptap-example
```
## 2. Install the dependencies
Now that we have a standard boilerplate set up we can get started on getting tiptap up and running! For this we will need to install two packages: `@tiptap/react` and `@tipta/starter-kit` which includes all the extensions you need to get started quickly.
Now that we have a standard boilerplate set up we can get started on getting Tiptap up and running! For this we will need to install two packages: `@tiptap/react` and `@tipta/starter-kit` which includes all the extensions you need to get started quickly.
```bash
# install with npm
@@ -38,7 +38,7 @@ yarn add @tiptap/react @tiptap/starter-kit
If you followed step 1 and 2, you can now start your project with `npm run dev` or `yarn dev`, and open [http://localhost:3000/](http://localhost:3000/) in your favorite browser. This might be different, if youre working with an existing project.
## 3. Create a new component
To actually start using tiptap, youll need to add a new component to your app. To do this, first create a directory called `components/`. Now it's time to create our component which we'll call `Tiptap`. To do this put the following example code in `components/Tiptap.js`.
To actually start using Tiptap, youll need to add a new component to your app. To do this, first create a directory called `components/`. Now it's time to create our component which we'll call `Tiptap`. To do this put the following example code in `components/Tiptap.js`.
```jsx
import { useEditor, EditorContent } from '@tiptap/react'
@@ -72,4 +72,4 @@ export default function Home() {
)
}
```
You should now see tiptap in your browser. Time to give yourself a pat on the back! :)
You should now see Tiptap in your browser. Time to give yourself a pat on the back! :)

View File

@@ -6,7 +6,7 @@ tableOfContents: true
# Nuxt.js
## Introduction
The following guide describes how to integrate tiptap with your [Nuxt.js](https://nuxtjs.org/) 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
@@ -19,14 +19,14 @@ For the sake of this guide, lets start with a fresh Nuxt.js project called `t
```bash
# create a project
npm init nuxt-app tiptap-example
npm init nuxt-app Tiptap-example
# change directory
cd tiptap-example
cd Tiptap-example
```
## 2. Install the dependencies
Okay, enough of the boring boilerplate work. Lets finally install tiptap! For the following example youll need the `@tiptap/vue-2` package, with a few components, and `@tiptap/starter-kit` which has the most common extensions to get started quickly.
Okay, enough of the boring boilerplate work. Lets finally install Tiptap! For the following example youll need the `@tiptap/vue-2` package, with a few components, and `@tiptap/starter-kit` which has the most common extensions to get started quickly.
```bash
# install with npm
@@ -39,9 +39,9 @@ yarn add @tiptap/vue-2 @tiptap/starter-kit
If you followed step 1 and 2, you can now start your project with `npm run serve` or `yarn serve`, and open [http://localhost:8080/](http://localhost:8080/) in your favorite browser. This might be different, if youre working with an existing project.
## 3. Create a new component
To actually start using tiptap, youll need to add a new component to your app. Lets call it `Tiptap` and put the following example code in `src/components/Tiptap.vue`.
To actually start using Tiptap, youll need to add a new component to your app. Lets call it `Tiptap` and put the following example code in `src/components/Tiptap.vue`.
This is the fastest way to get tiptap up and running with Vue. It will give you a very basic version of tiptap, without any buttons. No worries, you will be able to add more functionality soon.
This is the fastest way to get Tiptap up and running with Vue. It will give you a very basic version of Tiptap, without any buttons. No worries, you will be able to add more functionality soon.
```html
<template>
@@ -65,7 +65,7 @@ export default {
mounted() {
this.editor = new Editor({
content: '<p>Im running tiptap with Vue.js. 🎉</p>',
content: '<p>Im running Tiptap with Vue.js. 🎉</p>',
extensions: [
StarterKit,
],
@@ -92,11 +92,11 @@ Now, lets replace the content of `pages/index.vue` with the following example
</template>
```
Note that tiptap needs to run in the client, not on the server. Its required to wrap the editor in a `<client-only>` tag. [Read more about cient-only components.](https://nuxtjs.org/api/components-client-only)
Note that Tiptap needs to run in the client, not on the server. Its required to wrap the editor in a `<client-only>` tag. [Read more about cient-only components.](https://nuxtjs.org/api/components-client-only)
You should now see tiptap in your browser. Time to give yourself a pat on the back! :)
You should now see Tiptap in your browser. Time to give yourself a pat on the back! :)
## 5. Use v-model (optional)
Youre probably used to bind your data with `v-model` in forms, thats also possible with tiptap. Here is a working example component, that you can integrate in your project:
Youre probably used to bind your data with `v-model` in forms, thats also possible with Tiptap. Here is a working example component, that you can integrate in your project:
https://embed.tiptap.dev/preview/GuideGettingStarted/VModel

View File

@@ -6,18 +6,18 @@ tableOfContents: true
# React
## Introduction
The following guide describes how to integrate tiptap with your [React](https://reactjs.org/) project.
The following guide describes how to integrate Tiptap with your [React](https://reactjs.org/) project.
## Requirements
* [Node](https://nodejs.org/en/download/) installed on your machine
* Experience with [React](https://reactjs.org/docs/getting-started.html)
## Using a template
If you just want to get up and running with tiptap you can use the [tiptap Create React App template](https://github.com/alb/cra-template-tiptap) by [@alb](https://github.com/alb) to automatically create a new project with all the steps below already completed.
If you just want to get up and running with Tiptap you can use the [tiptap Create React App template](https://github.com/alb/cra-template-tiptap) by [@alb](https://github.com/alb) to automatically create a new project with all the steps below already completed.
```bash
# create a project based on the tiptap template
npx create-react-app tiptap-example --template tiptap
# create a project based on the Tiptap template
npx create-react-app Tiptap-example --template Tiptap
```
## 1. Create a project (optional)
@@ -27,14 +27,14 @@ For the sake of this guide, lets start with a fresh React project called `tip
```bash
# create a project
npx create-react-app tiptap-example
npx create-react-app Tiptap-example
# change directory
cd tiptap-example
cd Tiptap-example
```
## 2. Install the dependencies
Okay, enough of the boring boilerplate work. Lets finally install tiptap! For the following example youll need the `@tiptap/react` package, with a few components, and `@tiptap/starter-kit` which has the most common extensions to get started quickly.
Okay, enough of the boring boilerplate work. Lets finally install Tiptap! For the following example youll need the `@tiptap/react` package, with a few components, and `@tiptap/starter-kit` which has the most common extensions to get started quickly.
```bash
# install with npm
@@ -47,9 +47,9 @@ yarn add @tiptap/react @tiptap/starter-kit
If you followed step 1 and 2, you can now start your project with `npm run start` or `yarn start`, and open [http://localhost:3000](http://localhost:3000) in your favorite browser. This might be different, if youre working with an existing project.
## 3. Create a new component
To actually start using tiptap, youll need to create a new component in your app. Lets call it `Tiptap` and put the following example code in `src/Tiptap.jsx`.
To actually start using Tiptap, youll need to create a new component in your app. Lets call it `Tiptap` and put the following example code in `src/Tiptap.jsx`.
This is the fastest way to get tiptap up and running with React. It will give you a very basic version of tiptap, without any buttons. No worries, you will be able to add more functionality soon.
This is the fastest way to get Tiptap up and running with React. It will give you a very basic version of Tiptap, without any buttons. No worries, you will be able to add more functionality soon.
```jsx
import { useEditor, EditorContent } from '@tiptap/react'
@@ -88,7 +88,7 @@ const App = () => {
export default App
```
You should now see tiptap in your browser. Time to give yourself a pat on the back! :)
You should now see Tiptap in your browser. Time to give yourself a pat on the back! :)
## 5. The complete setup (optional)
Ready to add more? Below is a demo that shows how you could set up what we call the default editor. Feel free to take this and start customizing it then:

View File

@@ -6,10 +6,10 @@ tableOfContents: true
# Svelte
## Introduction
The following guide describes how to integrate tiptap with your [SvelteKit](https://kit.svelte.dev/) project.
The following guide describes how to integrate Tiptap with your [SvelteKit](https://kit.svelte.dev/) project.
## Take a shortcut: Svelte REPL with tiptap
If you just want to jump into it right-away, here is a [Svelte REPL with tiptap](https://svelte.dev/repl/798f1b81b9184780aca18d9a005487d2?version=3.31.2) installed.
## Take a shortcut: Svelte REPL with Tiptap
If you just want to jump into it right-away, here is a [Svelte REPL with Tiptap](https://svelte.dev/repl/798f1b81b9184780aca18d9a005487d2?version=3.31.2) installed.
## Requirements
* [Node](https://nodejs.org/en/download/) installed on your machine
@@ -21,15 +21,15 @@ If you already have an existing SvelteKit project, thats fine too. Just skip
For the sake of this guide, lets start with a fresh SvelteKit project called `tiptap-example`. The following commands set up everything we need. It asks a lot of questions, but just use what floats your boat or use the defaults.
```bash
mkdir tiptap-example
cd tiptap-example
mkdir Tiptap-example
cd Tiptap-example
npm init svelte@next
npm install
npm run dev
```
## 2. Install the dependencies
Okay, enough of the boring boilerplate work. Lets finally install tiptap! For the following example youll need the `@tiptap/core` package, with a few components, and `@tiptap/starter-kit` which has the most common extensions to get started quickly.
Okay, enough of the boring boilerplate work. Lets finally install Tiptap! For the following example youll need the `@tiptap/core` package, with a few components, and `@tiptap/starter-kit` which has the most common extensions to get started quickly.
```bash
# install with npm
@@ -42,9 +42,9 @@ yarn add @tiptap/core @tiptap/starter-kit
If you followed step 1 and 2, you can now start your project with `npm run dev` or `yarn dev`, and open [http://localhost:3000/](http://localhost:3000/) in your favorite browser. This might be different, if youre working with an existing project.
## 3. Create a new component
To actually start using tiptap, youll need to add a new component to your app. Lets call it `Tiptap` and put the following example code in `src/lib/Tiptap.svelte`.
To actually start using Tiptap, youll need to add a new component to your app. Lets call it `Tiptap` and put the following example code in `src/lib/Tiptap.svelte`.
This is the fastest way to get tiptap up and running with SvelteKit. It will give you a very basic version of tiptap, without any buttons. No worries, you will be able to add more functionality soon.
This is the fastest way to get Tiptap up and running with SvelteKit. It will give you a very basic version of Tiptap, without any buttons. No worries, you will be able to add more functionality soon.
```html
<script type="module">
@@ -117,4 +117,4 @@ Now, lets replace the content of `src/routes/index.svelte` with the following
</main>
```
You should now see tiptap in your browser. Time to give yourself a pat on the back! :)
You should now see Tiptap in your browser. Time to give yourself a pat on the back! :)

View File

@@ -6,7 +6,7 @@ tableOfContents: true
# Vue.js 2
## Introduction
The following guide describes how to integrate tiptap with your [Vue](https://vuejs.org/) CLI project.
The following guide describes how to integrate Tiptap with your [Vue](https://vuejs.org/) CLI project.
## Requirements
* [Node](https://nodejs.org/en/download/) installed on your machine
@@ -20,14 +20,14 @@ For the sake of this guide, lets start with a fresh Vue project called `tipta
```bash
# create a project
vue create tiptap-example
vue create Tiptap-example
# change directory
cd tiptap-example
cd Tiptap-example
```
## 2. Install the dependencies
Okay, enough of the boring boilerplate work. Lets finally install tiptap! For the following example youll need the `@tiptap/vue-2` package, with a few components, and `@tiptap/starter-kit` which has the most common extensions to get started quickly.
Okay, enough of the boring boilerplate work. Lets finally install Tiptap! For the following example youll need the `@tiptap/vue-2` package, with a few components, and `@tiptap/starter-kit` which has the most common extensions to get started quickly.
```bash
# install with npm
@@ -40,9 +40,9 @@ yarn add @tiptap/vue-2 @tiptap/starter-kit
If you followed step 1 and 2, you can now start your project with `npm run dev` or `yarn dev`, and open [http://localhost:8080](http://localhost:8080) in your favorite browser. This might be different, if youre working with an existing project.
## 3. Create a new component
To actually start using tiptap, youll need to add a new component to your app. Lets call it `Tiptap` and put the following example code in `components/Tiptap.vue`.
To actually start using Tiptap, youll need to add a new component to your app. Lets call it `Tiptap` and put the following example code in `components/Tiptap.vue`.
This is the fastest way to get tiptap up and running with Vue. It will give you a very basic version of tiptap, without any buttons. No worries, you will be able to add more functionality soon.
This is the fastest way to get Tiptap up and running with Vue. It will give you a very basic version of Tiptap, without any buttons. No worries, you will be able to add more functionality soon.
```html
<template>
@@ -66,7 +66,7 @@ export default {
mounted() {
this.editor = new Editor({
content: '<p>Im running tiptap with Vue.js. 🎉</p>',
content: '<p>Im running Tiptap with Vue.js. 🎉</p>',
extensions: [
StarterKit,
],
@@ -102,9 +102,9 @@ export default {
</script>
```
You should now see tiptap in your browser. Time to give yourself a pat on the back! :)
You should now see Tiptap in your browser. Time to give yourself a pat on the back! :)
## 5. Use v-model (optional)
Youre probably used to bind your data with `v-model` in forms, thats also possible with tiptap. Here is a working example component, that you can integrate in your project:
Youre probably used to bind your data with `v-model` in forms, thats also possible with Tiptap. Here is a working example component, that you can integrate in your project:
https://embed.tiptap.dev/preview/GuideGettingStarted/VModel

View File

@@ -6,7 +6,7 @@ tableOfContents: true
# Vue.js 3
## Introduction
The following guide describes how to integrate tiptap with your [Vue](https://vuejs.org/) CLI project.
The following guide describes how to integrate Tiptap with your [Vue](https://vuejs.org/) CLI project.
## Requirements
* [Node](https://nodejs.org/en/download/) installed on your machine
@@ -20,14 +20,14 @@ For the sake of this guide, lets start with a fresh Vue project called `tipta
```bash
# create a project
vue create tiptap-example
vue create Tiptap-example
# change directory
cd tiptap-example
cd Tiptap-example
```
## 2. Install the dependencies
Okay, enough of the boring boilerplate work. Lets finally install tiptap! For the following example youll need the `@tiptap/vue-3` package, with a few components, and `@tiptap/starter-kit` which has the most common extensions to get started quickly.
Okay, enough of the boring boilerplate work. Lets finally install Tiptap! For the following example youll need the `@tiptap/vue-3` package, with a few components, and `@tiptap/starter-kit` which has the most common extensions to get started quickly.
```bash
# install with npm
@@ -40,9 +40,9 @@ yarn add @tiptap/vue-3 @tiptap/starter-kit
If you followed step 1 and 2, you can now start your project with `npm run dev` or `yarn dev`, and open [http://localhost:8080](http://localhost:8080) in your favorite browser. This might be different, if youre working with an existing project.
## 3. Create a new component
To actually start using tiptap, youll need to add a new component to your app. Lets call it `Tiptap` and put the following example code in `components/Tiptap.vue`.
To actually start using Tiptap, youll need to add a new component to your app. Lets call it `Tiptap` and put the following example code in `components/Tiptap.vue`.
This is the fastest way to get tiptap up and running with Vue. It will give you a very basic version of tiptap, without any buttons. No worries, you will be able to add more functionality soon.
This is the fastest way to get Tiptap up and running with Vue. It will give you a very basic version of Tiptap, without any buttons. No worries, you will be able to add more functionality soon.
```html
<template>
@@ -66,7 +66,7 @@ export default {
mounted() {
this.editor = new Editor({
content: '<p>Im running tiptap with Vue.js. 🎉</p>',
content: '<p>Im running Tiptap with Vue.js. 🎉</p>',
extensions: [
StarterKit,
],
@@ -98,7 +98,7 @@ export default {
setup() {
const editor = useEditor({
content: '<p>Im running tiptap with Vue.js. 🎉</p>',
content: '<p>Im running Tiptap with Vue.js. 🎉</p>',
extensions: [
StarterKit,
],
@@ -132,10 +132,10 @@ export default {
</script>
```
You should now see tiptap in your browser. Time to give yourself a pat on the back! :)
You should now see Tiptap in your browser. Time to give yourself a pat on the back! :)
## 5. Use v-model (optional)
Youre probably used to bind your data with `v-model` in forms, thats also possible with tiptap. Here is how that would work with tiptap:
Youre probably used to bind your data with `v-model` in forms, thats also possible with Tiptap. Here is how that would work with Tiptap:
```html
<template>