add table of content support

This commit is contained in:
Hans Pagel
2020-09-27 10:29:01 +02:00
parent bcef08ce2a
commit 149ce56ad8
18 changed files with 66 additions and 19 deletions

View File

@@ -1,9 +1,9 @@
# Configuration
In its simplest 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 you would like to have.
## Adding a menu
## Table of Contents
## Adding a menu
Lets start to add your first button to the editor. Once initiated the editor has a powerful API. The so called *commands* allow you to modify selected text (and tons of other things). Here is an example with one single button:
<demo name="SimpleMenuBar" highlight="5-11" />
@@ -13,11 +13,9 @@ To mark selected text bold we can use `this.editor.bold`. There a ton of other c
You might wonder what features tiptap supports out of the box. In the above example we added the `@tiptap/starter-kit`. That already includes support for paragraphs, text, bold, italic, inline code and code blocks. There are a lot more, but you have to explicitly import them. You will learn how that works in the next example.
### Related Links
* [List of available commands](/api/commands)
## Configure extensions
You are free to choose which parts of tiptap you want to use. Tiptap has support for different nodes (paragraphs, blockquotes, tables and many more) and different marks (bold, italic, links). If you want to explicitly configure what kind of nodes and marks are allowed and which are not allowed, you can configure those.
Note that `Document`, `Paragraph` and `Text` are required. Otherwise you wont be able to add any plain text.