Migration to Latest
Legacy Mode
You can pass the second argument true
to enable legacy mode when calling mdEnhancePlugin
, and the plugin will try to run with V1 behavior.
New Features
Markdown link check
The plugin now check your Markdown links and warn you when broken links are detected.
You can control this behavior with
checkLinks
optionimage mark support
Use
#light
and#dark
suffix to mark images to display them in light mode or dark mode viaimgMark
option.v-pre
supportThe following container support is removed from
@vuepress/core
, sovPre
option is added::: v-pre Some {{vue syntax}}. :::
Use
component
code block to add components easilyChart.js support
Adds chart.js support via
chart
option::: chart Title ```json { // chart.js config } ``` ::: ::: chart Title ```js const config = { // chart.js config }; ``` :::
ECharts support
Adds ECharts support via
echarts
option::: echarts Title ```json { // chart.js config } ``` ::: ::: echarts Title ```js const option = { // chart.js config }; ``` :::
content include support
Use
<!-- @include: -->
to include other file content in Markdown viainclude
options.Use
<!-- @include: filename -->
to include a file.To partially import the file, you can specify the range of lines to be included:
<!-- @include: filename{start-end} -->
<!-- @include: filename{start-} -->
<!-- @include: filename{-end} -->
Also, you can include file region:
<!-- @include: filename#region -->
tabs support
Use
tabs
container to create tabs viatabs
option.markmap support
Add
markmap
container to create Markmap viamarkmap
option.Playground
Embed interactive demo with official presets and custom options
Kotlin Playground
Provide Kotlin playground via
kotlin-playground
Vue Playground
Provide Vue playground via
@vue/repl
Mathjax Support
Add
mathjax
option to enable Mathjax supportGFM Alerts
Support GFM alerts via
alert
option
Changed
Now all options are disabled by default
renamed
container
tohint
To align with GFM,
danger
container is renamed tocaution
, also important and note containers are addedrenamed
codegroup
tocodetabs
Code demo syntax changed
Before:
::: demo Title <!-- demo content --> ::: ::: demo [vue] Title <!-- demo content --> ::: ::: demo [react] Title <!-- demo content --> :::
After:
::: normal-demo Title <!-- demo content --> ::: ::: vue-demo Title <!-- demo content --> ::: ::: react-demo Title <!-- demo content --> :::
Code Group changed to code tab
Before:
:::: code-group ::: code-group-item pnpm ```bash pnpm create vuepress-theme-hope [dir] ``` ::: ::: code-group-item npm:active ```bash npm init vuepress-theme-hope [dir] ``` ::: ::::
After:
::: code-tabs @tab pnpm ```bash pnpm create vuepress-theme-hope [dir] ``` @tab:active npm ```bash npm init vuepress-theme-hope [dir] ``` :::
presentation
is rebuilt toreveal.js
Support theme tree-shaking, and you can customize Reveal.js via client config file
Removed Options
enableAll
removedThere are too many noob users who don't know what they are doing, and they just enable this option without using all the feature provided, yet they complain about load speed.
lineNumbers
removedVuePress 2 supports line number config per code block now.
imageFix
removedMr.Hope already made a PR to fix broken image links in Markdown, so it's no longer needed
Options Adjustments in Pre-release Version
container
is renamed tohint
lazyload
andimageLazyload
are renamed toimgLazyload
imageMark
is renamed toimgMark
mdImport
is renamed toinclude
tex
(Using katex) is renamed tokatex
vpre
is renamed tovPre
imageTitle
is renamed tofigure
revealjs
is renamed torevealJS
linkCheck
is replaced bycheckLinks
card
is replaced bycomponents
mermaid
revealJs
vuePlayground
no longer accept lib options