Skip to main content

Module learn

Module learn 

Source
Expand description

lux learn — the language’s own teaching material, built into the binary.

The content lives in learn-lux.md and is baked in at compile time, so the reference a learner holds always matches the binary’s behaviour and needs no network or stray file. That one file is also the test corpus: every example here is real lux that the suite runs and converts.

The file is a sequence of topics, each read at two levels. A topic’s card is one screen — a stable id, a title, a one-sentence concept, a runnable example, and an optional try: experiment that nudges the learner back to the editor. An earned, optional more page carries the deeper why, the universal name for the idea, and reason-annotated cross-references. The id is the join key — what you type (lux learn match), what a guided lesson lists, and what an error message points at. Everything lux learn shows is some traversal of this one list of topics, plus two pages of furniture: the basics skeleton and the graduation ladder.

Structs§

More
The earned second level of a topic: the deeper prose, plus any reason-annotated cross-references to related topics.
See
One cross-reference: a topic id and the reason a learner would follow it.
Topic
A single learnable idea. The card is always present; more is earned.

Functions§

basics
lux learn basics: the shape every procedural language shares.
beyond
lux learn beyond: what you keep after you outgrow lux.
lookup
Resolve one lux learn argument: a guided lesson name or a topic id (card).
menu
lux learn with no argument: a short landing page — the guided lessons, how to look up one topic, how to go deeper, and how to read the whole thing.
paths
The guided lessons, exposed so a test can check every member resolves.
topic_more
Resolve lux learn <topic> more: the topic’s deeper page, or its card with a note when the topic has no deeper page.
topics
Parse every <!-- topic: id --> block in document order.
tour
The whole language top to bottom: intro, the basics skeleton, every card, then the ladder.