π GoSlide v1.5.0
What's New
π PDF export
New goslide export-pdf <file.md> command renders your deck to a PDF
via headless Chrome. Whatever you see in goslide serve β fonts,
themes, Chart.js, Mermaid diagrams, LLM-baked API results β renders
in the PDF, because the renderer is literally a real browser.
goslide export-pdf talk.md
goslide export-pdf talk.md -o handout.pdf
goslide export-pdf talk.md --notes # include speaker notes
goslide export-pdf talk.md --paper-size a4-landscapePaper sizes (default slide-16x9):
| Preset | Dimensions | Intended use |
|---|---|---|
slide-16x9 |
1920 Γ 1080 px | On-screen presentation look (default) |
slide-4x3 |
1600 Γ 1200 px | Legacy projector aspect |
a4-landscape |
297 Γ 210 mm | Print-friendly handout |
letter-landscape |
11 Γ 8.5 in | US letter handout |
Fragment animations are collapsed to their final state β one slide,
one PDF page.
π§ Chrome discovery: install-once, no bundled chromium
GoSlide stays a single ~8MB binary. export-pdf locates Chrome in
this order:
GOSLIDE_CHROME_PATHenv var (explicit override)- PATH β searches
chrome,chromium,chromium-browser,
google-chrome,microsoft-edge - Platform-specific known install locations
(C:\Program Files\Google\Chrome\Application\chrome.exe,
/Applications/Google Chrome.app/..., etc.)
If nothing is found, the command exits non-zero with an actionable
message listing every location it checked. No auto-download.
π§© How it works
Under the hood export-pdf is a thin wrapper:
- Runs the existing
goslide buildto produce static HTML with
everything (LLM bakes included) already inlined. - Launches Chrome headless against that HTML with reveal.js's
?print-pdfmode. - Waits for
window.__goslideReady(new front-end marker that fires
once Mermaid promises settle β async-safe rendering). - Calls Chrome DevTools
Page.printToPDFwith the resolved paper
dimensions and writes the bytes to the output path.
The Launcher interface keeps unit tests deterministic (fake launcher
for orchestrator tests) and the real ChromedpLauncher only runs when
Chrome is actually present. The integration test auto-skips when
FindChrome() errors, so CI without Chrome stays green.
Compatibility
No breaking changes. v1.4.0 decks export unchanged; the new command is
additive. Existing goslide build / serve / generate / host are
untouched.
Go version: still 1.21.6. Chromedp is pinned to v0.10.0 β the last
release compatible with Go 1.21.
Requirements
- Chrome / Edge / Chromium installed locally. Developers typically
have one of these; if not, any distribution works. Set
GOSLIDE_CHROME_PATHif you want to pick a specific binary.
Out of scope (future work)
- Fragment-per-page mode.
- Custom header/footer, page numbers, bookmarks.
- Password-protected PDFs.
- Auto-downloading or bundling Chromium.
Full Changelog
See v1.4.0...v1.5.0 for all changes.