diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 5b6a51ac..c1afd6b9 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,3 +1,4 @@ +import taskLists from 'markdown-it-task-lists' import { defineConfig } from 'vitepress' // https://vitepress.dev/reference/site-config @@ -209,9 +210,12 @@ export default defineConfig({ // Ignore dead links for source code references and placeholder pages ignoreDeadLinks: true, - // Enable LaTeX math rendering + // Enable LaTeX math rendering and GitHub-style task lists markdown: { - math: true + math: true, + config(md) { + md.use(taskLists) + } }, // 多语言配置 diff --git a/docs/.vitepress/theme/custom.css b/docs/.vitepress/theme/custom.css index 798ff6d0..bb2ddc8f 100644 --- a/docs/.vitepress/theme/custom.css +++ b/docs/.vitepress/theme/custom.css @@ -161,6 +161,19 @@ background: rgba(0, 0, 0, 0.9) !important; } +/** + * Component: Task List + * -------------------------------------------------------------------------- */ + +.vp-doc li.task-list-item { + list-style: none; +} + +.vp-doc .task-list-item-checkbox { + margin: 0 0.5em 0 -1.4em; + vertical-align: middle; +} + /** * ASCII Art Background — Dark Home Page * -------------------------------------------------------------------------- */ diff --git a/package.json b/package.json index 9b468b10..744842b3 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "devDependencies": { "@types/node": "^20.19.37", + "markdown-it-task-lists": "^2.1.1", "medium-zoom": "^1.1.0", "mermaid": "^10.0.0", "swagger-ui-dist": "^5.32.1",