Skip to content

Commit

Permalink
feat(vue): add code block
Browse files Browse the repository at this point in the history
  • Loading branch information
litingyes committed Mar 9, 2024
1 parent 2e13797 commit 0a4a99a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/guide/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const { editor } = useNoteEditor({

- [Blockquote](https://tiptap.dev/docs/editor/api/nodes/blockquote)
- [BulletList](https://tiptap.dev/docs/editor/api/nodes/bullet-list)
- [CodeBlock](https://tiptap.dev/docs/editor/api/nodes/code-block)
- [Document](https://tiptap.dev/docs/editor/api/nodes/document)
- [HardBreak](https://tiptap.dev/docs/editor/api/nodes/hard-break)
- [Heading](https://tiptap.dev/docs/editor/api/nodes/heading)
Expand Down
1 change: 1 addition & 0 deletions docs/zh-CN/guide/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const { editor } = useNoteEditor({

- [Blockquote](https://tiptap.dev/docs/editor/api/nodes/blockquote)
- [BulletList](https://tiptap.dev/docs/editor/api/nodes/bullet-list)
- [CodeBlock](https://tiptap.dev/docs/editor/api/nodes/code-block)
- [Document](https://tiptap.dev/docs/editor/api/nodes/document)
- [HardBreak](https://tiptap.dev/docs/editor/api/nodes/hard-break)
- [Heading](https://tiptap.dev/docs/editor/api/nodes/heading)
Expand Down
1 change: 1 addition & 0 deletions packages/vue-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@tiptap/extension-bullet-list": "^2.2.4",
"@tiptap/extension-character-count": "^2.2.4",
"@tiptap/extension-code": "^2.2.4",
"@tiptap/extension-code-block": "^2.2.4",
"@tiptap/extension-color": "^2.2.4",
"@tiptap/extension-document": "^2.2.4",
"@tiptap/extension-dropcursor": "^2.2.4",
Expand Down
5 changes: 5 additions & 0 deletions packages/vue-kit/src/setupKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { CharacterCountOptions } from '@tiptap/extension-character-count'
import { CharacterCount } from '@tiptap/extension-character-count'
import type { CodeOptions } from '@tiptap/extension-code'
import { Code } from '@tiptap/extension-code'
import type { CodeBlockOptions } from '@tiptap/extension-code-block'
import type { ColorOptions } from '@tiptap/extension-color'
import { Color } from '@tiptap/extension-color'
import Document from '@tiptap/extension-document'
Expand Down Expand Up @@ -77,6 +78,7 @@ export interface SetupKitOptions {
bulletList: Partial<BulletListOptions> | false
characterCount: Partial<CharacterCountOptions> | false
code: Partial<CodeOptions> | false
codeBlock: Partial<CodeBlockOptions> | false
color: Partial<ColorOptions> | false
document: false
dropcursor: Partial<DropcursorOptions> | false
Expand Down Expand Up @@ -130,6 +132,9 @@ export const setupKit = Extension.create<SetupKitOptions>({
if (this.options.code !== false)
extensions.push(Code.configure(this.options.code))

if (this.options.codeBlock !== false)
extensions.push(Code.configure(this.options.codeBlock))

if (this.options.color !== false)
extensions.push(Color.configure(this.options.color))

Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0a4a99a

Please sign in to comment.