-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsource.config.ts
More file actions
117 lines (111 loc) · 3.02 KB
/
Copy pathsource.config.ts
File metadata and controls
117 lines (111 loc) · 3.02 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import {
transformerMetaHighlight,
transformerMetaWordHighlight,
transformerNotationDiff,
transformerNotationErrorLevel,
transformerNotationFocus,
transformerNotationHighlight,
transformerNotationWordHighlight,
transformerRemoveLineBreak,
transformerRemoveNotationEscape,
} from '@shikijs/transformers'
import { defineConfig, defineDocs, frontmatterSchema, metaSchema } from 'fumadocs-mdx/config'
// import lastModified from 'fumadocs-mdx/plugins/last-modified'
import { z } from 'zod'
import { agentMarkdownOptions, remarkAgentImageSources, remarkStripMdxComments } from './lib/agent-docs/mdx-projection'
export default defineConfig({
// plugins: [lastModified()],
mdxOptions: {
remarkPlugins: [remarkStripMdxComments, remarkAgentImageSources],
rehypeCodeOptions: {
themes: {
light: 'github-light',
dark: 'github-dark',
},
addLanguageClass: true,
transformers: [
transformerMetaHighlight({
className: 'line-highlighted',
}),
transformerMetaWordHighlight({
className: 'word-highlighted',
}),
transformerNotationHighlight({
classActiveLine: 'line-highlighted',
}),
transformerNotationDiff({
classLineAdd: 'line-diff-add',
classLineRemove: 'line-diff-remove',
}),
transformerNotationFocus({
classActiveLine: 'line-focused',
}),
transformerNotationErrorLevel({
classMap: {
error: ['line-highlighted', 'line-error'],
warning: ['line-highlighted', 'line-warning'],
info: ['line-highlighted', 'line-info'],
},
}),
transformerNotationWordHighlight({
classActiveWord: 'word-highlighted',
classActivePre: 'has-word-highlighted',
}),
transformerRemoveLineBreak(),
transformerRemoveNotationEscape(),
],
},
},
})
// You can customise Zod schemas for frontmatter and `meta.json` here
// see https://fumadocs.vercel.app/docs/mdx/collections#define-docs
export const guides = defineDocs({
dir: './content/guides',
docs: {
postprocess: {
includeProcessedMarkdown: agentMarkdownOptions,
},
schema: frontmatterSchema,
},
meta: {
schema: metaSchema,
},
})
export const reference = defineDocs({
dir: './content/reference',
docs: {
postprocess: {
includeProcessedMarkdown: agentMarkdownOptions,
},
schema: frontmatterSchema,
},
meta: {
schema: metaSchema,
},
})
export const icons = defineDocs({
dir: './content/icons',
docs: {
postprocess: {
includeProcessedMarkdown: agentMarkdownOptions,
},
schema: frontmatterSchema,
},
meta: {
schema: metaSchema,
},
})
export const blog = defineDocs({
dir: './content/blog',
docs: {
files: ['**/*.mdx', '!weekly-*.mdx'],
schema: frontmatterSchema.extend({
author: z.string(),
date: z.iso.date().or(z.date()),
deprecated: z.boolean().optional(),
}),
},
meta: {
schema: metaSchema,
},
})