mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-15 11:51:34 +00:00
46 lines
937 B
TypeScript
46 lines
937 B
TypeScript
import {
|
|
defineConfig,
|
|
defineDocs,
|
|
frontmatterSchema,
|
|
} from "fumadocs-mdx/config"
|
|
import rehypePrettyCode from "rehype-pretty-code"
|
|
import { z } from "zod"
|
|
|
|
import { transformers } from "@/lib/highlight-code"
|
|
|
|
export default defineConfig({
|
|
mdxOptions: {
|
|
rehypePlugins: (plugins) => {
|
|
plugins.shift()
|
|
plugins.push([
|
|
// TODO: fix the type.
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
rehypePrettyCode as any,
|
|
{
|
|
theme: {
|
|
dark: "github-dark",
|
|
light: "github-light-default",
|
|
},
|
|
transformers,
|
|
},
|
|
])
|
|
|
|
return plugins
|
|
},
|
|
},
|
|
})
|
|
|
|
export const docs = defineDocs({
|
|
dir: "content/docs",
|
|
docs: {
|
|
schema: frontmatterSchema.extend({
|
|
links: z
|
|
.object({
|
|
doc: z.string().optional(),
|
|
api: z.string().optional(),
|
|
})
|
|
.optional(),
|
|
}),
|
|
},
|
|
})
|