Fumadocs

全局选项

自定义 Fumadocs MDX

全局选项

🌐 Global Options

Fumadocs MDX 的共享选项。

🌐 Shared options of Fumadocs MDX.

source.config.ts
import { defineConfig } from 'fumadocs-mdx/config';

export default defineConfig({
  // global options
});

Prop

Type

MDX 选项

🌐 MDX Options

自定义 默认 MDX 预设

🌐 Customise the default MDX preset.

source.config.ts
import { defineConfig } from 'fumadocs-mdx/config';
import rehypeKatex from 'rehype-katex';
import remarkMath from 'remark-math';

export default defineConfig({
  mdxOptions: {
    remarkPlugins: [remarkMath],
    // When order matters
    rehypePlugins: (v) => [rehypeKatex, ...v],
  },
});

或者使用最小预设:

🌐 Or using the minimal preset:

source.config.ts
import { defineConfig } from 'fumadocs-mdx/config';

export default defineConfig({
  mdxOptions: {
    preset: 'minimal',
    // now it accepts only MDX processor options
  },
});

Last updated on

On this page