add new structure (without content)

This commit is contained in:
Hans Pagel
2020-08-11 16:31:03 +02:00
parent b7d8fbb2ca
commit 9d22298570
4 changed files with 76 additions and 16 deletions

View File

@@ -1,5 +1,10 @@
# Commands # Commands
- menus
- buttons
- commands
## .clearContent() ## .clearContent()
Clear the whole document. Clear the whole document.

View File

@@ -12,6 +12,8 @@ yarn add @tiptap/core @tiptap/starter-kit
You can use it like this: You can use it like this:
## Vanilla JavaScript
```js ```js
import { Editor } from '@tiptap/core' import { Editor } from '@tiptap/core'
import extensions from '@tiptap/starter-kit' import extensions from '@tiptap/starter-kit'
@@ -21,4 +23,38 @@ new Editor({
extensions: extensions(), extensions: extensions(),
content: '<p>Hey there.</p>', content: '<p>Hey there.</p>',
}) })
``` ```
→ codesandbox
## Vue.js
```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>',
})
```
→ codesandbox
## 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>',
})
```
→ codesandbox
## cdn?

View File

@@ -6,6 +6,8 @@
{{ $static.metadata.siteName }} {{ $static.metadata.siteName }}
</g-link> </g-link>
<div> <div>
Algolia Search |
Sponsor
<github-button <github-button
href="https://github.com/scrumpy/tiptap" href="https://github.com/scrumpy/tiptap"
data-show-count="true" data-show-count="true"

View File

@@ -5,29 +5,46 @@
- title: Installation - title: Installation
link: /installation/ link: /installation/
- title: Core Concepts - title: Guide
items: items:
- title: Renderless - title: First Steps
link: /renderless/ link: /first-steps/
- title: Schema - title: Configuration
link: /schema/ link: /configuration/
- title: Editor - title: Build your editor
link: /editor/ link: /build-your-editor/
- title: Extensions - title: Custom styling
link: /extensions/ link: /custom-styling/
- title: Commands - title: Get content
link: /commands/ link: /get-content/
- title: Events - title: "Advanced nodes"
link: /events/ link: /advanced-notes/
- title: Vue - title: Vue
items: items:
- title: Basic Example - title: Basic Example
link: /basic-example/ link: /basic-example/
- title: Advanced Example - title: Advanced Example
link: /advanced-example/ link: /advanced-vue-example/
- title: Render Vue Components
link: /render-vue-components/
- title: React - title: React
items: items:
- title: React - title: React
link: /react/ link: /react/
- title: Render React Components
link: /advanced-react-example/
- title: API
items:
- title: Editor
link: /editor/
- title: Extensions
link: /extensions/
- title: Commands
link: /commands/
- title: Events
link: /events/
- title: Schema
link: /schema/