🌿 cjk-docpack v1.2.0 · MIT
Modular CJK-safe PDF generation + batch pipeline — WeasyPrint, fitz-verified, zero tofu.
What it does
- Markdown → PDF with full Chinese/CJK support (Songti SC and other embedded fonts — no blank glyphs, no “tofu”).
- Template-driven:
report,invoice,product_sheet— new templates are one HTML file with{{TITLE}} {{BODY}} …placeholders. - Automatic verification: every generated PDF is re-opened with PyMuPDF (fitz) to detect missing lines, tofu characters, and unembedded fonts; explicit exit codes 0/1/2.
- Batch pipeline: describe jobs in
manifest.json(including expected-failure jobs) and run the whole pack in one command — zero silent failure.
Install
pip install git+https://mandrilly.com/git/cjk-docpack.git
Requires Python ≥ 3.10. Dependencies (PyMuPDF, weasyprint, markdown) are installed automatically.
On macOS, WeasyPrint needs pango: brew install pango and run with DYLD_LIBRARY_PATH=/opt/homebrew/lib.
Quick start
# Single document (CLI entry point) cjk-docgen --template report \ --meta report_meta.json \ --body report_body.md \ -o output.pdf --verify-report output.verify.json # Batch pack from a manifest (valid + expected-fail jobs) cjk-docpack-pipeline --manifest manifest.json
Source
git clone https://mandrilly.com/git/cjk-docpack.git
Repo contents: pdfgen.py (generator + fitz verification), pipeline.py (batch orchestrator), templates/, fixtures/, demo.sh, manifest.json (10-job demo pack).