Skip to main content
Most pages should include 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, shots warns and skips the page.
  • It opens ?step=ID for each step id in the catalog. With --cue, it opens ?step=ID&cue=CUE.
  • In frame mode, shots --section N --at S opens the recorder’s URL. It logs window.__decktalk.fired with 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

Start the page clock only inside DeckTalk.startClock(). A page that starts its clock at load fires every cue early, and every reveal in the video comes before its word.
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 matching data-cue.
deck/plain.html
To use the page in a project, follow these steps:
  1. Save the page as deck/plain.html.
  2. Add a [[section]] with page = "deck/plain.html" and scene = 1.
  3. Add cues 1.1a and 1.1b for that section in cues.json.
  4. Open deck/plain.html?step=1.1 in a browser to see every element.
The page has no autoplay timing. A browser preview with ?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 hold and data-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
Runtime lists all of it. A page by hand can add any of these features.

Next