/dochooks

Primary LanguagePythonMIT LicenseMIT

dochooks

Some pre-commit hooks for docs.

PyPI - Python Version pypi PyPI - Downloads LICENSE
uv ruff Gitmoji

Usage

.pre-commit-config.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-linedochooks: skip-line 两种 pragma

<!-- dochooks: skip-next-line -->
这是一段中文and English混合的text
这是一段中文and English混合的text  <!-- dochooks: skip-line -->