halo/console/docs/extension-points/default-editor–extension.md

20 lines
643 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 默认编辑器扩展点
该扩展点用于扩展默认编辑器的功能,包括 Tiptap Extension以及工具栏、悬浮工具栏、Slash Command。
## 定义方式
```ts
import ExtensionFoo from "./tiptap/extension-foo.ts"
export default definePlugin({
extensionPoints: {
"default:editor:extension:create": () => {
return [ExtensionFoo];
},
},
});
```
其中,`ExtensionFoo` 是一个 Tiptap Extension可以参考 [Tiptap 文档](https://tiptap.dev/) 和 [https://github.com/halo-sigs/richtext-editor/blob/main/docs/extension.md](https://github.com/halo-sigs/richtext-editor/blob/main/docs/extension.md)。