decktalk-runtime.js and skip this guide. Use this guide only when a page
comes from another framework and cannot include the runtime. It lists what the recorder and
decktalk shots need, and it shows a small page that does all of it.
Before you start
You need to write JavaScript. Read The page contract first.Meet the needs of the recorder
The recorder drives the page through its URL and a few globals. This table pairs each action of the recorder with what your page does.
The magenta cover belongs to the recorder, so a page needs no cover of its own.
How it works explains what the cover does.
Support decktalk shots
decktalk shots uses the page in three ways:
- It opens the page with no query and reads
window.__decktalk.catalog. If the page has no catalog,shotswarns and skips the page. - It opens
?step=IDfor each step id in the catalog. With--cue, it opens?step=ID&cue=CUE. - In frame mode,
shots --section N --at Sopens the recorder’s URL. It logswindow.__decktalk.firedwith each frame.
decktalk preflight also reads catalog[].cues, which maps each step id to its cue ids in autoplay order. It opens
?step=ID&cue=CUE and ?step=ID&before=CUE. A page whose catalog has no cues gets every cue skipped as
RUNTIME_OUTDATED.
Write the minimal page
The page below follows the whole contract in about forty lines. It has one scene with one step. Each cue shows the element with the matchingdata-cue.
deck/plain.html
- Save the page as
deck/plain.html. - Add a
[[section]]withpage = "deck/plain.html"andscene = 1. - Add cues
1.1aand1.1bfor that section incues.json. - Open
deck/plain.html?step=1.1in a browser to see every element.
?scene=1 shows nothing until you add
&beats=1.1a@1,1.1b@2 to the URL.
Compare with the runtime
The runtime gives a page more than this minimal page does:- an index of scenes and steps
- autoplay from
holdanddata-at - reveal effects, count-ups, typewriting, and word sync
- KaTeX typesetting, with a wait for the library
- a camera push
- a warning for each mismatch between cues and steps
- a list of gaps between animation frames
Next
- Learn how a page plays: The page contract
- Look up the runtime’s fields: Runtime
- Write a page with the runtime: Your first deck