deckrun 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,12 @@ Write slides in Markdown or bring a self-contained HTML document, run a local se
5
5
  - **Two formats** - Markdown decks with slide-by-slide presentation, or self-contained HTML documents with continuous scrolling
6
6
  - **Live editor** - edit alongside a live preview, with autosave and a library of all your decks and docs
7
7
  - **14 themes** - unique palettes, typography, animated backdrops, four type sizes, and customizable heading and body fonts
8
+ - **Templates and motion** - four composition templates and five transitions, switchable without touching the Markdown
9
+ - **Technical content** - KaTeX equations and Mermaid diagrams in preview, presentation, HTML, and PDF
10
+ - **Incremental reveals** - step through bullets, prose, equations, code, or diagrams without duplicating slides
11
+ - **Deck linting** - catch empty slides, broken fences/math, dense content, image issues, and invalid reveal markers locally or in CI
8
12
  - **Presenter tools** - laser pointer, drawing pen, blank canvas, blackout mode, and `?` for shortcuts
13
+ - **Notes while presenting** - present from the editor and its preview and notes panel follow the deck tab, so the editor is your notes screen
9
14
  - **Export** - Markdown, HTML, headless-rendered PDF, or a standalone presenter-ready HTML page
10
15
  - **Local-first** - binds only to `127.0.0.1`; nothing is uploaded, and your work stays in browser local storage until export
11
16
 
@@ -21,7 +26,21 @@ npx deckrun
21
26
 
22
27
  ## Installation
23
28
 
24
- Install globally from npm:
29
+ Install with a single command. On Linux and macOS the installer bootstraps
30
+ Node.js (>= 16) automatically if it's missing, then installs deckrun from npm:
31
+
32
+ ```bash
33
+ curl -fsSL https://raw.githubusercontent.com/arpitbbhayani/deckrun/master/install.sh | sh
34
+ ```
35
+
36
+ On Windows, the PowerShell installer does the same (installs the Node.js LTS
37
+ via winget, or downloads it, when needed):
38
+
39
+ ```powershell
40
+ irm https://raw.githubusercontent.com/arpitbbhayani/deckrun/master/install.ps1 | iex
41
+ ```
42
+
43
+ Or install globally from npm directly:
25
44
 
26
45
  ```bash
27
46
  npm install -g deckrun
@@ -31,8 +50,8 @@ Or run it without installing:
31
50
 
32
51
  ```bash
33
52
  npx deckrun # open the editor
34
- npx deckrun slides.md # present a local file
35
- npx deckrun <url> # present a public Markdown or HTML URL
53
+ npx deckrun slides.md # open a local file in the editor, present from there
54
+ npx deckrun <url> # open a public Markdown or HTML URL in the editor
36
55
  ```
37
56
 
38
57
  ## Usage
@@ -41,10 +60,12 @@ npx deckrun <url> # present a public Markdown or HTML URL
41
60
  # Write a new deck in the built-in editor
42
61
  deckrun
43
62
 
44
- # Serve on the default port 7890 and open the browser
63
+ # Open a file in the editor on the default port 7890. The editor saves back
64
+ # to the file, edits made to the file on disk reload the editor, and
65
+ # Cmd/Ctrl+Enter presents.
45
66
  deckrun slides.md
46
67
 
47
- # Present a self-contained HTML page instead of a Markdown deck
68
+ # Open a self-contained HTML page instead of a Markdown deck
48
69
  deckrun page.html
49
70
 
50
71
  # Serve on a custom port
@@ -53,6 +74,9 @@ deckrun slides.md -p 3000
53
74
  # Start the server without opening a browser tab
54
75
  deckrun slides.md --no-open
55
76
 
77
+ # Open the file without watching it for changes on disk
78
+ deckrun slides.md --no-watch
79
+
56
80
  # Show a launch overlay that enters fullscreen on the first key or click
57
81
  deckrun slides.md --fullscreen
58
82
 
@@ -63,19 +87,39 @@ deckrun slides.md --theme paper --size xl
63
87
  # Or set the two faces yourself
64
88
  deckrun slides.md --theme tokyo --head-font playfair --body-font lora
65
89
 
90
+ # Recompose the same Markdown and choose how slides move
91
+ deckrun slides.md --template editorial --transition fade
92
+
93
+ # Check one or more decks before presenting or committing them
94
+ deckrun lint slides.md
95
+ deckrun lint talks/*.md --format json
96
+
66
97
  deckrun --list-themes
67
98
  deckrun --list-sizes
68
99
  deckrun --list-fonts
100
+ deckrun --list-templates
101
+ deckrun --list-transitions
69
102
  ```
