7 · Directives reference
Every card marker and % key: value directive in one place. Scope is where
each may appear — deck = the header (before the first card), card = after a
card’s front, anywhere = both. Each links to the chapter that explains it in
full.
| Token | Scope | What it does |
|---|---|---|
# front | card | Starts a card at column 0; the indented lines below are the answer. → ch 3 |
#? front | card | A cloze card; blanks are {{spans}} in the answer line. |
! line | card | A note, shown after you answer. → ch 3 |
% line | anywhere | A comment — ignored, unless it’s one of the directives below. |
% mode: | deck · card | Answer mode: flip, typing, fuzzy, choice, line, explain. |
% order: | deck | Card order: scheduled (default) or sequential. → ch 5 |
% scheduler: | deck | Scheduler: leitner (default) or sm2. |
% direction: | deck · card | Review direction: forward, reverse, both. |
% unlock-stage: | deck | Stage that opens the gate 1–5: the exam/unlock fires once every card reaches it (cards keep drilling). |
% frontend: | deck · card | Restrict to any, tui, or web. → ch 6 |
% img: / % img-back: | card | Image on the front / back (web only). |
% img-dir: | deck | Base directory image filenames resolve against. → ch 6 |
% title: | deck | Display name shown instead of the file name. |
% requires: | deck | Prerequisite deck that gates unlocks (repeatable). |
% link: | deck | ask-Claude reference URL — tutor-only (repeatable). |
% source: | deck | Exam ground truth (URL/file, repeatable); also a trace’s path origin, and a tutor reference. |
% strictness: | deck | Exam grading rigor: strict, balanced, lenient. |
% trace: | deck | What a trace walks; its presence makes the deck a trace. |
% at: | card | A locator into the % source: (file:lines): a trace checkpoint’s reveal target, or a fact card’s source citation shown on reveal. |
% given: | card | A trace checkpoint’s off-screen symbol, as name — meaning (repeatable). |
% link: vs % source:
Two that look similar but aren’t. Both point at material a deck is about, but
% source: is the exam’s ground truth — questions are generated from it and
answers graded against it — and a URL source doubles as a tutor reference.
% link: is only a tutor reference and never becomes exam material; use it for
supplementary reading the exam should ignore. The implication runs one way: a
% source: URL is offered to the tutor, but a % link: is never promoted to a
source.
Precedence
Where a setting can come from several places, the more specific wins:
CLI flag > card
%directive > deck%directive > workspace[defaults]> built-in default
So --mode on the command line overrides a card’s % mode:, which overrides the
deck’s, which overrides a workspace’s [defaults], which overrides alix’s default.