forked from recallnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource.config.ts
More file actions
54 lines (52 loc) · 1.61 KB
/
source.config.ts
File metadata and controls
54 lines (52 loc) · 1.61 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
import { remarkMermaid } from "@theguild/remark-mermaid";
import { rehypeCodeDefaultOptions } from "fumadocs-core/mdx-plugins";
import { remarkImage } from "fumadocs-core/mdx-plugins";
import { remarkInstall } from "fumadocs-docgen";
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
import { transformerTwoslash } from "fumadocs-twoslash";
import { createFileSystemTypesCache } from "fumadocs-twoslash/cache-fs";
import rehypeKatex from "rehype-katex";
import remarkMath from "remark-math";
import { BundledLanguage, bundledLanguages } from "shiki";
export const { docs, meta } = defineDocs({
dir: "docs",
docs: {
// Ignore any files with `_` prefix
files: ["**/*.mdx", "!**/_*.mdx"],
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}) as { docs: any; meta: any };
export default defineConfig({
mdxOptions: {
remarkPlugins: [
remarkMath,
remarkMermaid,
[
remarkInstall,
{
persist: {
id: "package-install",
},
},
],
[remarkImage, { useImport: true, publicDir: "public" }],
],
rehypePlugins: (v) => [rehypeKatex, ...v],
rehypeCodeOptions: {
lazy: true,
experimentalJSEngine: true,
langs: Object.keys(bundledLanguages).map((lang) => lang as BundledLanguage),
inline: "tailing-curly-colon",
themes: {
light: "github-light",
dark: "github-dark",
},
transformers: [
...(rehypeCodeDefaultOptions.transformers ?? []),
transformerTwoslash({
typesCache: createFileSystemTypesCache(),
}),
],
},
},
});