refactor: migrate documentation to support multi-language structure with i18n integration
Some checks failed
Documentation Lint / lint (push) Failing after 4m46s
Some checks failed
Documentation Lint / lint (push) Failing after 4m46s
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
||||
import type { MDXComponents } from 'mdx/types';
|
||||
import defaultMdxComponents from "fumadocs-ui/mdx";
|
||||
import type { MDXComponents } from "mdx/types";
|
||||
import { Mermaid } from "@/components/mdx/mermaid";
|
||||
|
||||
export function getMDXComponents(components?: MDXComponents): MDXComponents {
|
||||
return {
|
||||
...defaultMdxComponents,
|
||||
...components,
|
||||
};
|
||||
return {
|
||||
...defaultMdxComponents,
|
||||
...components,
|
||||
pre: ({ children, ...props }: any) => {
|
||||
if (
|
||||
children &&
|
||||
typeof children === "object" &&
|
||||
"type" in children &&
|
||||
(children as any).type === "code" &&
|
||||
(children as any).props.className === "language-mermaid"
|
||||
) {
|
||||
return <Mermaid chart={(children as any).props.children} />;
|
||||
}
|
||||
return <defaultMdxComponents.pre {...props}>{children}</defaultMdxComponents.pre>;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user