Getting Started
Learn how to use Fumadocs MDX in your documentation
Introduction
fumadocs-mdx
is the official content source of Fumadocs. It parses frontmatter and is bundled with many MDX
plugins for building a good documentation site.
This package must be used with Fumadocs
Getting Started
Install Dependencies
Configuration
Add the plugin to your next.config.mjs
file.
It generates a .source
folder once you start the dev server or start building the app.
The folder contains all parsed files, you should add it to .gitignore
.
ESM Only
The Next.js config must be a .mjs
file since Fumadocs is ESM-only.
To configure Fumadocs MDX, create a config file.
Post Install
You can add a post install script to generate types before executing CLI tools (e.g. ESLint).
Resolve Files
To integrate with Fumadocs, create:
For more customisation options, check Source API.
Start Server
A .source
folder should be created. You can log and see if it is loaded correctly.
See Pages Conventions to learn how to organize your pages.
Usages
Usually, you'll interact with Fumadocs MDX through Source API (the loader
).
You can see the type definitions to find the available properties.
To render the page, pass components to the body.
FAQ
Built-in Properties
These properties are exported from MDX files by default.
Property | Description |
---|---|
frontmatter | Frontmatter |
toc | Table of Contents |
structuredData | Structured Data, useful for implementing search |
MDX Plugins
You can customise the options passed to the MDX processor.
See Configuration to learn more.
Last updated on