Raised: $0
0% of monthly goal Help us cross the finish line!
Goal: $12,000
Raised: $0 Goal: $12,000
0% of monthly goal Help us cross the finish line!
Sponsor DDEV

If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.

add-on registry tests last commit release

DDEV Pi Docconv

Overview

This add-on enhances the PI Coding Agent inside the ddev-pi DDEV add-on with deterministic document conversion and visual page verification capabilities.

It provisions Pandoc, headless LibreOffice, Poppler utilities, and drop-in Microsoft metric-compatible fonts (Carlito for Calibri, Caladea for Cambria, Liberation for Arial/Times/Courier) at image build time, delivering a sandboxed CLI tool (docconv) accessible inside the Pi sidecar container and from the host via ddev docconv.

Installation

ddev add-on get mxr576/ddev-pi-docconv
ddev restart

After installation, make sure to commit the .ddev directory to version control.

Usage

You can invoke docconv from your host terminal or within the pi container:

Command Description
ddev docconv --help Display CLI usage information and options
ddev docconv convert <file> Convert Markdown/DOCX to DOCX, PDF, and per-page PNG images
ddev docconv verify <file> --exact-pages <n> Verify that a document meets an exact page count budget
ddev docconv verify <file> --min-pages <n> --max-pages <m> Validate page boundary limits

Examples

Convert Markdown to Word, PDF, and PNG Images

ddev docconv convert document.md --to docx,pdf,png

Compile with a Custom Word Template

ddev docconv convert document.md --reference-doc custom-template.docx

Verify 2-Page Budget with JSON Output for Agents

ddev docconv verify CV.md --exact-pages 2 --to-png --json

Output:

{
  "status": "success",
  "pages": 2,
  "target_pages": {
    "exact": 2,
    "min": null,
    "max": null
  },
  "artifacts": {
    "docx": "/var/www/html/CV.docx",
    "pdf": "/var/www/html/CV.pdf",
    "images": [
      "/var/www/html/CV-page-1.png",
      "/var/www/html/CV-page-2.png"
    ]
  },
  "errors": []
}

Customization

The default version tag is defined in docker-compose.pi-docconv.yaml via ${PI_DOCCONV_VERSION:-main}.

To override this version locally on your machine without altering tracked repository files:

  1. Add the variable to .ddev/.env.pi:
    PI_DOCCONV_VERSION="custom-override"
    
  2. Restart the project:
    ddev restart
    

All customization options:

Variable Default Description
PI_DOCCONV_VERSION main Version / git ref of Pi Docconv

Credits

Contributed and maintained by @mxr576

If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.