slides v0.31.1
The slides command and its library: Marp’s Markdown parsed and rendered in Go, with Go templates and slide kinds on top. Released as v0.31.1: go install github.com/go-slides/slides/cmd/slides@latest.
slides reads the Markdown Marp reads โ directives, --- between slides, ![bg] backgrounds, speaker notes, the built-in themes โ and adds two things Marp does not have: Go templates inside the deck, and slide kinds, so a slide says what it is instead of repeating how it looks.
The syntax is Marpit's and Marp Core's, not a dialect of it. A deck written for Marp is read the same way here, and slides expand gives back plain Marp Markdown, so nothing written with the two additions below is locked in.
--- splits slides. Global, local and spot (_class) directives, in the front matter or in HTML comments, with Marp's inheritance from one slide to the next.
![bg], its sizes and filters, split backgrounds, and the image keywords Marp understands.
Header, footer and pagination; speaker notes from comments; fragmented lists; <style scoped> for one slide's CSS.
default, gaia and uncover, selected with theme: as in Marp.
The deck is a text/template, evaluated before the Markdown is parsed โ so a template can generate slides, and a deck can be data plus a layout.
{{ .title }} reads the front matter, and its data: mapping holds whatever else the deck needs.
A {{ range }} that emits --- is a slide generator: one slide per item, per speaker, per release.
{{ page }} and {{ total }} are known only once the deck is split, and are filled in then.
Fenced blocks and inline code are not evaluated by default, so a slide about Go templates can show one. include pulls another file in.
kind: section names a preset of local directives โ header, footer, pagination, class, background. kind: applies to the slide and those after it, _kind: to one slide. Directives written on the slide still win.
title, section, content and blank, each redefinable.
In the front matter's kinds:, or in a kinds YAML file that every deck of a team names.
Switching kinds clears what the previous one set, so a class or a footer does not follow you into the next section.
The playground is go-slides itself, compiled to WebAssembly: write on the left, the slides follow on the right. Nothing is installed and nothing is sent to a server. The playground's own interface follows the page's language.
The slides render in a worker as you type, the preview scrolls with the editor, a minimap and a column of slide thumbnails follow it, and the slideshow presents with its transitions. Present opens the presenter view, with your notes and a timer, in a second window.
Completion and explanations for directives, kinds and template functions; problems marked on their line; example decks, math, images and backgrounds among them (drop an image file into the editor); links to the documentation. A file panel holds the project: your themes, kinds and data files, and the media you drop, in the layout the slides command builds. A Format tab writes the Markdown for you, with Undo: bold, italic, underline, lists, a table from a grid, the slide's text alignment and links. Every pane resizes.
A link carries the deck itself, compressed in its #. Save it as HTML, a vector PDF, or an editable PowerPoint or OpenDocument deck, all made in your browser, or download the whole project as a .zip. Your draft survives a reload, in your browser only.
marp-cli renders images and PDF by driving a headless Chrome. Here the fleet's own Go libraries do it instead. Images and PDF arrived in v0.1.0, PPTX, math and highlighting in v0.2.0, ODP, fitting headings and HCL in v0.3.0, the vector PDF (its text selectable) and emoji in v0.4.0; in v0.5.0 the PPTX and ODP became editable, where marp-cli's PPTX is pictures; v0.6.0 adds watch, serve, transitions and marp-cli's options, v0.7.0 the presenter view โ see the documentation.
One page per deck, the way Marp renders it: each slide an SVG-framed <section> that scales to the window, the theme's CSS, and a keyboard viewer.
The deck with its templates evaluated and its kinds turned into spot directives, written back as plain Marp Markdown โ so any Marp tool can take it from there.
slides notes prints the speaker notes; slides kinds and slides themes list what a deck can name.
A configuration file for a folder of decks: shared kinds, themes, template data, HTML options and language.
--images png|jpeg writes one image per slide (deck.001.png, โฆ), --image the first slide. Rendered by go-webengine, a browser engine in Go โ not a headless Chrome. --image-scale 2 renders at twice the density.
--pdf, or -o deck.pdf: one page per slide at the slide's size, with an outline of slides and headings, written by go-pdfkit. Fonts are embedded; nothing touches the network. Since v0.4.0 the pages are vectors: selectable text, sharp shapes, 758 KiB for 100 slides against marp-cli's 837 KiB (--pdf-raster keeps one image per page).
--pptx, or -o deck.pptx: with its speaker notes and the deck's metadata, written by go-ooxml. Since v0.5.0 the slides are editable โ text boxes in the deck's own fonts (embedded), shapes, gradients, pictures stored once โ where marp-cli's are pictures (--pptx-raster keeps them). 100 slides: 692 ms on one core and 276 ms on 16, against marp-cli's 7.2 s (v0.26.1); 760 KiB, against marp-cli's 7.2 MiB.
$โฆ$ and $$โฆ$$ typeset by go-tex, fenced code highlighted by go-rouge โ in the HTML page, images and PDF.
--odp, or -o deck.odp: an OpenDocument presentation with its speaker notes โ editable since v0.5.0, like the PPTX (--odp-raster for one picture per slide).
# <!-- fit --> Title fills the slide width on one line, in the page and in every export.
:smile: shortcodes and Unicode emoji (๐ ๐ฉโ๐ป ๐ซ๐ท) become Twemoji images exactly as Marp Core writes them โ but embedded from go-icons/twemoji instead of loaded from a CDN, so they need no network and draw in the page, images, PDF, PPTX and ODP. Emoji โ
HCL2 wherever a deck takes YAML โ a ---hcl front matter, slides.hcl, kinds and data files โ for expressions and functions: footer = "${upper(data.company)} ยท ${page()}/${total()}". slides expand writes the front matter back as YAML. HCL โ
--watch builds again what changes and reloads the open pages; --server dir serves a folder of decks โ deck.md as a page, deck.md?pdf, ?pptx, ?png, ?notes converted on request โ on 127.0.0.1, checking the Host and Origin, never leaving the folder; --preview opens the browser. marp-cli's routes and live reload, without its open port. Command line โ
slides -I decks/ -o site/ converts every deck under a folder and mirrors the tree; several files, a folder or a pattern at once, -P at a time.
marp-cli's <!-- transition: fade 1s -->, with its 33 built-in transitions, played with the browser's View Transition API; an on-screen controller; --template bare. The PDF, PPTX and ODP exports carry them too, on the next slide, and fragmented lists become click builds in the PPTX and ODP (--pdf-fragments writes one PDF page per step). Since v0.18.0; checked in LibreOffice only, not verified in PowerPoint.
--notes writes the speaker notes as text, --pdf-notes puts them on the PDF pages, --pdf-outlines its bookmarks; --title, --author, --keywords, --url, --og-image, --theme; marp-cli's .marprc and --config-file (JSON, YAML) are read.
Press o: every slide in a grid, the arrows choose one, Enter or a click goes to it โ over the page or over the presenter view, in marp-cli's URLs and with its sync, no network. Slides are labelled and focusable; the closed overview is inert. Command line โ
Press p on the page: the current slide, the next step, your speaker notes (escaped, never in what the audience's screen reader reads), a clock and a timer, in a second window that follows the first and the first follows it โ marp-cli's URLs and sync, through localStorage, no server and no network. About 10 KB a page. Command line โ
```go {lineNumbers} numbers the lines of a code block ({lineNumbers=10} starts at 10); a marker in a comment at the end of a line (// <1>) followed by a numbered list gives a numbered disc on the line and on its note โ in the page, images, PDF, PPTX and ODP. The numbers and discs are not copied with the code. Math and code โ
A theme in one .gsta.xz file: a tar archive compressed with xz, with a theme.hcl that names it and lists its CSS, fonts, assets and kinds. slides theme pack|verify|install|list|remove manage packages, and --theme accepts one. Archives are untrusted input: links, unsafe paths, bombs and bad checksums are refused with coded errors. Theme packages โ
 embeds an asciinema recording: it plays in a built-in player in the HTML page, with no third-party script and paused under reduced motion; in the PDF, PPTX and ODP the screen at a chosen time (#t=12.5) is drawn as vector text. Terminal recordings โ
Marp transitions become slide transitions in the PPTX and ODP, and fragmented lists become click-by-click fades; each PDF page gets a /Trans transition, and --pdf-fragments writes one page per fragment step. Command line โ
 embeds a video: the browser plays it in the HTML page, never with sound by itself and paused under reduced motion; the PDF shows the poster frame at a chosen time with a link to the file, and the PPTX and ODP embed the video. Video โ
An SVG image that animates itself plays in the HTML page. In the PPTX and ODP each animated element is a shape with its own animation (movement, rotation, scale, opacity, colour) that starts with the slide, or an animated GIF where those cannot say it; the PDF and images show the initial state. A local image blocked without --allow-local-files is now said, not dropped. Animated SVG โ
The math font (v0.22.0) and the emoji pictures (v0.23.0) come through providers: mathfont.Provider and emoji.Provider. The command still embeds both and its output is byte-identical. A host that does not want them builds with slides_nomathfont or slides_noemoji and links none of the data (a js/wasm build is 651 KB and 2.06 MB gzipped smaller), supplying them later: until then a formula shows as its TeX source and an emoji as its text. A provider's picture is at most 256 KiB, embedded as a data: image.
A host that registers the math font or the emoji pictures after the first render no longer keeps the fallback text: the render cache re-renders only the slides that fell back, once a provider is registered, and slides with no formula and no emoji stay cached. The command's output is unchanged.
A math font supplied by a provider is rebuilt from the tables the typesetter reads, and refused after a few KB when its declared counts would make the parser allocate too much (a 924-byte font that allocated 1.36 GB). The math font is untrusted input since v0.27.0, and bounded: every glyph (CFF and CFF2 included), then the total, at most 128 MiB of TrueType outlines or 64 MiB of CFF path text (the shipped STIX Two Math is one), or 1,350,000 charstring operators in all (STIX Two Math is 166,885), checked by one pass at load that counts operators, not time (since v0.28.0). The embedded font renders byte-identically.
Export's worker pool and the -P pool for several decks both run on the fleet's shared inflight.Ordered: bounded, in order, stopping at the first error, with byte-identical files. With -P, a deck's messages and the list of failed decks now come out in command-line order, not finish order. The release adds a multi-core table against marp-cli (slidesbench -cores); 20-slide decks and 100 slides to PNG are faster than marp-cli at every core count. The 100-slide PDF was not: 3166 ms on one core and 2568 ms on 16, against marp-cli's 1513 ms, and the 100-slide PDF and PPTX did not scale with cores (tracked in #117; fixed in v0.26.1).
go-webengine/engine v0.48.0 shares a variable font's static instances across pages instead of rebuilding them for every page (engine#443), which fixes the regression of v0.18.0 to v0.26.0 tracked in #117. The 100-slide PDF takes 544 ms on one core (3166 ms before) and 256 ms on 16, and peaks at 169 MiB instead of 2182 MiB; the 100-slide PPTX takes 692 ms on one core (3299 ms before) and 276 ms on 16. The PDF is 792.4 KiB instead of 1005.5 KiB, because the font is embedded 3 times instead of 102; the pages are pixel-identical. go-slides is now faster than marp-cli on every deck, mode and core count measured.
Opaque photos go into the PDF as JPEG instead of raw pixels, and into PPTX and ODP as JPEG at their drawn size: on a real 6-slide deck the PDF is 10.0 MB โ 1.7 MB and the PPTX 24.0 MB โ 3.9 MB. Command line โ
--embed-assets makes the HTML page one file: local images and CSS url() become data: URLs (2.76 MB for a 6-slide deck). --pdf-raster-format jpeg makes the raster PDF's pages 4 times smaller (4.0 MB โ 1.0 MB); --set git.tag=โฆ overrides the git function. Command line โ
footer: '{{ git "describe" }}' prints the tag and commit a deck was built from, plus -dirty. The git binary is never run: the repository is read in Go, under 7 bounds. Templates โ
The slides command and its library: Marp’s Markdown parsed and rendered in Go, with Go templates and slide kinds on top. Released as v0.31.1: go install github.com/go-slides/slides/cmd/slides@latest.
The documentation (Hugo + Hextra), describing v0.31.1: getting started, Marp compatibility, templates, kinds and the command line. Source โ
The VS Code extension, as Marp for VS Code is Marp’s: decks previewed in VS Code’s Markdown preview by go-slides compiled to WebAssembly (no binary, works on vscode.dev), scrolling in sync with the editor through templates, errors in the Problems panel, completion of directives, kinds and template functions, an overview and a presenter view beside the editor, export through slides, with an accessible, tagged PDF. Install the .vsix attached to the GitHub release; publication on the Marketplace and Open VSX is prepared, but it is not there yet. VS Code โ
The mark โ a slide on its stand, in the document family’s indigo โ and every format of it: SVG, PNG, JPG, ICO, ICNS, avatar and social image.
slides-gitd, the self-hosted git backend for the go-slides playground: the forge’s credentials stay on the server, each user is isolated, and it runs behind oauth2-proxy. Pure Go.
With go-richdoc, go-ooxml, go-tex and go-docutils: documents read, typeset and written in Go, with no C anywhere.
The organisation on GitHub โ