https://github.com/pfcclab/dochooks
https://github.com/pfcclab/dochooks
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pfcclab/dochooks
- Owner: PFCCLab
- License: mit
- Created: 2022-07-15T11:36:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-28T03:40:42.000Z (10 months ago)
- Last Synced: 2025-07-10T22:22:06.910Z (7 months ago)
- Language: Python
- Size: 214 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# dochooks
Some pre-commit hooks for docs.
## Usage
`.pre-commit-config.yaml`
```yaml
repos:
- repo: https://github.com/PFCCLab/dochooks
rev: v0.5.0
hooks:
- id: check-whitespace-between-cn-and-en-char
files: \.md$|\.rst$
- id: insert-whitespace-between-cn-and-en-char
files: \.md$|\.rst$
```
## Hooks
### `check-whitespace-between-cn-and-en-char`
用于检查中英文之间是否有空格
### `insert-whitespace-between-cn-and-en-char`
用于自动在中英文之间添加空格
## Pragma
dochooks 支持 `dochooks: skip-next-line` 和 `dochooks: skip-line` 两种 pragma
```markdown
这是一段中文and English混合的text
这是一段中文and English混合的text
```