add a few basics

This commit is contained in:
Hans Pagel
2020-08-11 17:26:10 +02:00
parent 8d0a734bf4
commit 4ed6646294
8 changed files with 151 additions and 36 deletions

View File

@@ -3,11 +3,11 @@
tiptap is framework-agnostic and works with plain JavaScript, Vue.js and React. To use tiptap with Vue.js or one of the tools that are based on Vue.js like Nuxt.js or Gridsome, youll need the tiptap Vue.js adapter. Install it as an dependency in your project:
```bash
# Install Vue.js adapter with npm
npm install @tiptap/vue
# Install tiptap & Vue.js adapter with npm
npm install @tiptap/core @tiptap/starter-kit @tiptap/vue
# Install Vue.js adapter with Yarn
yarn add @tiptap/vue
# Install tiptap & Vue.js adapter with Yarn
yarn add @tiptap/core @tiptap/starter-kit @tiptap/vue
```
Create a new Vue component (e. g. `<Tiptap />`) and add the following content. Thats the shortest way to get tiptap up and running with Vue.js. No worries, youll be able to add more functionality soon.

View File

@@ -0,0 +1,7 @@
# Configure tiptap
In its basic version tiptap comes very raw. There is no menu, no buttons, no styling. Thats intended. See tiptap as your building blocks to build exactly the editor youd like to have.
Lets start to add a few basic things to the configuration.
<demo name="BasicConfiguration" />

View File

@@ -0,0 +1,24 @@
# First steps with tiptap
tiptap is framework-agnostic and works with plain JavaScript, Vue.js and React. To use tiptap with Vue.js or one of the tools that are based on Vue.js like Nuxt.js or Gridsome, youll need the tiptap Vue.js adapter. Install it as an dependency in your project:
```bash
# Install Vue.js adapter with npm
npm install @tiptap/core @tiptap/starter-kit @tiptap/vue
# Install Vue.js adapter with Yarn
yarn add @tiptap/core @tiptap/starter-kit @tiptap/vue
```
Create a new Vue component (e. g. `<Tiptap />`) and add the following content. Thats the shortest way to get tiptap up and running with Vue.js. No worries, youll be able to add more functionality soon.
<demo name="GettingStarted" />
Does that work for you? There are a few common pitfalls here, if you have trouble getting started, try to read more here:
* [tiptap doesnt have a default styling](#)
* [Use tiptap with Nuxt.js](#)
Most people would expect a text editor to have buttons to make the text bold or add links. tiptap has all of that, but it is very modular. You are free to decided what you use and how you use it. Use it as a more powerful textarea or build a full-blown editor. tiptap is ready for both.
But lets try to add a menu in the next step.

View File

@@ -25,36 +25,35 @@ new Editor({
})
```
→ codesandbox
* Play with tiptap on [CodeSandbox](https://codesandbox.io/s/vue-issue-template-h0g28)
## Vue.js
```js
import { Editor } from '@tiptap/core'
import extensions from '@tiptap/starter-kit'
To use tiptap with Vue.js and tools that are based on Vue.js install the Vue.js adapter in your project:
new Editor({
element: document.getElementsByClassName('element'),
extensions: extensions(),
content: '<p>Hey there.</p>',
})
```bash
# Using npm
npm install @tiptap/core @tiptap/starter-kit @tiptap/vue
# Using Yarn
yarn add @tiptap/core @tiptap/starter-kit @tiptap/vue
```
→ codesandbox
Create a new component and add the following content to get a basic version of tiptap:
## react
<demo name="VueSetup" />
* Read more about [Using tiptap with Vue.js](/basic-vue-example/)
* Play with tiptap on [CodeSandbox](https://codesandbox.io/s/vue-issue-template-h0g28)
## React
```js
import { Editor } from '@tiptap/core'
import extensions from '@tiptap/starter-kit'
new Editor({
element: document.getElementsByClassName('element'),
extensions: extensions(),
content: '<p>Hey there.</p>',
})
// TODO
```
→ codesandbox
* Play with tiptap on [CodeSandbox](https://codesandbox.io/s/vue-issue-template-h0g28)
## cdn?
## CDN
// TODO