Skip to content

Markdown Extension Examples

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

Syntax Highlighting

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!'
    }
  }
}

Custom Containers

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.

Mermaid

mermaid
graph LR
  a --> b

MathJax

$$
\begin{align}
\text{Let } \aleph_0 & = \omega \ \omega \\
\text{where } \omega & = \lambda x . x \ x
\end{align}
$$

Let $\aleph_0 = \omega \ \omega$ where $\omega = \lambda x . x \ x$.
Let 0=ω ωwhere ω=λx.x x

Let 0=ω ω where ω=λx.x x.

Data & Vue

CSV 1

col1col2
Item 120240806
Item 2 20240806

CSV 2

col1col2col3
Item 320240806foo
Item 420240806bar
Item 520240806baz

More

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