markdownSE

作者:姚博文 · 2026-08-12

![](/uploads/attachments/ann_8802c8809d24d55c.jpg "=422x393")

Markdown 扩展

VitePress 带有内置的 Markdown 扩展。

GitHub 风格的表格

**输入**

**输出**

| Tables | Are | Cool |

| --- | --- | --- |

| col 3 is | right-aligned | $1600 |

| col 2 is | centered | $12 |

| zebra stripes | are neat | $1 |

Emoji 🎉

**输入**

**输出**

🎉 💯

这里可以找到[所有支持的 emoji 列表](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.mjs)。

目录表 (TOC)

**输入**

**输出**

\[\[toc\]\]

可以使用 `markdown.toc` 选项配置 TOC 的呈现效果。

自定义容器

自定义容器可以通过它们的类型、标题和内容来定义。

默认标题

**输入**

**输出**

::: info 信息

This is an info box.

:::

::: tip 提示

This is a tip.

:::

::: warning 警告

This is a warning.

:::

::: danger 注意

This is a dangerous warning.

:::

::: details 详细信息

This is a details block.

:::

自定义标题

可以通过在容器的 "type" 之后附加文本来设置自定义标题。

**输入**

console.log('Hello, VitePress!')

**输出**

STOP

危险区域,请勿继续

::: details 点我查看代码

:::

GitHub 风格的警报

VitePress 同样支持以标注的方式渲染 [GitHub 风格的警报](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts)。它们和[自定义容器](#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8)的渲染方式相同。

[!NOTE]