mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
62 lines
1.6 KiB
TypeScript
62 lines
1.6 KiB
TypeScript
import {
|
|
defineConfig,
|
|
defineDocs,
|
|
frontmatterSchema,
|
|
metaSchema,
|
|
} from "fumadocs-mdx/config";
|
|
import { z } from "zod";
|
|
|
|
import { fileGenerator, remarkDocGen, remarkInstall } from "fumadocs-docgen";
|
|
import { rehypeCode } from "fumadocs-core/mdx-plugins";
|
|
import {
|
|
transformerNotationDiff,
|
|
transformerNotationHighlight,
|
|
transformerNotationWordHighlight,
|
|
} from "@shikijs/transformers";
|
|
import { remarkMermaid } from "@theguild/remark-mermaid";
|
|
|
|
// Extend the frontmatter schema to include hideHeader, hideTOC, and doc_type fields
|
|
const extendedFrontmatterSchema = frontmatterSchema.extend({
|
|
hideHeader: z.boolean().optional(),
|
|
hideTOC: z.boolean().optional(),
|
|
doc_type: z
|
|
.enum(["how-to", "explanation", "reference", "tutorial"])
|
|
.optional(),
|
|
});
|
|
|
|
// You can customise Zod schemas for frontmatter and `meta.json` here
|
|
// see https://fumadocs.vercel.app/docs/mdx/collections#define-docs
|
|
export const docs = defineDocs({
|
|
docs: {
|
|
schema: extendedFrontmatterSchema,
|
|
},
|
|
meta: {
|
|
schema: metaSchema,
|
|
},
|
|
});
|
|
|
|
export default defineConfig({
|
|
mdxOptions: {
|
|
rehypePlugins: [
|
|
[
|
|
rehypeCode,
|
|
{
|
|
transformers: [
|
|
transformerNotationDiff({ matchAlgorithm: "v3" }),
|
|
transformerNotationHighlight({ matchAlgorithm: "v3" }),
|
|
transformerNotationWordHighlight({ matchAlgorithm: "v3" }),
|
|
],
|
|
},
|
|
],
|
|
],
|
|
remarkPlugins: [
|
|
remarkMermaid,
|
|
[remarkInstall, { persist: { id: "package-manager" } }],
|
|
[remarkDocGen, { generators: [fileGenerator()] }],
|
|
],
|
|
remarkNpmOptions: {
|
|
persist: { id: "package-manager" },
|
|
},
|
|
},
|
|
});
|