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!'
}
}
}
```
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Output
js
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
1
2
3
4
5
6
7
2
3
4
5
6
7
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.
:::
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Output
細節:
This is an info box.
💡 錦囊 [Tips]:
This is a tip.
⚡ 注意 [Warning]:
This is a warning.
⛔ 錯誤 [Error]:
This is a dangerous warning.
詳細資料 [Details]:
This is a details block.
More
Check out the documentation for the full list of markdown extensions.