Add markdown-it-attrs plugin for custom headers anchors

Syntax: # Header {#header-id}
This commit is contained in:
Oleg Kalachev
2022-04-12 02:00:30 +04:00
parent bc032e5afb
commit ea5151db51
2 changed files with 5 additions and 1 deletions

View File

@@ -48,7 +48,10 @@ module.exports = {
code: {
lineNumbers: false
},
linkify: true
linkify: true,
},
extendsMarkdown(md) {
md.use(require('markdown-it-attrs')); // to use custom headers anchors
},
plugins: [
'@vuepress/plugin-search',

View File

@@ -2,6 +2,7 @@
"devDependencies": {
"@vuepress/plugin-search": "^2.0.0-beta.38",
"glob": "^7.2.0",
"markdown-it-attrs": "^4.1.3",
"vuepress": "^2.0.0-beta.38",
"vuepress-plugin-copy-code2": "^2.0.0-beta.36"
},