Add Pre-commit of Markdownlint
Motivation
Some displayed content of markdown pages are incorrect, such as https://www.paddlepaddle.org.cn/documentation/docs/en/develop/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.stft.html provided by @GreatV .
Solution
Add Markdownlint2 into pre-commit.
About markdownlint2
markdownlint2 is a Node.js style checker and lint tool for Markdown/CommonMark files. See https://github.com/DavidAnson/markdownlint for more details.
The rules of the checker are shown in https://github.com/DavidAnson/markdownlint/blob/main/README.md#rules--aliases
How to add it to pre-commit and pick rules
- Add the following codes in .pre-commit-config.yaml
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.11.0
hooks:
- id: markdownlint-cli2
args: ["--fix", "--config .markdownlint.json"]
- enable the rules in .markdownlink.json
{
"default": true,
"MD013": false
}
In above, default sets all rules be True, but MD013 is enabled. If you wanna disable/enable a new rule, juet write the rule name and set the false/true in a new line.
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-6351.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html 预览工具的更多说明,请参考:飞桨文档预览工具
之前的文档得批量处理一下
之前的文档得批量处理一下
可以先评审一下这个工具要不要引入/doge
批处理的话,这个工具部分可以直接修复,部分可能还得手动处理。
这个我之前用过,感觉不太好用。
这个我之前用过,感觉不太好用。
不太好用是指绘漏改嘛?还是会错改
可以先评审一下这个工具要不要引入/doge
得挨个看看各个检查项是否有必要.. @SigureMo @ooooo-create 怎么看
ci 没有 Node.js 环境,如果有,不如直接 prettier