Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update alpine docs #1733

Merged
merged 1 commit into from
Aug 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/src/docPages/installation/alpine.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ If you already have an existing Alpine.js project, that’s fine too. Just skip
For the sake of this guide, let’s 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 @vitejs/app 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. Let’s finally install tiptap! For the following example you’ll need `alpinejs`, the `@tiptap/core` package and the `@tiptap/starter-kit` which has the most common extensions to get started quickly.

```bash
Expand All @@ -45,7 +47,7 @@ To actually start using tiptap, you’ll need to write a little bit of JavaScrip
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 alpinejs from 'alpinejs'
import Alpine from 'alpinejs'
import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'

Expand All @@ -71,6 +73,9 @@ window.setupEditor = function(content) {
},
}
}

window.Alpine = Alpine
Alpine.start()
```

## 4. Add it to your app
Expand Down