70
103
 
71
104
  On start, the CLI prints the slide count and the local URL:
72
105
 
73
106
  ```text
74
- 8 slides from slides.md
75
- present → http://127.0.0.1:7890 (Ctrl+C to stop)
107
+ 8 slides from slides.md · opening in the editor
108
+ editor → http://127.0.0.1:7890 (Ctrl+C to stop)
109
+ write on the left, live deck on the right. saves back to slides.md.
110
+ edits to slides.md on disk reload the editor as well.
76
111
  ```
77
112
 
78
- With no file or URL, it starts the editor instead:
113
+ A file passed on the CLI opens straight into the editor, backed by the file
114
+ rather than the browser library: what you type autosaves back to the file,
115
+ and edits made to the file on disk — from your own editor, a build step, an
116
+ agent — reload the deckrun editor and its live preview. Pass `--no-watch`
117
+ to turn off the disk watching. Presenting (`Cmd/Ctrl+Enter`) works exactly
118
+ as it does for library decks. A document fetched from a URL opens the same
119
+ way, but read-only toward its origin: nothing is written back, so download
120
+ or duplicate it to keep changes.
121
+
122
+ With no file or URL, it starts the editor on its browser library instead:
79
123
 
80
124
  ```text
81
125
  editor → http://127.0.0.1:7890 (Ctrl+C to stop)
@@ -89,17 +133,22 @@ The server binds to `127.0.0.1` only, so the deck is never exposed on the networ
89
133
 
90
134
  | Option | Default | Description |
91
135
  | --------------------- | ------- | ------------------------------------------------------ |
92
- | `[file]` | | Markdown file, HTML file, or public URL to present. Omit it to open the editor. |
136
+ | `[file]` | | Markdown file, HTML file, or public URL to open in the editor. Omit it for a blank editor. |
93
137
  | `-p, --port <number>` | `7890` | Port to serve the presentation on |
94
138
  | `--no-open` | `false` | Start the HTTP server without opening the browser |
139
+ | `--no-watch` | `false` | Do not watch the opened file for changes on disk |
95
140
  | `--fullscreen` | `false` | Prompt to enter fullscreen on the first key or click |
96
141
  | `--theme <name>` | `nord` | Any of the fourteen themes, by id |
97
142
  | `--size <name>` | `m` | Type size: `s`, `m`, `l`, or `xl` |
98
143
  | `--head-font <name>` | | Override the theme's heading and title face |
99
144
  | `--body-font <name>` | | Override the theme's body face |
145
+ | `--template <name>` | `classic` | Composition: `classic`, `minimal`, `editorial`, or `spotlight` |
146
+ | `--transition <name>` | `slide` | Motion: `slide`, `fade`, `zoom`, `lift`, or `none` |
100
147
  | `--list-themes` | | Print every theme with its mood and blurb, then exit |
101
148
  | `--list-sizes` | | Print every type size with what it is for, then exit |
102
149
  | `--list-fonts` | | Print every face and its kind, then exit |
150
+ | `--list-templates` | | Print every composition template, then exit |
151
+ | `--list-transitions` | | Print every slide transition, then exit |
103
152
  | `-v, --version` | | Print the version number |
104
153
  | `-h, --help` | | Print help for the command |
105
154
 
@@ -107,6 +156,25 @@ An unknown `--theme`, `--size`, or font is an error rather than a silent fallbac
107
156
 
108
157
  `--size`, `--head-font`, and `--body-font` apply to Markdown decks only. An HTML doc brings its own typography; passing any of them alongside an `.html`/`.htm` file prints a notice and is otherwise ignored.
109
158
 
159
+ ### `deckrun lint`
160
+
161
+ The lint command performs fast, browser-free checks and reports the source
162
+ line, slide number, severity, and rule id for each problem:
163
+
164
+ ```bash
165
+ deckrun lint slides.md
166
+ deckrun lint intro.md architecture.md
167
+ deckrun lint slides.md --format json
168
+ deckrun lint slides.md --max-warnings -1
169
+ ```
170
+
171
+ It catches empty decks/slides, unclosed code fences and display math, untagged
172
+ code fences, excessive prose or bullets, overly long headings, missing image
173
+ alt text, invalid image opacity, and malformed or excessive reveal markers.
174
+ Errors fail the command. Warnings also fail by default, making the command
175
+ useful in CI; `--max-warnings N` changes that threshold and `-1` allows any
176
+ number of warnings. Pass `-` as the file to lint standard input.
177
+
110
178
  ## The editor
111
179
 
112
180
  Run `deckrun` with no file and it serves an editor instead of a deck. A deck already in this browser resumes with no extra step, exactly as before. The first time you run it — or any time you choose "new" from the library with nothing open yet — you land on a start screen instead: a new Markdown deck, a new or uploaded HTML doc, or the library. Pick Markdown and you get the usual pane pair, Markdown on the left and the live deck on the right, plus a library of every deck and doc you have written.
@@ -123,7 +191,7 @@ The preview is not an approximation. Every keystroke is parsed by the same parse
123
191
  ### The two bars
124
192
 
125
193
  The top bar is for decisions: the deck name, the library, and then everything
126
- that changes what the deck looks like — `theme`, `font`, and the `S M L XL`
194
+ that changes what the deck looks like — `template`, `theme`, `font`, and the `S M L XL`
127
195
  type size — with `guide`, `insert`, `new`, `export`, and `present` beside
128
196
  them.
129
197
 
@@ -159,6 +227,12 @@ Three surfaces exist so you never have to remember the syntax:
159
227
 
160
228
  A tip line in the status bar cycles through the rest.
161
229
 
230
+ The Markdown start screen also carries template and transition choices. Pick
231
+ them before creating or importing a deck, or use the `template` menu later.
232
+ Templates are CSS compositions rather than source transformations, so changing
233
+ one after the deck is finished immediately recomposes every slide while the
234
+ Markdown remains byte-for-byte unchanged.
235
+
162
236
  ### Images
163
237
 
164
238
  Images are referenced by path, exactly as in a file-based deck. The editor serves the directory you launched in, so launch `deckrun` next to your diagrams and `![Diagram](diagram.png "right")` resolves.
@@ -173,7 +247,7 @@ Editing is a plain source pane on the left and a live preview on the right — n
173
247
 
174
248
  Presenting wraps the doc in an iframe and layers the tool belt that still makes sense with no slides — laser pointer, pen, blank canvas, blackout, fullscreen, and `?` for controls — on top of it. There is no HUD, slide counter, overview grid, or arrow-key navigation, since there is nothing to count or step through.
175
249
 
176
- A doc authored in the browser editor is expected to be self-contained: inline styles and scripts, and assets from a CDN or a `data:` URI rather than a relative local path, since editor-mode present and PDF serve it from an in-memory copy, not from a folder on disk. A file passed on the CLI does not have that restriction — `deckrun page.html` serves it from the file's own directory, exactly like a Markdown deck's images, so `<img src="diagram.png">` next to `page.html` resolves normally.
250
+ A doc authored in the browser editor is expected to be self-contained: inline styles and scripts, and assets from a CDN or a `data:` URI rather than a relative local path, since editor-mode present and PDF serve it from an in-memory copy, not from a folder on disk. A file passed on the CLI does not have that restriction — `deckrun page.html` serves assets from the file's own directory, exactly like a Markdown deck's images, so `<img src="diagram.png">` next to `page.html` resolves normally.
177
251
 
178
252
  If a doc runs its own script that listens for keyboard input — an embedded framework, a game, a chart with its own shortcuts — it may end up racing deckrun's own listener for a key, since both are attached to the same page. Presenter shortcuts are best-effort in that case, not guaranteed to win.
179
253
 
@@ -219,7 +293,7 @@ With no such browser on the machine, the editor falls back to opening the deck w
219
293
 
220
294
  The HTML export is the same page `deckrun` serves: styles and the navigation runtime are inlined, so it opens from disk, and keyboard, touch, overview, and fullscreen all still work. Two things do not travel with it, since it is one file rather than a bundle:
221
295
 
222
- - Fonts and syntax highlighting load from a CDN, so a viewer needs a connection to see them exactly as you do. The theme's colors and its backdrop are inline, so those hold up offline.
296
+ - Fonts, syntax highlighting, KaTeX, and Mermaid load from pinned CDNs in a standalone export, so a viewer needs a connection to see them exactly as you do. The theme, template, transitions, colors, and backdrop are inline.
223
297
  - Images and videos referenced by path stay on your disk. Ship them alongside, or host the page where those paths resolve.
224
298
 
225
299
  An HTML doc's PDF is not paginated to 16:9 slides — it prints the doc's own `@page`/print CSS (or Chrome's defaults if it has none), exactly as if you had opened the file yourself and pressed print. There is no presenter chrome to strip, since the doc is printed on its own, without the tool-belt wrapper.
@@ -370,6 +444,67 @@ function parseSlides(markdown: string): Slide[] {
370
444
 
371
445
  Code blocks scroll horizontally when a line is too long, so long lines never reflow mid-presentation.
372
446
 
447
+ ### Math and Mermaid diagrams
448
+
449
+ KaTeX renders inline math with single dollar delimiters and display math with
450
+ double dollars. The bracket forms `\(...\)` and `\[...\]` work too:
451
+
452
+ ```markdown
453
+ The amortized cost is $O(1)$ per operation.
454
+
455
+ $$
456
+ T(n) = T(n/2) + O(n) = O(n)
457
+ $$
458
+ ```
459
+
460
+ Mermaid diagrams use an ordinary language-tagged fence:
461
+
462
+ ````markdown
463
+ ```mermaid
464
+ sequenceDiagram
465
+ Client->>API: Request
466
+ API->>Store: Read
467
+ Store-->>API: Result
468
+ API-->>Client: Response
469
+ ```
470
+ ````
471
+
472
+ Both render in the live preview, a presented deck, standalone HTML, and PDF.
473
+ The editor waits for the equation or diagram before measuring slide overflow,
474
+ and PDF rendering uses the copies installed with deckrun rather than waiting on
475
+ a CDN. Invalid source stays visible as an error on the slide instead of
476
+ silently disappearing.
477
+
478
+ ### Incremental reveals
479
+
480
+ Append `{reveal}` to a bullet or another Markdown block. Forward navigation
481
+ reveals each marked block before advancing to the next slide; backward
482
+ navigation hides revealed blocks before returning to the previous slide:
483
+
484
+ ```markdown
485
+ ## Three stages
486
+
487
+ - Parse the Markdown
488
+ - Build semantic HTML {reveal}
489
+ - Render the final slide {reveal}
490
+ ```
491
+
492
+ Put the marker on its own line to reveal the entire block after it. This works
493
+ for paragraphs, blockquotes, equations, code fences, and Mermaid diagrams:
494
+
495
+ ````markdown
496
+ {reveal}
497
+ ```mermaid
498
+ graph LR
499
+ Markdown --> HTML --> PDF
500
+ ```
501
+ ````
502
+
503
+ The editor preview and grid show the complete slide so you can author and
504
+ detect overflow against the final state. Overview thumbnails and PDF also show
505
+ all content; reveals are interactive only while presenting. Reduced-motion
506
+ preferences keep the reveal but remove its movement.
507
+
373
508
  ### Embeds and inline HTML
374
509
 
375
510
  Raw HTML passes through untouched, so anything the browser can render can live on a slide.
@@ -403,7 +538,7 @@ Rolling deployment with zero downtime.
403
538
  <!-- notes: Review database migration rollout steps before advancing. -->
404
539
  ```
