Cantrip
One Markdown file in. A slideshow and a PDF out.
Open with why this exists: a deck belongs in version control, as text. Keep this slide to about twenty seconds.
The format is just Markdown
Slides are separated by a line of three dashes. Everything else is ordinary Markdown, so the file still reads as a document.
- Bold, italic,
code,struckand highlighted text - Lists, nested lists, and task lists
- Tables, code blocks, blockquotes, images
- Key caps: Ctrl C
Stress that the file is readable even without the tool.
Front matter sets the deck up
---
title: Cantrip
author: mplx
theme: grimoire
mode: dark
ratio: 16:9
transition: slide
---A --theme, --mode, --ratio, or --transition on the command line overrides the file.
Lists and tasks
- A first point
- with a sub-point
- and another
- A second point
Nested lists indent under the parent item.
Tasks and tables
- Parse the Markdown
- Render the HTML
- Render the PDF
- Present it
| Output | Command | Default name |
|---|---|---|
| HTML | cantrip html talk.md | talk.html |
cantrip pdf talk.md | talk.pdf | |
| Both | cantrip build talk.md | both of the above |
Code reads as code
use io;
func greet(name as string) {
io.printf("hello, %s\n", $name);
}
greet("ada");Fenced blocks keep their language, so the HTML carries a class="language-jennifer" for a highlighter to pick up.
Callouts
Note
A blockquote that opens with an alert marker becomes a callout.
One slide, one page
A slide that outgrows its page continues onto the next, and the tool says so.
Themes that match your manual
Cantrip ships the ten themes of the Grimoire book builder under their own names, each light and dark, so a talk can wear the look of its docs:
In grimoire.toml | In the deck |
|---|---|
theme = "grimoire" | theme: grimoire |
theme = "nordic" | theme: nordic |
theme = "terminal" | theme: terminal |
Every theme is light and dark: mode: dark opens the deck dark, and m switches. cantrip themes lists all 13. The manual this deck comes with wears obsidian, so a talk beside it would wear obsidian too.
Try cantrip build examples/sample.md --theme nordic to show the same deck in another theme. The PDF stays light whichever palette the screen uses.
Transitions
The slideshow animates between slides. This deck asks for slide:
fadecross-fades, and is the defaultslidepushes sideways, from the right going forwardzoomscales the old slide out and the new one innoneswitches at once
Tip
A viewer whose system asks for reduced motion gets no animation at all.
Speaker notes
Notes live in an HTML comment, so every other Markdown renderer ignores them:
<!-- notes: what to say here, and what to skip -->Press s in the slideshow to see them. Pass --notes to print them into the PDF.
This is the slide about notes, which is itself carrying a note. Mention that notes never reach the audience's copy unless asked for.
Driving the slideshow
| Key | Does |
|---|---|
| Right Space | next slide |
| Left | previous slide |
| o | overview |
| s | speaker notes |
| m | light / dark mode |
| f | fullscreen |
| ? | every shortcut |
Thank you
The source of this deck is examples/sample.md.
Stop here and take questions.