Files
copilotkit__copilotkit/docs/source.config.ts
John Rae-Grant e9e6fbdd85 Docs Rebranding with fixes (#2982)
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>
2026-01-08 14:28:26 -08:00

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" },
},
},
});