Skip to main content

Module sketch

Module sketch 

Source
Expand description

Sketch notation: the whole request written as one page of plain text, the way you would scribble a rubric on paper. The shape of each question is read off its punctuation, so there is nothing to select — you write what you mean and the gutter tells you what it became.

The payout failed again, third time this month. I'm done waiting.
---
is_urgent? The message conveys urgency or time-sensitivity
  yes: A deadline, a threat to leave, or "ASAP"
  no: Routine, no time pressure

department: Which team should handle this
  billing = Payment or subscription issues
  technical = Bugs or integration problems
  sales

frustration: How frustrated the customer appears
  Calm < Frustrated but civil < Very angry
  • Everything above the first --- line is the state (JSON if it parses as JSON).
  • name? instructions is a yes/no question (noul); yes: / no: lines describe the outcomes.
  • name: instructions followed by label = description lines (or bare labels) is a choice.
  • name: instructions followed by levels joined with < is a score, lowest first.
  • name! {json} sends a hand-built question object, like Question::Raw.
  • The parts of a question can also go on its first line, separated by |.
  • @model jev-2 pins the model; # starts a comment. Indentation is only for reading.

Structs§

Parsed
A parsed sketch. Questions with problems are left out of questions but keep their tags, so the page still reads sensibly while it is being fixed.
Problem

Enums§

Tag
What one line of a sketch turned out to be; shown in the editor gutter.

Functions§

highlight
A sketch, highlighted for the transcript: heads bold in their kind’s colour, bodies in it.
parse
render
The session as a sketch — the inverse of parse, so a page can be opened, edited and applied without losing anything.
value
Text becomes a JSON value when it is written as one (an object, an array or a quoted string); anything else is sent as the plain string it is.