--- name: mm-pdf description: Generate beautifully styled Machine.Machine branded PDFs and slide decks from Markdown. Dark navy aesthetic, cyan accents, professional A4 layout. Uses a headless-Chrome render container (any container with Node + Chrome, e.g. a "*-m2o" agent-desktop image) or a local WeasyPrint fallback. Produces PDF + HTML output. --- # mm-pdf Generate MM-branded documents from Markdown content. ## Design system | Token | Value | Use | |-------|-------|-----| | Cover background | `#0a0e1a` | Dark navy | | Primary accent | `#4bb8d4` | Cyan — headings, kickers, borders | | Section banners | `#3d4550` | Slate grey | | Purple sidebar | `#6b46c1` | Alt cover variant | | Body text | `#e2e8f0` | Light grey on dark bg | | Body background | `#111827` | Dark page bg | | Code/data blocks | `#1e2533` | Slightly lighter navy | ## Usage ```bash # Generate PDF from markdown mm-pdf generate input.md [--out output.pdf] [--style dark|purple|light] # Generate slide deck (Marp) mm-pdf slides input.md [--out output.pdf] # With explicit container (auto-discovery picks the first "*m2o*" container if omitted) mm-pdf generate input.md --container ``` ## Pipeline 1. **MD → HTML** — a small Node script (via `marked`) renders Markdown into full MM-styled HTML. Extracts YAML frontmatter (`title`, `subtitle`, `date`, `client`) for the cover page. Strips the first `# H1` to use as title if no frontmatter is present. 2. **HTML → PDF** — Chrome headless renders the HTML to PDF (`--print-to-pdf`). Both outputs are saved alongside the input file. ## Output - `.html` — standalone styled HTML (preview, shareable) - `.pdf` — print-ready PDF ## Styles | Style | Cover | Use case | |-------|-------|----------| | `dark` | Navy `#0a0e1a` + cyan accent | Technical specs, deployment docs | | `purple` | Purple sidebar `#6b46c1` | Partner decks | | `light` | White + navy header | Client-facing docs | `dark.css` and `purple.css` ship in `templates/`. `light` is documented for forward compatibility but has no template in this bundle yet — add `templates/light.css` locally if you need it (it will be picked up automatically; `generate.sh` falls back to `dark.css` for any missing style file). ## Components (in Markdown) ```markdown
**€5K** setup
**€2K**/mo
**8 weeks** pilot
DEPLOYMENT ARCHITECTURE
⚠️ Open item: integration path TBD
``` ## Requirements - Docker, with a running container that has Node.js + Google Chrome (headless) installed and reachable via `docker exec`/`docker cp` from the host running this skill. Any container name is fine — `scripts/generate.sh` auto-discovers the first container whose name matches `nasr-m2o|m2o`, or accepts `--container ` to target any other container that meets the Node+Chrome requirement. - `docker` CLI available on the host invoking `mm-pdf`. No absolute host paths, hostnames, or client-identifying data are baked into this skill — `--container` and the input Markdown path are the only machine-specific inputs at run time.