# Fumadocs (Framework Mode, Waku): Markdown
URL: /docs/waku/markdown
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/[framework]/markdown/index.mdx

The Markdown syntax of Fumadocs pages.

Pages are written in [MDX](https://mdxjs.com/docs/what-is-mdx), Markdown with JSX, and support [GitHub Flavored Markdown](https://github.github.com/gfm) like tables and autolinks.

```mdx
import { Chart } from '@/components/chart';

Read the [guide](/docs/guide), or visit https://github.com.

<Chart data={[1, 2, 3]} />
```

External links open in a new tab, while internal links use the `Link` component of your framework.

## Frontmatter [#frontmatter]

The docs page renders `title` and `description` as its header, so the content starts without a `# Heading`.

```mdx
---
title: Deploy
description: Deploy your site.
---

## Requirements
```

An MDX page can also export its frontmatter in code. The export is merged over the YAML frontmatter, and can read [props](#props):

```mdx
---
title: Deploy
---

export const frontmatter = {
  description: `Deploy your ${props.framework} site.`,
};
```

To add frontmatter properties, define the [`schema`](/docs/mdx/collections#schema-1) of the collection.

## Headings [#headings]

Each heading gets an ID from its text, for links like `/docs/page#hello-world`.

```md
## Hello World

<!-- a custom ID: #install -->

## Installation [#install]

<!-- hidden from the table of contents -->

## Changelog [!toc]

<!-- only in the table of contents, for a heading rendered by a component -->

## API Reference [toc]
```

## Code Blocks [#code-blocks]

Code blocks are highlighted with Shiki.

````mdx
```js title="config.js" lineNumbers
console.log('Hello World');
```
````

```js title="config.js" lineNumbers
console.log('Hello World');
```

`lineNumbers=4` starts the line numbers from 4, and `noCopy` hides the copy button.

### Highlighting Lines [#highlighting-lines]

Mark lines with comments, which are removed from the output:

````md tab="Input"
```tsx
<div>Hello World</div> // [\!code highlight]

// [\!code word:Fumadocs]
<div>Fumadocs</div>

console.log('hewwo'); // [\!code --]
console.log('hello'); // [\!code ++]

return new ResizeObserver(() => {}) // [\!code focus]
```
````

```tsx tab="Output"
<div>Hello World</div> // [!code highlight]

// [!code word:Fumadocs]
<div>Fumadocs</div>

console.log('hewwo'); // [!code --]
console.log('hello'); // [!code ++]

return new ResizeObserver(() => {}) // [!code focus]
```

These are the [notations of Shiki Transformers](https://shiki.style/packages/transformers).

### Tab Groups [#tab-groups]

Adjacent code blocks with a `tab` form a tab group:

````mdx
```ts tab="Tab 1"
console.log('A');
```

```ts tab="Tab 2"
console.log('B');
```
````

```ts tab="Tab 1"
console.log('A');
```

```ts tab="Tab 2"
console.log('B');
```

Tab groups with the same `tab-group` on their first code block switch together, and remember the selected tab across visits:

````mdx
```bash tab="npm" tab-group="package-manager"
npm i fumadocs-core
```

```bash tab="pnpm"
pnpm add fumadocs-core
```
````

```bash tab="npm" tab-group="package-manager"
npm i fumadocs-core
```

```bash tab="pnpm"
pnpm add fumadocs-core
```

To write MDX in tab names, enable `parseMdx`:

```ts tab="unified" title="source.config.ts"
import { defineConfig } from 'fumadocs-mdx/config';

export default defineConfig({
  mdxOptions: {
    remarkCodeTabOptions: {
      parseMdx: true,
    },
  },
});
```

```ts tab="Sätteri" title="source.config.ts"
import { defineConfig, defineDocs } from 'fumadocs-mdx/config';

export const docs = defineDocs({
  docs: { compiler: 'satteri' },
});

export default defineConfig({
  satteriOptions: {
    remarkCodeTabOptions: {
      parseMdx: true,
    },
  },
});
```

````mdx
```ts tab="<Building /> Tab 1"
console.log('A');
```

```ts tab="<Rocket /> Tab 2"
console.log('B');
```
````

```ts tab="<Building /> Tab 1"
console.log('A');
```

```ts tab="<Rocket /> Tab 2"
console.log('B');
```

### Install Commands [#install-commands]

An `npm` code block becomes a tab group of package managers:

````md
```npm
npm i next -D
```
````

```npm
npm i next -D
```

## Components [#components]

These components are available in MDX by default. See [Components](/docs/ui/components) for more, like tabs and accordions.

### Callouts [#callouts]

```mdx
{/* type: info (default), warn, error, success or idea */}

<Callout>Hello World</Callout>

<Callout title="Title" type="warn">
  Hello World
</Callout>
```

<Callout>
Hello World
</Callout>

<Callout title="Title" type="warn">
Hello World
</Callout>

### Cards [#cards]

```mdx
import { HomeIcon } from 'lucide-react';

<Cards>
  <Card href="/docs" title="Documentation">
    Browse the full documentation.
  </Card>
  <Card icon={<HomeIcon />} href="/" title="Home">
    Cards can have icons.
  </Card>
  <Card title="Plain Card">Without `href`, a card is not a link.</Card>
</Cards>
```

<Cards>
<Card href="/docs" title="Documentation">
Browse the full documentation.
</Card>

<Card href="/" title="Home">
Cards can have icons.
</Card>

<Card title="Plain Card">
Without `href`, a card is not a link.
</Card>
</Cards>

### Steps [#steps]

After enabling [Remark Steps](/docs/headless/mdx/remark-steps), headings with `[step]` become numbered steps:

```md
### Install [step]

### Write Code [step]

### Deploy [step]
```

#### Install [step] [#install]

#### Write Code [step] [#write-code]

#### Deploy [step] [#deploy]

## Include [#include]

`<include>` embeds another file, with a path relative to the current file:

```mdx title="page.mdx"
<include>./shared/requirements.mdx</include>
```

It can also embed code files and sections of a document, see [Include](/docs/mdx/include).

## Props [#props]

A page receives its [path params](/docs/waku/page-conventions#path-params) as `props`, like `framework` for a page in a `[framework]` folder:

```mdx title="[framework]/deploy.mdx"
{/* the ID is `deploy-on-astro` on the Astro page */}

## Deploy on {props.framework}

Deploy your {props.framework} site.
```

The table of contents, the search index and the Markdown for LLMs get the rendered text too. You can also pass [custom props](/docs/headless/source-api#custom-props) to a page.

### Show [#show]

`<show>` renders its content when the `when` expression is true:

```mdx title="[framework]/deploy.mdx"
### Build [step]

<show when={props.framework === 'astro'}>

### Add an Adapter [step]

Add an adapter to your Astro config.

</show>

{/* step 3 on the Astro page, step 2 on the others */}

### Deploy [step]
```

Content that isn't rendered is also left out of the table of contents, the search index and the Markdown for LLMs. A code block of a [tab group](#tab-groups) works the same way: its tab only appears when the code block is rendered.