-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathsource.config.ts
More file actions
43 lines (39 loc) · 1.23 KB
/
Copy pathsource.config.ts
File metadata and controls
43 lines (39 loc) · 1.23 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 } from "fumadocs-mdx/config";
import { rehypeCodeDefaultOptions } from "fumadocs-core/mdx-plugins";
import type { ShikiTransformer } from "shiki";
import { remarkCooldowns } from "./lib/remark/cooldowns";
import { remarkFunctionLinks } from "./lib/remark/function-links";
import { remarkCachedImages } from "./lib/remark/images";
import { cclang, cc_dark, cc_light } from "./lib/cclang";
const transformerLineNumbers: ShikiTransformer = {
name: "shiki-transformer-line-numbers",
pre(node) {
node.properties["data-line-numbers"] = "";
},
};
export default defineConfig({
mdxOptions: {
remarkPlugins: (v) => [
remarkCooldowns,
remarkFunctionLinks,
remarkCachedImages,
...v,
],
remarkImageOptions: {
external: false,
onError: "ignore",
},
rehypeCodeOptions: {
...rehypeCodeDefaultOptions,
themes: {
light: cc_light,
dark: cc_dark,
},
transformers: [
...(rehypeCodeDefaultOptions.transformers ?? []),
transformerLineNumbers,
],
langs: [cclang],
},
},
});