2.4 KiB
2.4 KiB
TASK: mopac-pdf v0 — beautiful PDF generation pipeline (Redmine 499)
Context
Spec docs/SPEC-20260829-charles-brief.md "Workflows": beautifully formatted PDFs of budgets, travel itineraries, project plans, proposals, consulting reports, multi-year financial plans, business plans, engineering docs — with charts/diagrams. This feeds the COS briefing world (reports) and TSYS client deliverables.
Constraints
- OUR code: Go only (no python/node/rust — prebuilt engine BINARIES in digest-pinned docker images are tooling, fine).
- ALL DEV IN DOCKER. AGPLv3. Docs standard.
Scope
- New repo
ukrrs/mopac-pdf(create via Gitea API if absent — PMO pattern, tea token; clone to ~/projects/meta/MOPAC/pdf). LICENSE AGPLv3 first commit. - Engine decision (document rationale in REPORT): typst (docker image, typst compile) vs pandoc+latex — evaluate compile speed, chart/table quality, template ergonomics. Typst expected to win on modern output.
- Go package + CLI
mopac-pdf:- Input: markdown (the composable currency of this whole stack — Redmine notes, Discourse posts, briefing output) + front-matter (title, subtitle, date, classification footer, template name).
- Templates dir: 2 shipped v0 — "report" (clean business report: title page, TOC, headers/footers, page numbers) and "brief" (1-3 page exec summary, dense tables).
- Charts: pure-Go rendering option (go-chart or similar permissive lib) embedded as images from fenced code blocks with data blocks; keep v0 minimal — one chart type proven end-to-end.
- Output: PDF bytes to stdout or -o file; exit codes like harness (0/1/2 usage/engine).
- Docker runner:
mopac-pdfshells the engine container (digest- pinned); host stays toolchain-free. Makefile/dev.sh per family pattern. - Tests: template rendering golden tests (fixture .md -> PDF, assert non-empty + page count via a tiny Go PDF header parse or engine stdout), CLI flags, front-matter parsing. NEVER broad pkill.
Deliverable
Commits pushed to ukrrs/mopac-pdf main.
REPORT-20260829-1300-pdf.md in ~/.coordinate/inbox-pmo/: engine
decision + rationale, sample outputs listed (paths), how the briefing
pipeline will call it, what's Next (chart types, more templates).
CLARIFIED (Charles): supply chain MAY include prebuilt Rust tools (typst etc.) in digest-pinned images. OUR code: Go/PHP/C/Java only.