feat: enable katex

This commit is contained in:
KirisameVanilla 2025-09-01 21:13:57 +08:00
parent 177dd892eb
commit 52fc2a626e
3 changed files with 60 additions and 7 deletions

View File

@ -69,13 +69,11 @@ export default hopeTheme({
tasklist: true,
vPre: true,
// 取消注释它们如果你需要 TeX 支持
// math: {
// // 启用前安装 katex
// type: "katex",
// // 或者安装 mathjax-full
// type: "mathjax",
// },
// 启用 KaTeX 数学公式支持
math: {
// 启用前安装 katex
type: "katex",
},
// 如果你需要幻灯片,安装 @vuepress/plugin-revealjs 并取消下方注释
// revealjs: {

53
package-lock.json generated
View File

@ -9,7 +9,9 @@
"version": "0.0.1",
"license": "MIT",
"devDependencies": {
"@mdit/plugin-katex": "^0.23.1",
"@vuepress/bundler-vite": "2.0.0-rc.24",
"katex": "^0.16.22",
"sass-embedded": "^1.89.2",
"vue": "^3.5.20",
"vuepress": "2.0.0-rc.24",
@ -894,6 +896,30 @@
}
}
},
"node_modules/@mdit/plugin-katex": {
"version": "0.23.1",
"resolved": "https://registry.npmjs.org/@mdit/plugin-katex/-/plugin-katex-0.23.1.tgz",
"integrity": "sha512-4hyeDzjIqBplwS/NOGHGkxraE3jIi3KJ+WBKmG/dMDvEO+oYovVXY0pTW7/d0SH/4vqhRp6stQ5z+rgPAovhOg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@mdit/helper": "0.22.1",
"@mdit/plugin-tex": "0.22.1",
"@types/markdown-it": "^14.1.2",
"katex": "0.16.22"
},
"engines": {
"node": ">= 18"
},
"peerDependencies": {
"markdown-it": "^14.1.0"
},
"peerDependenciesMeta": {
"markdown-it": {
"optional": true
}
}
},
"node_modules/@mdit/plugin-katex-slim": {
"version": "0.23.1",
"resolved": "https://registry.npmjs.org/@mdit/plugin-katex-slim/-/plugin-katex-slim-0.23.1.tgz",
@ -4490,6 +4516,33 @@
"graceful-fs": "^4.1.6"
}
},
"node_modules/katex": {
"version": "0.16.22",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.22.tgz",
"integrity": "sha512-XCHRdUw4lf3SKBaJe4EvgqIuWwkPSo9XoeO8GjQW94Bp7TWv9hNhzZjZ+OH9yf1UmLygb7DIT5GSFQiyt16zYg==",
"dev": true,
"funding": [
"https://opencollective.com/katex",
"https://github.com/sponsors/katex"
],
"license": "MIT",
"dependencies": {
"commander": "^8.3.0"
},
"bin": {
"katex": "cli.js"
}
},
"node_modules/katex/node_modules/commander": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
"integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 12"
}
},
"node_modules/kind-of": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",

View File

@ -11,7 +11,9 @@
"docs:update-package": "npx vp-update"
},
"devDependencies": {
"@mdit/plugin-katex": "^0.23.1",
"@vuepress/bundler-vite": "2.0.0-rc.24",
"katex": "^0.16.22",
"sass-embedded": "^1.89.2",
"vue": "^3.5.20",
"vuepress": "2.0.0-rc.24",