Skip to main content

Module format

Module format 

Source
Expand description

Turning answers, questions and errors into styled transcript lines.

Constants§

ACCENT
BAD
CHOICE
DIM
NOUL
SCORE
WARN

Functions§

answer_lines
Render one answer: the number, the distribution it came from, and what it means.
bar
A probability meter. Eighteen columns is enough to read a distribution at a glance.
bold
color_for
cost_lines
The cost estimate as a small table: which question spends what, and — when rates are set — the money at the bottom. Tokens are estimated, so the numbers are a shape, not a bill. hint is how this host sets rates, since the terminal has :cost and other hosts have their own.
dim
error_lines
Errors are part of the lesson: show the variant, what it means, and what to do.
plain
question_lines
One line per question, the way it will go on the wire.
styled
text_of
JSON strings read better unquoted; everything else stays JSON.