From 316689ec5d3b0d48e8678b460726b944b5e962df Mon Sep 17 00:00:00 2001 From: Plumbiu <3434909403@qq.com> Date: Mon, 17 Jul 2023 22:46:16 +0800 Subject: [PATCH] feat: auto white space --- .vitepress/config.js | 3 ++ CONTRIBUTING.md | 2 +- package-lock.json | 115 ++++++++++++++++++++++++++++++++++++++++++- package.json | 3 +- 4 files changed, 120 insertions(+), 3 deletions(-) diff --git a/.vitepress/config.js b/.vitepress/config.js index f08e36a..1012c44 100644 --- a/.vitepress/config.js +++ b/.vitepress/config.js @@ -2,6 +2,8 @@ import { withMermaid } from "vitepress-plugin-mermaid"; import mathjax3 from 'markdown-it-mathjax3'; import { main_sidebar, chapter2, chapter3, chapter4, chapter5, chapter6, chapter7, chapter8 } from './sidebar.js'; +import PanguPlugin from 'markdown-it-pangu' + const customElements = [ 'mjx-container', 'mjx-assistive-mml', @@ -146,6 +148,7 @@ export default withMermaid({ markdown: { config: (md) => { md.use(mathjax3); + md.use(PanguPlugin); }, }, vue: { diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5ccfaeb..7c31dd3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ ## 文档风格 1. 使用 Markdown 编写文档,文档格式参考 Markdown 语法。 2. 一个页面只有一个1级标题(H1,一个#),其他标题从2级开始(H2,##)。 -3. 英文与中文之间用空格分开。 +3. 本项目自动在英文与中文、数字与中文之间添加空格。 ```markdown AI 与人工智能,AGI 的发展方向。 ``` diff --git a/package-lock.json b/package-lock.json index 42a920c..40643ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ "@jupyterlab/mathjax2": "^3.6.5", "@jupyterlab/theme-light-extension": "^4.0.3", "@vueuse/core": "^10.2.1", - "markdown-it": "^13.0.1" + "markdown-it": "^13.0.1", + "markdown-it-pangu": "^1.0.2" }, "devDependencies": { "@mermaid-js/mermaid-mindmap": "^9.3.0", @@ -2843,6 +2844,51 @@ "mathjax-full": "^3.2.0" } }, + "node_modules/markdown-it-pangu": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/markdown-it-pangu/-/markdown-it-pangu-1.0.2.tgz", + "integrity": "sha512-rssyYaMKXRLMpQIUgX01VE1KYOHhlnc4t5zGTI2zgXDpE88eQz8hywa0iSzoFm3eb5CYzFWazDKdUbnyZvW0SQ==", + "dependencies": { + "markdown-it": "^8.4.2", + "pangu": "^4.0.7" + } + }, + "node_modules/markdown-it-pangu/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/markdown-it-pangu/node_modules/entities": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + }, + "node_modules/markdown-it-pangu/node_modules/linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "dependencies": { + "uc.micro": "^1.0.1" + } + }, + "node_modules/markdown-it-pangu/node_modules/markdown-it": { + "version": "8.4.2", + "resolved": "https://registry.npmmirror.com/markdown-it/-/markdown-it-8.4.2.tgz", + "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "dependencies": { + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, "node_modules/markdown-it/node_modules/entities": { "version": "3.0.1", "resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz", @@ -3276,6 +3322,14 @@ "node": ">=0.10.0" } }, + "node_modules/pangu": { + "version": "4.0.7", + "resolved": "https://registry.npmmirror.com/pangu/-/pangu-4.0.7.tgz", + "integrity": "sha512-weZKJIwwy5gjt4STGVUH9bix3BGk7wZ2ahtIypwe3e/mllsrIZIvtfLx1dPX56GcpZFOCFKmeqI1qVuB9enRzA==", + "bin": { + "pangu": "dist/node/cli.js" + } + }, "node_modules/parse-srcset": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/parse-srcset/-/parse-srcset-1.0.2.tgz", @@ -3553,6 +3607,11 @@ "node": "^12.20.0 || >=14" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, "node_modules/style-mod": { "version": "4.0.3", "resolved": "https://registry.npmmirror.com/style-mod/-/style-mod-4.0.3.tgz", @@ -6635,6 +6694,50 @@ "mathjax-full": "^3.2.0" } }, + "markdown-it-pangu": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/markdown-it-pangu/-/markdown-it-pangu-1.0.2.tgz", + "integrity": "sha512-rssyYaMKXRLMpQIUgX01VE1KYOHhlnc4t5zGTI2zgXDpE88eQz8hywa0iSzoFm3eb5CYzFWazDKdUbnyZvW0SQ==", + "requires": { + "markdown-it": "^8.4.2", + "pangu": "^4.0.7" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "requires": { + "uc.micro": "^1.0.1" + } + }, + "markdown-it": { + "version": "8.4.2", + "resolved": "https://registry.npmmirror.com/markdown-it/-/markdown-it-8.4.2.tgz", + "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "requires": { + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + } + } + }, "markdown-to-jsx": { "version": "7.2.1", "resolved": "https://registry.npmmirror.com/markdown-to-jsx/-/markdown-to-jsx-7.2.1.tgz", @@ -7025,6 +7128,11 @@ "resolved": "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" }, + "pangu": { + "version": "4.0.7", + "resolved": "https://registry.npmmirror.com/pangu/-/pangu-4.0.7.tgz", + "integrity": "sha512-weZKJIwwy5gjt4STGVUH9bix3BGk7wZ2ahtIypwe3e/mllsrIZIvtfLx1dPX56GcpZFOCFKmeqI1qVuB9enRzA==" + }, "parse-srcset": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/parse-srcset/-/parse-srcset-1.0.2.tgz", @@ -7257,6 +7365,11 @@ } } }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, "style-mod": { "version": "4.0.3", "resolved": "https://registry.npmmirror.com/style-mod/-/style-mod-4.0.3.tgz", diff --git a/package.json b/package.json index 2460ce0..c996506 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "@jupyterlab/mathjax2": "^3.6.5", "@jupyterlab/theme-light-extension": "^4.0.3", "@vueuse/core": "^10.2.1", - "markdown-it": "^13.0.1" + "markdown-it": "^13.0.1", + "markdown-it-pangu": "^1.0.2" }, "devDependencies": { "@mermaid-js/mermaid-mindmap": "^9.3.0",