-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: format docs in pre-commit #681
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
这个倒无所谓,将 lint.js 改一下或者使用 prettier 指令就行了。 prettier/language-markdown/parser-markdown.js#L29 使用的是 unifiedjs - > remarkjs -> syntax-tree,实际上会修复更多的问题,确实有利于后续的格式化,这也意味着更多的变更,以及变更带来的 CR 工作,我开始是直接用 remark 做然后变更太多看不过来。打个比分,我们文档使用了大量数学公式,里面包含未转义字符 |
…github.io into build_commit_vaild
@a631807682 Please resolve conflicts |
done |
感谢 PR,关于字母/中文/数字之间的空格不规范问题在 CR 的时候很常见❤️,我这里看了一下没什么问题, @GuangmingLuo @rogerogers 可以再看下。 |
What type of PR is this?
build
Check the PR title.
(Optional) Translate the PR title into Chinese.
通过 pre-commit hook 格式化文档
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
At present, the document format is not uniform, especially for Chinese documents. The space between letters/Chinese/numbers depends on code review, which is a waste of manpower and easy to miss.
This PR avoids such problems by automatically fixing the format in pre-commit, and returning an error message to allow contributors to check whether the document fixes meet expectations, and then commit.
zh(optional):
目前文档格式不太统一,特别是中文文档,关于字母/中文/数字之间的空格依赖于 CR ,浪费人力也容易遗漏。
这个 PR 通过在 pre-commit 中自动修复格式,并返回错误信息让贡献者检查文档修复是否符合预期,再进行提交来避免这样的问题。
由于文档太多, 我只检查了 hertz 文档中文部分的修改,因此只开了 hertz 文档等格式化。
(Optional) Which issue(s) this PR fixes: