---
title: Markdown basics
subtitle: Pages use MDX — standard Markdown (with GFM extensions) plus components. This page lists all supported syntax and how it renders.
description: Markdown and MDX syntax supported by ButterIX — headings and custom anchors, emphasis, links, lists, task lists, tables, blockquotes, footnotes, HTML elements, comments, and escaping.
---

Page files can be `.mdx` or `.md`. Both are parsed as MDX; when a `.md` file fails to parse, it automatically falls back to plain Markdown, which makes migrating old docs straightforward.

## Headings

```mdx
## Level 2 heading
### Level 3 heading
#### Level 4 heading {#custom-anchor}
```

- The page heading comes from the frontmatter `title`; the body starts at `##`.
- Every heading automatically gets an anchor (using the same algorithm as GitHub), and a link icon appears to its left on hover.
- Write `{#custom-id}` at the end of the line to set the anchor explicitly, so old links keep working after the heading is reworded.
- `##` through `####` appear in the "On this page" table of contents on the right; adjust the depth with the frontmatter `max-toc-depth`.

#### This heading uses a custom anchor {#custom-anchor-demo}

The heading above lives at [`#custom-anchor-demo`](#custom-anchor-demo).

## Text styles

| Syntax | Result |
|---|---|
| `**Bold**` | **Bold** |
| `*Italic*` | *Italic* |
| `~~Strikethrough~~` | ~~Strikethrough~~ |
| `` `inline code` `` | `inline code` |
| `<kbd>Ctrl</kbd> + <kbd>K</kbd>` | <kbd>Ctrl</kbd> + <kbd>K</kbd> |
| `<mark>Highlight</mark>` | <mark>Highlight</mark> |
| `H<sub>2</sub>O`, `x<sup>2</sup>` | H<sub>2</sub>O, x<sup>2</sup> |

## Links

```mdx
[Internal page (source file path recommended)](../configuration/navigation.mdx)
[With an anchor](../configuration/navigation.mdx#slug-rules)
[Internal URL](/guides/get-started/quickstart)
[External link](https://commonmark.org)
```

- **Linking to source files** (`.mdx` paths) **is recommended**. The builder replaces them with the target page's URL in the current locale and version; when the target doesn't exist, `biti check` reports `link/broken`.
- External links automatically open in a new tab and get a ↗ icon: [CommonMark spec](https://commonmark.org).
- Internal URLs starting with `/` stay in the current locale and version: `/llms.txt` on an English page points to `/en/llms.txt`, and `/guides/x` on a v0 page to `/v0/guides/x`. When the target doesn't exist there, the default version and then the URL as written are used; see [Links and images](../features/i18n.mdx#links-and-images).
- MDX doesn't support autolinks of the form `<https://…>` (the `<` is treated as a tag); write `[text](url)` instead. GFM's bare URL autolinking still works.

## Lists

<Columns cols={2}>
  <Column>
    ```mdx
    - Unordered list
      - Nested item
    1. Ordered list
    2. Second item
       1. Nested number
    ```
  </Column>
  <Column>
    - Unordered list
      - Nested item

    1. Ordered list
    2. Second item
       1. Nested number
  </Column>
</Columns>

### Task lists

```mdx
- [x] Write docs.yml
- [x] Add the first page
- [ ] Configure a custom domain
```

- [x] Write docs.yml
- [x] Add the first page
- [ ] Configure a custom domain

## Tables

GFM tables support left / center / right alignment. Column widths are estimated from each column's content: columns with the same content always get the same width, and long-text columns get more room. When there are too many columns to fit, the table grows wider than the page column and scrolls horizontally, with shadows on the edges hinting that there is more to see. Use [`<Table>`](../components/table.mdx) to set column widths, a minimum width or a sticky header.

```mdx
| Error | Meaning | Status |
|:---|:---:|---:|
| `unauthorized` | Missing or invalid API key | 401 |
| `not_found` | Resource not found | 404 |
```

| Error | Meaning | Status |
|:---|:---:|---:|
| `unauthorized` | Missing or invalid API key | 401 |
| `not_found` | Resource not found | 404 |

### Merged cells

A cell written as `|>>|` continues the cell on its left (column span); `|^^|` continues the cell above (row span, table body only). Write at least two of the character, touching the pipes on both sides, with no spaces or anything else.

```mdx
| Font | Simplified | Traditional | Japanese |
|---|:---:|:---:|:---:|
| Noto Sans CJK | ✓ | ✓ | ✓ |
| MiSans | ✓ | ✓ | – |
|^^| MiSans L3 covers rare characters |>>|>>|
| LINE Seed | – | ✓ | ✓ |
```

| Font | Simplified | Traditional | Japanese |
|---|:---:|:---:|:---:|
| Noto Sans CJK | ✓ | ✓ | ✓ |
| MiSans | ✓ | ✓ | – |
|^^| MiSans L3 covers rare characters |>>|>>|
| LINE Seed | – | ✓ | ✓ |

To show only these characters in a cell, put a backslash in front:

```mdx
| Operator | Meaning |
|---|---|
| \> | Greater than |
| \>> | Right shift |
| \^ | Exclusive or |
```

| Operator | Meaning |
|---|---|
| \> | Greater than |
| \>> | Right shift |
| \^ | Exclusive or |

<Note>Formatters such as Prettier add spaces next to the pipes, which undoes the merge. Put `{/* prettier-ignore */}` on its own line before a table with merged cells, with a blank line between, or exclude those files from formatting. `biti check` points out `>>` and `^^` with spaces around them.</Note>

For more complex merges (such as multi-row headers), write an HTML `<table>` directly — `colspan` and `rowspan` work, and it gets the same styling and horizontal scrolling as Markdown tables.

## Blockquotes and dividers

> Documentation is part of the product.
>
> — Every engineer who has ever written API docs

---

For prominent notices, use a [callout component](../components/callout.mdx) instead of a blockquote:

<Note>Blockquotes are for quotations; for tips and warnings, use components like `<Note>` and `<Warning>`.</Note>

## Footnotes

```mdx
ButterIX uses Pagefind for site search[^1].

[^1]: Pagefind is a static search library that runs in the browser.
```

ButterIX uses Pagefind for site search[^1].

[^1]: Pagefind is a static search library that runs in the browser; its index is generated at build time.

## Collapsible content

A native `<details>` automatically gets the accordion look:

<details>
  <summary>Why not just use `<Accordion>`?</summary>

  Both render the same result. `<details>` is standard HTML and works in any Markdown renderer; `<Accordion>` also supports icons, descriptions, and opening by default.
</details>

## HTML elements

You can use lowercase HTML tags in MDX, but only elements and attributes on a safe allowlist:

- Allowed: `div`, `span`, `p`, `a`, `img`, `video`, `audio`, `iframe`, the `table` family, `details` / `summary`, `kbd`, `mark`, `sub` / `sup`, `figure`, `svg` and its graphics elements, and more.
- Link and resource URLs are checked for protocol, and things like `javascript:` are removed; **no `on*` event attributes are ever output**.
- `style` can be a string or an object; dangerous CSS (such as `expression()`) is filtered out.
- Tags not on the allowlist (such as `script`, `style`, `form`, `button`) are removed with an `mdx/tag` warning.

```mdx
<div style={{ display: "flex", gap: 8 }}>
  <img src="/assets/favicon.svg" width="32" height="32" alt="" />
  <span>Inline HTML layout</span>
</div>
```

<div style={{ display: "flex", gap: 8, alignItems: "center" }}>
  <img src="/assets/favicon.svg" width="32" height="32" alt="" />
  <span>Inline HTML layout</span>
</div>

## Comments

```mdx
{/* MDX comment: doesn't appear on the page or in the Markdown version */}
<!-- HTML comments work too and are converted automatically -->
```

## Escaping

`{` and `<` have special meaning in MDX. To show them literally in body text:

| To show | Write |
|---|---|
| `{` and `}` | `\{` and `\}`, or put them in inline code |
| `<` | `&lt;`, or put it in inline code |
| A piece of code containing them | Use a code block or inline code; its content isn't parsed |

<Tip>
  When parsing fails, `biti check` reports an `mdx/parse` error with a line number; the cause is usually an "unclosed tag" or an "unescaped `{` / `<`".
</Tip>
