diff --git a/package.json b/package.json index 82fdcc4d..b6774dfb 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,8 @@ "katex": "^0.16.9", "lint-staged": "^15.2.2", "markmap-lib": "^0.16.0", + "markmap-toolbar": "^0.16.0", + "markmap-view": "^0.16.0", "mermaid": "^10.8.0", "remarkable-katex": "^1.2.1", "reveal.js": "^5.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08b4c333..5b4e3ff8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,6 +56,12 @@ devDependencies: markmap-lib: specifier: ^0.16.0 version: 0.16.0(markmap-common@0.16.0) + markmap-toolbar: + specifier: ^0.16.0 + version: 0.16.0(markmap-common@0.16.0) + markmap-view: + specifier: ^0.16.0 + version: 0.16.0(markmap-common@0.16.0) mermaid: specifier: ^10.8.0 version: 10.8.0 @@ -76,7 +82,7 @@ devDependencies: version: 2.0.0-rc.8(@vuepress/bundler-vite@2.0.0-rc.8)(typescript@5.3.3)(vue@3.4.21) vuepress-theme-hope: specifier: 2.0.0-rc.27 - version: 2.0.0-rc.27(@vue/repl@4.1.1)(@vuepress/plugin-docsearch@2.0.0-rc.18)(@vuepress/plugin-pwa@2.0.0-rc.18)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.9)(markdown-it@14.0.0)(markmap-lib@0.16.0)(mermaid@10.8.0)(reveal.js@5.0.5)(typescript@5.3.3)(vuepress@2.0.0-rc.8) + version: 2.0.0-rc.27(@vue/repl@4.1.1)(@vuepress/plugin-docsearch@2.0.0-rc.18)(@vuepress/plugin-pwa@2.0.0-rc.18)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.9)(markdown-it@14.0.0)(markmap-lib@0.16.0)(markmap-toolbar@0.16.0)(markmap-view@0.16.0)(mermaid@10.8.0)(reveal.js@5.0.5)(typescript@5.3.3)(vuepress@2.0.0-rc.8) packages: @@ -6235,6 +6241,16 @@ packages: remarkable-katex: 1.2.1 dev: true + /markmap-toolbar@0.16.0(markmap-common@0.16.0): + resolution: {integrity: sha512-Umnxc6Y4T0CioPlmvfm5M5D2/7BJTA82kvgRQIu/y0oQzJl0h3mxBOKPrhok+89RotagPwhQ4g7el4Td2W+tDQ==} + peerDependencies: + markmap-common: '*' + dependencies: + '@babel/runtime': 7.24.0 + '@gera2ld/jsx-dom': 2.2.2 + markmap-common: 0.16.0 + dev: true + /markmap-view@0.16.0(markmap-common@0.16.0): resolution: {integrity: sha512-JOiSEThs8B4bAP9E6rcCWOz2SsMwCBFaR76wLARRVb04C/qLiLmvrm675kNPq4lRBAwtugHCYvjG0otpSlB4Cw==} peerDependencies: @@ -8077,7 +8093,7 @@ packages: - typescript dev: true - /vuepress-plugin-md-enhance@2.0.0-rc.27(@vue/repl@4.1.1)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.9)(markdown-it@14.0.0)(markmap-lib@0.16.0)(mermaid@10.8.0)(reveal.js@5.0.5)(typescript@5.3.3)(vuepress@2.0.0-rc.8): + /vuepress-plugin-md-enhance@2.0.0-rc.27(@vue/repl@4.1.1)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.9)(markdown-it@14.0.0)(markmap-lib@0.16.0)(markmap-toolbar@0.16.0)(markmap-view@0.16.0)(mermaid@10.8.0)(reveal.js@5.0.5)(typescript@5.3.3)(vuepress@2.0.0-rc.8): resolution: {integrity: sha512-ZU+mR3Uy77faUfINnA0sgG/Ezbu2VAY/XnFmPGfr6KFYYWzyhH2rv8W7NvGslR4gri1wxHnVZ3ImP7rhTYh9NQ==} engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} peerDependencies: @@ -8160,6 +8176,8 @@ packages: js-yaml: 4.1.0 katex: 0.16.9 markmap-lib: 0.16.0(markmap-common@0.16.0) + markmap-toolbar: 0.16.0(markmap-common@0.16.0) + markmap-view: 0.16.0(markmap-common@0.16.0) mermaid: 10.8.0 reveal.js: 5.0.5 vue: 3.4.21(typescript@5.3.3) @@ -8213,7 +8231,7 @@ packages: - typescript dev: true - /vuepress-theme-hope@2.0.0-rc.27(@vue/repl@4.1.1)(@vuepress/plugin-docsearch@2.0.0-rc.18)(@vuepress/plugin-pwa@2.0.0-rc.18)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.9)(markdown-it@14.0.0)(markmap-lib@0.16.0)(mermaid@10.8.0)(reveal.js@5.0.5)(typescript@5.3.3)(vuepress@2.0.0-rc.8): + /vuepress-theme-hope@2.0.0-rc.27(@vue/repl@4.1.1)(@vuepress/plugin-docsearch@2.0.0-rc.18)(@vuepress/plugin-pwa@2.0.0-rc.18)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.9)(markdown-it@14.0.0)(markmap-lib@0.16.0)(markmap-toolbar@0.16.0)(markmap-view@0.16.0)(mermaid@10.8.0)(reveal.js@5.0.5)(typescript@5.3.3)(vuepress@2.0.0-rc.8): resolution: {integrity: sha512-6/TqFrehr/hk/I5SGmOXVTY0urTvKNaifCuP1v2o8eVmdnYlnFzGHhQk89yZz0zeza54kzYJAUkQbqO0Fc6J8A==} engines: {node: '>=18.16.0', npm: '>=8', pnpm: '>=7', yarn: '>=2'} peerDependencies: @@ -8274,7 +8292,7 @@ packages: vuepress: 2.0.0-rc.8(@vuepress/bundler-vite@2.0.0-rc.8)(typescript@5.3.3)(vue@3.4.21) vuepress-plugin-comment2: 2.0.0-rc.27(typescript@5.3.3)(vuepress@2.0.0-rc.8) vuepress-plugin-components: 2.0.0-rc.27(typescript@5.3.3)(vuepress@2.0.0-rc.8) - vuepress-plugin-md-enhance: 2.0.0-rc.27(@vue/repl@4.1.1)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.9)(markdown-it@14.0.0)(markmap-lib@0.16.0)(mermaid@10.8.0)(reveal.js@5.0.5)(typescript@5.3.3)(vuepress@2.0.0-rc.8) + vuepress-plugin-md-enhance: 2.0.0-rc.27(@vue/repl@4.1.1)(echarts@5.5.0)(flowchart.ts@3.0.0)(katex@0.16.9)(markdown-it@14.0.0)(markmap-lib@0.16.0)(markmap-toolbar@0.16.0)(markmap-view@0.16.0)(mermaid@10.8.0)(reveal.js@5.0.5)(typescript@5.3.3)(vuepress@2.0.0-rc.8) vuepress-plugin-sass-palette: 2.0.0-rc.27(typescript@5.3.3)(vuepress@2.0.0-rc.8) vuepress-shared: 2.0.0-rc.27(typescript@5.3.3)(vuepress@2.0.0-rc.8) transitivePeerDependencies: diff --git a/src/.vuepress/sidebar/index.ts b/src/.vuepress/sidebar/index.ts index 8c595696..dd52ff1d 100644 --- a/src/.vuepress/sidebar/index.ts +++ b/src/.vuepress/sidebar/index.ts @@ -2,7 +2,7 @@ import { sidebar } from 'vuepress-theme-hope' export const Sidebar = sidebar({ '/': [ - '/posts/meta', + '/posts/meta/', '/slides', '/posts/intro', ], diff --git a/src/.vuepress/theme.ts b/src/.vuepress/theme.ts index c4968cd8..d5673d73 100644 --- a/src/.vuepress/theme.ts +++ b/src/.vuepress/theme.ts @@ -1,13 +1,13 @@ import { hopeTheme } from 'vuepress-theme-hope' import { projects } from './extend/' -import { Navbar } from './navbar/index.js' -import { Sidebar } from './sidebar/index.js' +import { Navbar } from './navbar' +import { Sidebar } from './sidebar' export default hopeTheme({ author: { - name: '鸭梨', - url: 'https://github.com/Sun-ZhenXing', + name: 'Alex Sun', + url: 'https://blog.alexsun.top/', }, blog: { description: '鸭梨的博客', @@ -80,6 +80,7 @@ export default hopeTheme({ plugins: { blog: true, + catalog: {}, copyCode: { showInMobile: true, }, @@ -137,28 +138,50 @@ export default hopeTheme({ }, mdEnhance: { + // GFM 警告 + alert: true, + // 自定义对齐 align: true, + // 属性 attrs: true, + // Chart 图表 chart: false, + // 代码组 codetabs: true, - demo: false, + // 组件 + component: true, + // 代码示例 + demo: true, + // Echarts 图表 echarts: true, + // figure figure: true, - flowchart: false, - footnote: true, + // 流程图 + flowchart: true, + // GFM 语法 gfm: true, - hint: true, + // 图片懒加载 imgLazyload: true, + // 图片标记 + imgMark: true, + // 图片大小 imgSize: true, + // 包含文件 include: true, + // KaTeX 数学公式 katex: { + // 支持复制公式 copy: true, }, + // 标注 mark: true, + // Markmap + markmap: true, + // Mermaid mermaid: true, - revealJs: { - plugins: ['highlight', 'math', 'search', 'notes', 'zoom'], - }, + // 幻灯片 + revealJs: true, + // 风格化 stylize: [ { matcher: /@note:.+/, @@ -209,10 +232,15 @@ export default hopeTheme({ }, }, ], + // 下标 sub: true, + // 上标 sup: true, + // 标签页分组 tabs: true, + // v-pre 容器 vPre: true, + // Vue Playground vuePlayground: true, }, pwa: { diff --git a/src/catalog.md b/src/catalog.md index 13f37383..adcad05b 100644 --- a/src/catalog.md +++ b/src/catalog.md @@ -6,5 +6,7 @@ sticky: 50 --- ```component Catalog -base: / +{ + "base": "/" +} ``` diff --git a/src/posts/README.md b/src/posts/README.md index cbb47b5f..8c3059a0 100644 --- a/src/posts/README.md +++ b/src/posts/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/ai/README.md b/src/posts/ai/README.md index 28f4f46e..d940eecd 100644 --- a/src/posts/ai/README.md +++ b/src/posts/ai/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/ai/chatgpt/README.md b/src/posts/ai/chatgpt/README.md index 0d22d6fb..656abcdb 100644 --- a/src/posts/ai/chatgpt/README.md +++ b/src/posts/ai/chatgpt/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/ai/linear-algebra/README.md b/src/posts/ai/linear-algebra/README.md index 7bee4cbb..d86c0386 100644 --- a/src/posts/ai/linear-algebra/README.md +++ b/src/posts/ai/linear-algebra/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/ai/machine-learning/README.md b/src/posts/ai/machine-learning/README.md index f8db8049..87a3a0ab 100644 --- a/src/posts/ai/machine-learning/README.md +++ b/src/posts/ai/machine-learning/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/ai/probability-and-statistics/README.md b/src/posts/ai/probability-and-statistics/README.md index 4da738da..72127c7d 100644 --- a/src/posts/ai/probability-and-statistics/README.md +++ b/src/posts/ai/probability-and-statistics/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/computer-core/500-lines-or-less/README.md b/src/posts/computer-core/500-lines-or-less/README.md index 16fb19b6..51b9cd74 100644 --- a/src/posts/computer-core/500-lines-or-less/README.md +++ b/src/posts/computer-core/500-lines-or-less/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/computer-core/README.md b/src/posts/computer-core/README.md index 8f0867a9..c1c08760 100644 --- a/src/posts/computer-core/README.md +++ b/src/posts/computer-core/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/computer-core/collections/README.md b/src/posts/computer-core/collections/README.md index 54a07486..e9c9e552 100644 --- a/src/posts/computer-core/collections/README.md +++ b/src/posts/computer-core/collections/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/computer-core/csapp/README.md b/src/posts/computer-core/csapp/README.md index 5e02fe1b..ac0ffb7c 100644 --- a/src/posts/computer-core/csapp/README.md +++ b/src/posts/computer-core/csapp/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/data-analysis/README.md b/src/posts/data-analysis/README.md index e5733a6d..7988c57b 100644 --- a/src/posts/data-analysis/README.md +++ b/src/posts/data-analysis/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/envs/README.md b/src/posts/envs/README.md index edbcb8f2..15f0326a 100644 --- a/src/posts/envs/README.md +++ b/src/posts/envs/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/frontend/README.md b/src/posts/frontend/README.md index 6b692c60..b0e1bf8c 100644 --- a/src/posts/frontend/README.md +++ b/src/posts/frontend/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/frontend/vue/README.md b/src/posts/frontend/vue/README.md index fad17e68..86ec4d13 100644 --- a/src/posts/frontend/vue/README.md +++ b/src/posts/frontend/vue/README.md @@ -7,4 +7,5 @@ index: false --- ```component Catalog +{} ``` diff --git a/src/posts/ideas/README.md b/src/posts/ideas/README.md index ced29bf8..684d61e8 100644 --- a/src/posts/ideas/README.md +++ b/src/posts/ideas/README.md @@ -8,4 +8,5 @@ index: false --- ```component Catalog +{} ```