Plugin Exports
All plugins are exported fromfumadocs-core/mdx-plugins:
packages/core/src/mdx-plugins/index.ts
Remark Plugins
remarkHeading
Generate heading IDs and extract table of contents./packages/core/src/mdx-plugins/remark-heading.ts:41
Features:
- Automatic slug generation using
github-slugger - Custom ID syntax:
## Title [#custom-id] - TOC data attached to
file.data.toc
remarkStructure
Extract structured content for search indexing./packages/core/src/mdx-plugins/remark-structure.ts:155
Default Types:
remarkImage
Optimize images for Next.js./packages/core/src/mdx-plugins/remark-image.ts:82
Features:
- Automatic width/height detection
- Image imports for bundler optimization
- Blur placeholder for JPEG, PNG, WebP, AVIF
- External image size fetching
remarkCodeTab
Create tabbed code blocks./packages/core/src/mdx-plugins/remark-code-tab.ts:178
Usage:
/packages/core/src/mdx-plugins/remark-steps.ts:27
Pattern: Headings starting with 1. , 2. , etc.
remarkDirectiveAdmonition
Directive-based admonitions (recommended)./packages/core/src/mdx-plugins/remark-directive-admonition.ts:29
Requires: remark-directive package
remarkAdmonition
Legacy Docusaurus-style admonitions (deprecated)./packages/core/src/mdx-plugins/remark-admonition.ts:22
Note: Use remarkDirectiveAdmonition instead for better syntax support.
Rehype Plugins
rehypeCode
Syntax highlighting with Shiki./packages/core/src/mdx-plugins/rehype-code.ts:18
Default Options (from /packages/core/src/mdx-plugins/rehype-code.core.ts:19):
['js', 'jsx', 'ts', 'tsx'] are preloaded. Other languages load on-demand.
Code Block Metadata
Code blocks support rich metadata parsing.Meta String Parsing
From/packages/core/src/mdx-plugins/codeblock-utils.ts:97:
Supported Attributes
Utility Functions
parseCodeBlockAttributes
Parse Fumadocs-style code block attributes:generateCodeBlockTabs
Programmatically create code block tabs:Configuration Patterns
Minimal Setup
source.config.ts
Full-Featured Setup
source.config.ts
Custom Transformers
Plugin Order
Plugin order matters! Recommended order:Remark (Markdown → MDX)
remarkHeading- Generate heading IDs firstremarkImage- Process imagesremarkDirective- Enable directive syntaxremarkDirectiveAdmonition- Process admonitionsremarkCodeTab- Group code blocks into tabsremarkSteps- Convert numbered headingsremarkStructure- Extract content (should be last)
Rehype (HTML transformations)
rehypeCode- Syntax highlightingrehypeToc- Table of contents rendering