mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
e9e6fbdd85
Co-authored-by: Max Korp <maxkorp@8bytealchemy.com> Co-authored-by: Santiago Cubino <scubino@litebox.ai> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
63 lines
1.5 KiB
TypeScript
63 lines
1.5 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 and hideTOC fields
|
|
const extendedFrontmatterSchema = frontmatterSchema.extend({
|
|
hideHeader: z.boolean().optional(),
|
|
hideTOC: z.boolean().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" },
|
|
},
|
|
},
|
|
});
|