返回 presentation-ai
code-block-base-kit.tsx
根目录 / src / components / plate / plugins / code-block-base-kit.tsx
1 import {
2 BaseCodeBlockPlugin,
3 BaseCodeLinePlugin,
4 BaseCodeSyntaxPlugin,
5 } from "@platejs/code-block";
6 import { all, createLowlight } from "lowlight";
7
8 import {
9 CodeBlockElementStatic,
10 CodeLineElementStatic,
11 CodeSyntaxLeafStatic,
12 } from "@/components/plate/ui/code-block-node-static";
13
14 const lowlight = createLowlight(all);
15
16 export const BaseCodeBlockKit = [
17 BaseCodeBlockPlugin.configure({
18 node: { component: CodeBlockElementStatic },
19 options: { lowlight },
20 }),
21 BaseCodeLinePlugin.withComponent(CodeLineElementStatic),
22 BaseCodeSyntaxPlugin.withComponent(CodeSyntaxLeafStatic),
23 ];
24
24 lines Plain Text