Fumadocs

Remark Admonition

Use Admonition in Fumadocs

In Docusaurus, there's an Admonition syntax.

For people migrating from Docusaurus, you can enable this remark plugin to support the Admonition syntax.

Usage

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

export default defineConfig({
  mdxOptions: {
    remarkPlugins: [remarkAdmonition],
  },
});
import { compile } from '@mdx-js/mdx';
import { remarkAdmonition } from 'fumadocs-core/mdx-plugins';

await compile('...', {
  remarkPlugins: [remarkAdmonition],
});

Input

:::warning
Hello World
:::

Output

<Callout type='warn'>

Hello World

</Callout>

When to use

We highly recommend using the JSX syntax of MDX instead. It's more flexible, some editors support IntelliSense in MDX files.

<Callout type='warn'>

Hello World

</Callout>

How is this guide?

Last updated on