-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsource.config.ts
More file actions
43 lines (41 loc) · 1.43 KB
/
source.config.ts
File metadata and controls
43 lines (41 loc) · 1.43 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
40
41
42
43
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
import { remarkMdxMermaid } from "fumadocs-core/mdx-plugins";
import remarkReplace from "@/lib/remark-replace";
import { CAIRO_REPLACEMENTS as cairoContractReplacements } from "content/contracts-cairo/cairo-replacements";
import { REPLACEMENTS as compactContractReplacements } from "content/contracts-compact/utils/replacements";
// 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({
dir: "content",
// Async mode - enables runtime compilation for faster dev server startup
docs: {
async: true,
// Restrict docs pages to MDX content files.
files: ["**/*.mdx"],
},
// To switch back to sync mode (pre-compilation), comment out the docs config above and uncomment below:
// (sync mode - pre-compiles all content at build time)
// No additional config needed for sync mode - just remove the docs config
});
export default defineConfig({
mdxOptions: {
rehypeCodeOptions: {
fallbackLanguage: "plaintext",
themes: {
light: "github-light",
dark: "github-dark",
},
},
remarkPlugins: [
remarkMath,
remarkMdxMermaid,
[
remarkReplace,
[...cairoContractReplacements, compactContractReplacements],
],
],
rehypePlugins: (v) => [rehypeKatex, ...v],
},
});