| name | render-pdf |
| description | Render a decision-analysis workspace into a polished Typst PDF — cover page, executive summary, decision context, per-framework sections, comparison table, and synthesis. Output goes to <workspace>/analysis.pdf. Run after /decision:synthesize. |
Render PDF
Compiles the workspace's markdown fragments and synthesis into a single PDF using Typst.
Inputs
A workspace folder with decision.md, fragments/*.md, and synthesis.md. Path or slug; if neither, list recent and ask.
Prerequisites
typst CLI installed (which typst).
- IBM Plex Sans available system-wide, or fall back to the system sans-serif if not.
If typst is missing, tell the user to install it (sudo apt install typst on Debian/Ubuntu, or download from typst.app) and stop.
Procedure
-
Load the workspace files.
-
Generate a Typst source file at <workspace>/.build/analysis.typ. Use the template at the plugin install dir's templates/analysis.typ as the structural base; substitute:
- Decision title (from
decision.md H1).
- Author (from config
pdf.author).
- Date (today, DD/MM/YY format per Daniel's preference).
- Synthesis (from
synthesis.md) → exec summary section.
- Decision context (from
decision.md) → context section.
- Each fragment (from
fragments/*.md) → its own section, alphabetised by filename.
- Score comparison table (extracted from synthesis).
-
Compile:
typst compile <workspace>/.build/analysis.typ <workspace>/analysis.pdf
-
Verify the PDF was created and is non-empty.
-
Report the PDF path. Offer /decision:export next.
Template structure (templates/analysis.typ)
The template defines:
- A4 page, IBM Plex Sans, modest margins, page numbers in footer.
- Cover page: title (bold, large), date, author, "Multi-framework decision analysis".
- Section 1: Executive Summary (synthesis verdict + score table).
- Section 2: Decision Context (the decision.md body).
- Section 3+: One page (or more) per framework, in alphabetical order, with the framework name as section header.
- Final section: Synthesis (full synthesis.md).
If the user wants to customise the template, they edit templates/analysis.typ in the plugin install dir — but warn that plugin updates will overwrite it. (Long-term improvement: copy the template to $DATA_ROOT/templates/ on first run and read from there. Note this as a follow-up.)