Prism
GuideCookbookExamplesErrorsPlayground

Guide

01Lessons & Slides02Exercises03Scene & State04Objects05Three dimensions06Controls07Timeline08Loops & Logic09Expressions & Math

Guide · 01 of 09

Lessons & Slides

A Prism file is either a bare scene { ... } (one visualization) or a lesson { ... } (a full multi-slide lesson). A slide is a composition: any prose, at most one scene, at most one exercise, and any number of goals — in any order. There is no "text slide" vs "quiz slide"; you just include the parts you need.

lesson#

The top-level container. Holds lesson metadata and an ordered list of slides. These properties are the source of truth for how the lesson appears in the catalog: unit groups it under a heading on the course page, difficulty and icon render on its card, and summary is the one-line description. course tags which track it belongs to; skills lists the skill ids it teaches. An unknown property here is a compile error, so a typo cannot silently drop your metadata.

lesson "Title" {
  [course: "..."]
  [unit: "..."]
  [difficulty: "Beginner"|"Intermediate"|"Advanced"]
  [icon: "..."]
  [summary: "..."]
  [skills: ["...", "..."]]
  slide "..." { ... }
  ...
}
proptypedescription
coursestringtrack id, e.g. "calculus"
unitstringunit heading on the course page
difficulty"Beginner" | "Intermediate" | "Advanced"shown on the lesson card
iconstringlesson card icon, one of: Check, ChevronRight, Circle, Dumbbell, FunctionSquare, LineChart, Link, Lock, MapPin, Move, Play, Ruler, Sigma, Star, TrendingUp, Triangle, Undo2, Waves, X
summarystringone line describing the lesson
skillsstring[]skill ids this lesson teaches

Example

A quadratic graphs as a parabola.

slide#

One screen of a lesson. Compose it from prose, an optional scene, an optional exercise (quiz/build), and optional goals. cat groups slides into sections; skill tags the specific skill this slide drills.

slide "Title" {
  [cat: "..."]
  [skill: "..."]
  > prose...
  scene ... { ... }
  <exercise>
  goal "..." { ... }
}
proptypedescription
catstringsection/category label
idstringstable id (auto-slugged from the title if omitted)
skillstringskill id this slide targets
hiddenbooleankeep off the main path; only reachable as an onwrong: detour

Example

Drag the vertex — the curve follows.

>#

A prose line. Everything after > is raw text — markdown (**bold**, *italic*) and $inline$ / $$display$$ LaTeX all work. Consecutive prose lines join into one paragraph.

> markdown text with $latex$

Example

The discriminant D=b2−4acD = b^2 - 4acD=b2−4ac tells you how many roots exist.

goal#

Gates the slide's Continue until the learner satisfies when (a boolean expression over the scene's state — it latches once true). Use it for guided tasks like "drag the vertex below the axis".

goal "Instruction" { when: <condition>, [hint: "..."] }
proptypedescription
when*exprboolean condition over scene state
hintstringnudge shown if the learner is stuck

Example

-6-4-2246-6-4-2246
Make both roots negativeDrag both points left.

onwrong#

Adaptive branching. Goes inside any exercise: if the learner gets it wrong, they take a detour to the named slide (which must be a hidden: true slide in the same lesson) and then come back. A scaffold is an ordinary slide, so it can carry its own prose, scene, and exercise. Add retry to return the learner to the original question for another attempt; leave it off to move them forward instead. Detours fire at most once per question and cannot chain.

onwrong: "slide-id" [retry]
proptypedescription
onwrong*stringid of the hidden slide to detour to
retryflagsend them back to the question afterwards instead of onward

Example

What is the derivative of (3x+1)2(3x+1)^2(3x+1)2?
Next →Exercises

On this page

lessonslide>goalonwrong