-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathsource.config.ts
More file actions
51 lines (49 loc) · 2.06 KB
/
Copy pathsource.config.ts
File metadata and controls
51 lines (49 loc) · 2.06 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
44
45
46
47
48
49
50
51
import { rehypeCodeDefaultOptions, remarkMdxMermaid } from 'fumadocs-core/mdx-plugins';
import { pageSchema } from 'fumadocs-core/source/schema';
import { defineConfig, defineDocs } from 'fumadocs-mdx/config';
import { z } from 'zod';
import { axiomCodeDark, axiomCodeLight } from './lib/code-theme';
import { rehypePlaygroundCode } from './lib/rehype-playground-code';
export const docs = defineDocs({
dir: 'content/docs',
docs: {
schema: pageSchema
.extend({
sidebarTitle: z.string().optional(),
keywords: z.array(z.string()).optional(),
// Mintlify link-out: the page is a redirect to this target rather than a document.
url: z.string().optional(),
openapi: z.string().optional(),
noindex: z.boolean().optional(),
mode: z.string().optional(),
})
.catchall(z.unknown()),
postprocess: {
includeProcessedMarkdown: true,
},
},
});
export default defineConfig({
mdxOptions: {
// Imported snippet MDX compiles as standalone modules that never receive the
// components prop page.tsx passes, so they need the provider to pick up the
// shared pre/notice/link mappings from mdx-components.tsx.
providerImportSource: '@/mdx-components',
// ```mermaid fences become <Mermaid chart="…"/> (components/mermaid.tsx)
// instead of Shiki code blocks.
remarkPlugins: [remarkMdxMermaid],
// After fumadocs' pipeline: hoists adjacent Run-in-Playground links onto
// their code block as data-playground for the header pill.
rehypePlugins: (v) => [...v, rehypePlaygroundCode],
// Branded Shiki themes from www (grayscale + brand-orange accents) in
// place of the stock github pair; defaults are spread so the notation
// transformers and meta parsing stay intact.
rehypeCodeOptions: {
...rehypeCodeDefaultOptions,
themes: { light: axiomCodeLight, dark: axiomCodeDark },
// `language-*` lands on the pre so the code-block header can name the
// fence's language (components/docs-code-block.tsx).
addLanguageClass: true,
},
},
});