Skip to content

paknevis v0.1.0

Latest

Choose a tag to compare

@mrzroot mrzroot released this 08 Oct 10:09
· 13 commits to main since this release

پاک‌نویس — Persian text linter and auto-fixer (Prettier/ESLint for Persian writing).

🧪 Playground: https://mrzroot.github.io/paknevis/

Install

paknevis is not on PyPI. Install it from this release or from Git:

pip install https://github.com/mrzroot/paknevis/releases/download/v0.1.0/paknevis-0.1.0-py3-none-any.whl
# or
pip install "git+https://github.com/mrzroot/paknevis@v0.1.0"
paknevis check docs/          # report problems
paknevis fix --diff notes.md  # preview fixes
paknevis fix .                # apply fixes

First public release.

Added

  • 25 rules in five categories, each with an id, severity, bilingual (FA/EN) explanation, examples and an autofix where safe:
    • characters: arabic-yeh, arabic-kaf, non-persian-heh, arabic-teh-marbuta (report-only by default), arabic-digits, digit-style (Persian/Latin/keep).
    • zwnj: zwnj-cleanup, zwnj-mi-prefix, zwnj-plural, zwnj-comparative, zwnj-heh-suffix (with ezafe = "zwnj" | "hamza").
    • punctuation: persian-comma, persian-semicolon, persian-question-mark, space-before-punctuation, space-after-punctuation, bracket-spacing, persian-quotes, ellipsis, repeated-punctuation.
    • whitespace: multiple-spaces, trailing-whitespace (keeps Markdown hard breaks), kashida.
    • spelling: spelling (curated YAML dictionary, extensible via config) and tanvin.
  • Syntax-aware protection for plain text, Markdown, HTML and LaTeX (XePersian \lr{…}, latin/LTR environments, math, verbatim, commands and their arguments).
  • Inline directives: paknevis-disable / paknevis-enable, paknevis-disable-line, paknevis-disable-next-line.
  • Optional .docx support (paknevis[docx]) that preserves run formatting.
  • Python API: paknevis.fix(), paknevis.lint(), Linter, Config, load_config().
  • CLI: paknevis check|fix|rules|explain with --check, --diff, JSON/GitHub/concise output, --fail-on, Persian messages (--lang fa), stdin support, glob/directory discovery and configuration via pyproject.toml or .paknevis.toml.
  • pre-commit hooks (paknevis, paknevis-check) and a composite GitHub Action.
  • Browser playground on GitHub Pages running the real package via Pyodide (RTL-first, dark/light, Persian/English UI, self-hosted Vazirmatn).
  • Test suite with golden before/after fixtures and Hypothesis property tests (idempotency, protected regions).