-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource.config.ts
More file actions
39 lines (37 loc) · 1.09 KB
/
Copy pathsource.config.ts
File metadata and controls
39 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
import { remarkMdxMermaid } from "fumadocs-core/mdx-plugins";
import rehypeKatex from "rehype-katex";
import remarkMath from "remark-math";
import { remarkWikilinks } from "./lib/remark-wikilinks";
import { normalizeProtected } from "./lib/protected-field";
import { normalizeTags } from "./lib/tags";
import { z } from "zod";
export const docs = defineDocs({
dir: "content",
docs: {
schema: pageSchema.extend({
tags: z
.union([z.string(), z.array(z.string())])
.optional()
.transform(normalizeTags),
protected: z
.union([z.boolean(), z.string()])
.optional()
.transform(normalizeProtected),
}),
postprocess: {
includeProcessedMarkdown: true,
extractLinkReferences: true,
},
},
meta: {
schema: metaSchema,
},
});
export default defineConfig({
mdxOptions: {
remarkPlugins: [remarkWikilinks, remarkMdxMermaid, remarkMath],
rehypePlugins: (v) => [rehypeKatex, ...v],
},
});