Markdown

The following is translated from Chinese by ChatGPT.

About markdown-it

VuePress 2 uses markdown-it as the parser for Markdown-formatted content. This parser follows the CommonMark Spec specification and provides many extension features.

In addition to the built-in Tables (GFM) and Strikethrough (GFM) features, markdown-it's plugin-based design provides rich choices for other extended syntax or features. Here is a list of related plugins available on npm.

VuePress 2 Extensions

Thanks to VuePress's good infrastructure, we can use the markdown.* configuration option to configure all markdown-it configuration options and VuePress 2's extension configuration options.

These configuration options are independent of any theme and this theme provides them with a consistent style, so you can use them with confidence.

Custom Containers

VuePress 2 encapsulates the markdown-it-container plugin of markdown-it through the @vuepress/container plugin to make it more convenient to use. This theme also uses this plugin to support the following 4 custom containers.

::: tip
This is a tip.
:::

::: warning
This is a warning.
:::

::: danger
This is a danger.
:::

::: details
This is a details tag, which doesn't work in IE/Edge.
:::

The rendered result is as follows:

Tip

This is a tip.

Warning

This is a warning.

Danger

This is a danger.

This is a details tag, which doesn't work in IE/Edge.