Before you start
Start from the scaffold, and remove its section 3.- Create a project with
decktalk init my-lesson. The scaffold puts the runtime and KaTeX indeck/. - Go into the project with
cd my-lesson. - In
script.md, delete the text from## 3. How AI learnsup to## 4. The edit. - In
decktalk.toml, delete the[[section]]table that hasnumber = 3. - In
cues.json, delete the"3"entry.
deck/index.html. It has scenes 1, 2, 4, 6, 7, and 5, and no scene 3. The steps below add a new section 3 that plays on deck/index.html instead of deck/lesson.html.
Register each scene number only one time in a page. A second DeckTalk.scene(3, …) replaces the first, and no warning appears.
How the four files connect
One section number and one cue id tie the four files together.
The
narrate stage also writes a words file for the section, with the start and end of every spoken word. The beats stage matches each cue phrase against those spoken words.
Write the section
1
Add the script to script.md
Paste this section into Each
script.md, between section 2 and section 4.script.md
## N. Title heading starts a section. The voice does not speak text in square brackets. [beat] makes a short pause, and [pause 3] asks the voice for three seconds of silence. script.md lists every rule.2
Add the section to decktalk.toml
Paste this table between the section 2 and section 4 tables.Every script section needs one
decktalk.toml
[[section]] table with the same number. page names the page, and scene names the scene that the page plays. decktalk.toml lists every key.3
Add the cues to cues.json
Add this entry under Each reveal starts on one phrase:
"sections".cues.json
- The bowl draws on “loss surface”.
- Each move of the point starts on the phrase that names it, such as “take a step”.
- The update rule appears on “learning rate”.
- The overshoot path draws on “overshoot”.
- The settled point appears 0.2 s after the start of “settle”, because its offset key is 0.2.
3.1 cue on $start only mounts the step at 0.0 s, so decktalk verify skips it as REFERENCE_CLAMPED. If the speech is shorter than min_seconds, decktalk beats reports an uncertain finding. Cues explains how phrases match.4
Add the scene to deck/index.html
Paste the
<style> and <script> blocks just before </body> in deck/index.html.deck/index.html
- A scene is a list of steps, and each step renders one slide. Step
3.1owns every cue here, because itscuesobject names each one. - An element with
data-cuestays hidden until its cue fires.data-fxpicks its reveal effect. - The bowl path has
pathLength="1"anddata-fx="draw", so its stroke draws overdata-dur(1.6 s). - KaTeX typesets the
data-texelement. The plain text inside the element is the fallback.
Look before you build
Check the slide in a browser and in screenshots before you record it. Browser preview and recording says which page values a browser preview uses and which values the recording uses.- Open
deck/index.html?step=3.1in a browser. The step mounts with every element visible. - Open
deck/index.html?scene=3&hud=1. The scene plays in autoplay, with the clock on top. - Take a screenshot of every step with
decktalk shots. The PNG files go underbuild/shots/. - Estimate every reveal with
decktalk preflight. It freezes the page before and at each cue, and flags a reveal too small forverifyasTHIN CHANGE?orNO CHANGE.
narrate stops, because it would empty the narration cache. Skip these actions there.
- Write estimated word times with
decktalk narrate --silent. - Print each cue time with
decktalk beats.
cue id@cue time, in seconds after the section start. If a phrase is not in the spoken words, beats prints phrase not found, and build stops.
Build and verify
Build the video without an account, then measure the reveals.- Build the video with
decktalk build --silent. - Measure two cues with
decktalk verify 3:3.1rule 3:3.1p1.
changed. The offset column is the time from the cue time to the onset of the reveal, in milliseconds. decktalk verify reports OFF CUE and exits 1 when that time is outside the offset limit. Only a silent build gives the a/v column, because only the click track has clicks. Verify defines every column.
If you have an ElevenLabs key in .env, run decktalk build to voice the video. It spends credits on every section, because the last build was silent.
The finished section
These are the four files of the section, in one place.Next
- Copy a common slide: Slide recipes
- Make the script time well: Writing for the ear
- Open the video with a clip: Add a clip section