Skip to content

Markdown 扩展例子

This page demonstrates some of the built-in markdown extensions provided by VitePress.

语法高亮

VitePress provides Syntax Highlighting powered by Shiki, with additional features like line-highlighting:

Input

md
```js{4}
export default {
  data () {
    return {
      msg: 'Highlighted!'
    }
  }
}
```

Output

js
export default {
  data () {
    return {
      msg: 'Highlighted!'
    }
  }
}

自定义容器

Input

md
::: 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.
:::

Output

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.

数学公式

积分与求和的组合测试(涉及字体、界限、分数)这个公式结合了积分、求和、希腊字母、mathbb 字体和特殊的数学运算符。

Rn(k=11k!)F{f(x)}v dnx

公式解读(涉及的 KaTeX/LaTeX 元素):

字体Rn表示实数空间(双线字体)

求和符号及上下界 k=1

分数1k!

复杂的嵌套分数和阶乘根号k!

平方根mathcal

字体F花体字母

梯度向量微分算子

粗体向量v粗体字母,常用于向量

a 变量

dnx微元符号

More

Check out the documentation for the full list of markdown extensions.