405
540
 
406
- Every such comment is stripped from the slide, so notes never leak into the projected output or the PDF export. There is no presenter window yet, so the notes are not displayed anywhere either. See [Not supported yet](#not-supported-yet).
541
+ Every such comment is stripped from the slide, so notes never leak into the projected output or the PDF export. When you present from the editor, the notes of the slide on screen are shown in the editor's notes panel instead.
407
542
 
408
543
  ### Image layout directives
409
544
 
@@ -561,6 +696,32 @@ Picking does not close the menu, because choosing a heading and then a body is
561
696
  one decision. Both are remembered per browser and travel into the deck you
562
697
  present and the PDF you export.
563
698
 
699
+ ### Templates and transitions
700
+
701
+ Templates compose with themes. A theme owns color and type; a template owns
702
+ spacing, alignment, rules, image treatment, and the overall reading rhythm:
703
+
704
+ | id | composition |
705
+ | ----------- | ------------------------------------------------------------------ |
706
+ | `classic` | The original balanced deckrun layout |
707
+ | `minimal` | Quiet surfaces, wider margins, fewer decorative treatments |
708
+ | `editorial` | Strong rules and magazine-like reading rhythm |
709
+ | `spotlight` | Centered, high-impact composition for concise keynote slides |
710
+
711
+ Pick one on the editor start screen or switch it later from the `template`
712
+ menu. Switching only changes the root `data-template` attribute and CSS, so an
713
+ existing deck transforms instantly and its Markdown is untouched.
714
+
715
+ The same menu carries five independent transitions: `slide`, `fade`, `zoom`,
716
+ `lift`, and `none`. `prefers-reduced-motion` suppresses their spatial motion,
717
+ and print/PDF disables them entirely.
718
+
719
+ ```bash
720
+ deckrun slides.md --template spotlight --transition zoom
721
+ deckrun --list-templates
722
+ deckrun --list-transitions
723
+ ```
724
+
564
725
  ### Type and motion
565
726
 
566
727
  Slides also assemble rather than appear: each top-level block on a slide rises
@@ -623,8 +784,8 @@ built deck, so overriding a single value in a fork stays a one-line change.
623
784
 
624
785
  | Key | Action |
625
786
  | ------------------------------------ | ---------------------------------------- |
626
- | `Right`, `Down`, `Space`, `PageDown` | Advance to the next slide |
627
- | `Left`, `Up`, `Backspace`, `PageUp` | Return to the previous slide |
787
+ | `Right`, `Down`, `Space`, `PageDown` | Advance to the next reveal or slide |
788
+ | `Left`, `Up`, `Backspace`, `PageUp` | Return to the previous reveal or slide |
628
789
  | `Home` | Jump to the first slide |
629
790
  | `End` | Jump to the last slide |
630
791
  | `O` | Toggle the overview grid |
@@ -690,6 +851,17 @@ Press `B` to drop the screen to black, for the moment when the room should be lo
690
851
 
691
852
  Press `F` at any time to toggle fullscreen. Browsers only grant fullscreen from a user gesture, which is what `--fullscreen` works around: it shows a launch overlay that requests fullscreen on the first key or click, so the deck opens fullscreen without a manual step.
692
853
 
854
+ ### Notes while presenting
855
+
856
+ Present **from the editor** (`Cmd+Enter`) and the deck opens in its own tab; the editor tab stays yours. Its preview and speaker-notes panel follow the deck's current slide, so the deck goes on the projector and the notes stay on your screen.
857
+
858
+ - A `following deck · n` chip appears in the status bar, showing the slide the deck is on. It follows however you advance the deck — keys, footer arrows, overview.
859
+ - Typing in the editor (or clicking the chip) stops the following and hands the screen back to the caret. Presenting again turns it back on.
860
+ - The link is live: it survives a reload of either tab.
861
+ - The notes shown are the slide's `<!-- notes: ... -->`, the same text the audience never sees.
862
+
863
+ A deck run straight from a file has no editor to follow it; present it through the editor instead (`deckrun`, then drag the file onto it, then `Cmd+Enter`) to get the notes during the talk.
864
+
693
865
  ## Visual design
694
866
 
695
867
  - Terminal aesthetics throughout, set in IBM Plex Mono with a blinking mauve cursor in the top right corner.
@@ -708,23 +880,22 @@ From the editor, press `Cmd Shift S` or pick PDF from the `export` menu, and a f
708
880
  - Slides are sized in absolute units for print. Viewport units resolve against the page box in paged media, which is why a deck laid out in `vw` and `vh` came out as clipped portrait pages.
709
881
  - The HUD, arrows, overview, cursor, pets, keyboard hint, fullscreen prompt, annotation canvas, laser pointer, blackout, and controls overlay are all hidden.
710
882
  - Speaker notes are stripped at parse time, so they never reach the PDF.
883
+ - Incremental fragments are fully revealed, so printed and exported slides never omit content.
711
884
 
712
- Loading any deck with `?print=1` on the URL opens the print dialog once fonts and highlighting have settled. That is the editor's fallback when there is no browser to drive, and it works on a file-backed deck too:
713
-
714
- ```bash
715
- deckrun slides.md --no-open
716
- # then open http://127.0.0.1:7890/?print=1
717
- ```
885
+ Loading any presented deck with `&print=1` on its URL opens the print dialog once fonts and highlighting have settled. That is the editor's fallback when there is no browser to drive.
718
886
 
719
887
  ## Local asset server
720
888
 
721
- `deckrun` serves the generated HTML at `/` and everything else relative to the directory holding the Markdown file. In editor mode there is no Markdown file, so it serves the directory you launched in. Local images, diagrams, videos, and fonts load over `http://` instead of `file://`, which avoids CORS restrictions on local assets.
889
+ `deckrun` serves the editor at `/` and everything else relative to the directory holding the opened file. Launched without a file, it serves the directory you launched in. Local images, diagrams, videos, and fonts load over `http://` instead of `file://`, which avoids CORS restrictions on local assets.
722
890
 
723
891
  - Served types include HTML, CSS, JS, JSON, PNG, JPEG, GIF, SVG, WebP, AVIF, ICO, MP4, WebM, WOFF, WOFF2, and TTF. Anything else is sent as `application/octet-stream`.
724
892
  - Requests that resolve outside the Markdown file's directory return `403`. Missing files return `404`.
725
893
  - If the requested port is taken, the server falls back to a random free port and prints the URL it settled on.
726
894
 
727
- Google Fonts, Highlight.js, and the pet sprites load from CDNs, so a first run needs network access. Once the browser has cached them, the deck renders offline apart from the pets.
895
+ KaTeX and Mermaid are served from the copies installed with deckrun, which
896
+ keeps live preview and PDF rendering independent of the network. Google Fonts,
897
+ Highlight.js, and the pet sprites still load from CDNs, so a first run needs
898
+ network access for those visual extras.
728
899
 
729
900
  ## Generating decks and docs with Claude Code
730
901
 
@@ -750,7 +921,8 @@ deckrun
750
921
 
751
922
  The skill is a personal Claude Code skill and is not bundled with this package. Add it under `~/.claude/skills/blog-to-slides/SKILL.md` to make it available across projects.
752
923
 
753
- One caveat: the skill emits LaTeX for formulas, which `deckrun` does not render. Rewrite formulas as inline code or a code block, or drop them.
924
+ Formulas emitted as dollar-delimited LaTeX render with KaTeX. Mermaid fences
925
+ from generated Markdown render as diagrams as well.
754
926
 
755
927
  ### HTML documents
756
928
 
@@ -838,16 +1010,16 @@ Two decks ship in `examples/`:
838
1010
  - `examples/example-2.md` is a full technical talk on databases and agentic AI
839
1011
 
840
1012
  ```bash
841
- # Run the feature showcase deck
1013
+ # Open the feature showcase deck in the editor
842
1014
  deckrun examples/example-1.md
843
1015
 
844
- # Or open the editor and drag either file onto it to edit
1016
+ # Or open the blank editor and drag either file onto it to import
845
1017
  deckrun
846
1018
 
847
- # Run the technical talk in light theme on port 3000
1019
+ # Open the technical talk in light theme on port 3000
848
1020
  deckrun examples/example-2.md -p 3000 --theme solarized --size l
849
1021
 
850
- # Run fullscreen without opening a browser
1022
+ # Present fullscreen on the first key or click, without opening a browser
851
1023
  deckrun examples/example-1.md --fullscreen --no-open
852
1024
  ```
853
1025
 
@@ -855,11 +1027,8 @@ deckrun examples/example-1.md --fullscreen --no-open
855
1027
 
856
1028
  Worth knowing before you plan a talk around them:
857
1029
 
858
- - No presenter view while presenting. The editor shows the notes for the slide you are on, but the presented deck has no second window, no next-slide peek, and no timer.
859
1030
  - No live reload in file mode. Editing the file needs a restart of the CLI. The editor previews as you type, so use it for the writing loop.
860
- - No LaTeX or math rendering, and no Mermaid diagrams. Use fenced code blocks or ASCII diagrams.
861
- - No incremental reveal of bullets within a slide.
862
- - No slide-level transition or layout overrides beyond the image directives.
1031
+ - Templates and transitions currently apply to the whole deck rather than one slide at a time.
863
1032
  - No `file://` mode. The deck always runs through the local HTTP server.
864
1033
  - The editor does not upload or embed images. It stores Markdown, and images load by path from the folder you launched in.
865
1034
  - The library lives in one browser and one origin. It does not sync between browsers or machines, so download anything you cannot afford to lose.
@@ -887,6 +1056,10 @@ The source:
887
1056
  - `src/index.ts` is the CLI, the HTTP server, the editor routes, and port selection
888
1057
  - `src/parser.ts` splits slides, extracts notes, and resolves image directives
889
1058
  - `src/themes.ts` is the theme registry and the type scale: palettes, font catalog, backdrop patterns, size presets, and the CSS they all emit
1059
+ - `src/presentation-options.ts` is the composition-template and transition registry
1060
+ - `src/fragments.ts` contains incremental-reveal styles and DOM preparation shared by preview and presentation
1061
+ - `src/lint.ts` implements the static deck authoring rules behind `deckrun lint`
1062
+ - `src/rich-content.ts` detects and renders KaTeX and Mermaid content, with a shared readiness signal
890
1063
  - `src/generate.ts` holds the slide CSS, the presenter chrome, and the deck runtime
891
1064
  - `src/preview.ts` is the editor's preview iframe, sharing the slide CSS with the deck
892
1065
  - `src/editor.ts` is the editor page: highlighting, palette, guide, nudges, autosave
@@ -8,6 +8,7 @@ export const SNIPPET_GROUPS = [
8
8
  "Text",
9
9
  "Lists & tables",
10
10
  "Code",
11
+ "Math & diagrams",
11
12
  "Images",
12
13
  "Embeds",
13
14
  "Actions",
@@ -48,6 +49,23 @@ export const SNIPPETS = [
48
49
  syntax: '<!-- notes: what to say here -->',
49
50
  insert: "\n<!-- notes: {caret} -->\n",
50
51
  },
52
+ {
53
+ id: "reveal-item",
54
+ group: "Slides",
55
+ label: "Reveal step",
56
+ hint: "Add the marker to a bullet or paragraph. Advance reveals it before changing slides.",
57
+ syntax: "- next point {reveal}",
58
+ insert: "{sel} {reveal}",
59
+ },
60
+ {
61
+ id: "reveal-block",
62
+ group: "Slides",
63
+ label: "Reveal next block",
64
+ hint: "A marker on its own line reveals the equation, code block, diagram, or paragraph after it.",
65
+ syntax: "{reveal}\\n```mermaid",
66
+ insert: "{reveal}\n{caret}",
67
+ block: true,
68
+ },
51
69
  // ── Text ─────────────────────────────────────────────────────────────────
52
70
  {
53
71
  id: "h2",
@@ -217,6 +235,42 @@ export const SNIPPETS = [
217
235
  insert: "```text\nClient --> [ LB ] --> [ App ] --> [ DB ]\n{caret}\n```",
218
236
  block: true,
219
237
  },
238
+ // ── Math & diagrams ─────────────────────────────────────────────────────
239
+ {
240
+ id: "math-inline",
241
+ group: "Math & diagrams",
242
+ label: "Inline math",
243
+ hint: "KaTeX renders the expression in the surrounding sentence.",
244
+ syntax: "$E = mc^2$",
245
+ insert: "${caret}E = mc^2$",
246
+ },
247
+ {
248
+ id: "math-display",
249
+ group: "Math & diagrams",
250
+ label: "Display equation",
251
+ hint: "Double dollar delimiters center a standalone equation.",
252
+ syntax: "$$\\sum_{i=1}^{n} x_i$$",
253
+ insert: "$$\n\\sum_{i=1}^{n} x_i = \\frac{n(n+1)}{2}\n$$",
254
+ block: true,
255
+ },
256
+ {
257
+ id: "mermaid-flowchart",
258
+ group: "Math & diagrams",
259
+ label: "Mermaid flowchart",
260
+ hint: "Rendered in the preview, presentation, HTML export, and PDF.",
261
+ syntax: "```mermaid\ngraph LR",
262
+ insert: "```mermaid\ngraph LR\n A[Input] --> B{Valid?}\n B -->|yes| C[Process]\n B -->|no| D[Reject]\n```",
263
+ block: true,
264
+ },
265
+ {
266
+ id: "mermaid-sequence",
267
+ group: "Math & diagrams",
268
+ label: "Mermaid sequence",
269
+ hint: "Use a sequence diagram for request, event, and protocol flows.",
270
+ syntax: "```mermaid\nsequenceDiagram",
271
+ insert: "```mermaid\nsequenceDiagram\n Client->>API: Request\n API->>Store: Read\n Store-->>API: Result\n API-->>Client: Response\n```",
272
+ block: true,
273
+ },
220
274
  // ── Images ───────────────────────────────────────────────────────────────
221
275
  {
222
276
  id: "img-inline",
@@ -325,6 +379,11 @@ export const TIPS = [
325
379
  "L turns on a laser pointer while presenting. D gives you a pen to draw with.",
326
380
  "C drops a blank canvas over the slide, for the diagram you did not plan.",
327
381
  "B blacks out the screen mid-talk. Press it again to come back.",
382
+ "Write $E = mc^2$ for inline KaTeX, or wrap a display equation in double dollars.",
383
+ "A fenced mermaid block becomes a diagram in the preview, presentation, and PDF.",
384
+ "Templates change composition without touching your Markdown; transitions are independent.",
385
+ "Add {reveal} to a bullet or put it before a block to step through a slide one idea at a time.",
386
+ "Run deckrun lint slides.md before presenting or in CI to catch common authoring mistakes.",
328
387
  ];
329
388
  /** Deck loaded on a first visit. Doubles as the feature tour. */
330
389
  export const WELCOME_DECK = `# deckrun
@@ -365,6 +424,32 @@ func (w *WAL) Append(e Entry) error {
365
424
 
366
425
  ---
367
426
 
427
+ ## Math and diagrams stay in Markdown
428
+
429
+ The same source renders live and survives PDF export:
430
+
431
+ $$
432
+ T(n) = T(n/2) + O(n) = O(n)
433
+ $$
434
+
435
+ \`\`\`mermaid
436
+ graph LR
437
+ Markdown --> Preview --> Present --> PDF
438
+ \`\`\`
439
+
440
+ ---
441
+
442
+ ## Reveal one idea at a time
443
+
444
+ - This point is visible when the slide opens
445
+ - This one appears on the next advance {reveal}
446
+ - Then this one {reveal}
447
+
448
+ {reveal}
449
+ > A marker on its own line reveals the whole block after it.
450
+
451
+ ---
452
+
368
453
  ## Tables, lists, and accents
369
454
 
370
455
  | Configuration | Throughput | p99 latency |