# Learn

Learn turns a graph into a line. The learning graph has every concept as a node, with an edge from A to B when B makes sense only after A. The hard work is choosing which concepts come first and which sit together in one section.

## Map the learning graph

Before writing or restructuring Learn, sketch the learning graph in your working notes: every concept, and the concepts each one needs first. The graph is a thinking tool. It stays in your notes and is never committed or checked.

The graph has no cycles. A **forward mention** is a cycle: it relies on a concept the reader meets later. Order the sections so each concept's home comes before its first use. Where a forward mention survives every ordering, keep it to a name and a link, and count it as a cost to remove later.

## Order the sections

- **Group related concepts.** Concepts that share a problem or are used together share a section.
- **Go broad first.** Early sections give the reader a sense of the whole: several concepts at a shallow depth.
- **Go deep later.** Later sections return to a concept for its detail.
- **Go deep early on an unlocking concept.** When one concept unlocks most of the rest, teach it in depth early.

The first section names the problems the library solves and why the reader needs it. It is the only place in the docs that sells.

## The problem-first arc

Every section runs this arc. It is an arc, not a template: the headings are free, and a broad section can run it once for a group of concepts.

1. **The problem.** Something the reader tries to do, in their words. Show it with code that hurts without the concept. A problem can also be conceptual, or a **gap**: something the reader expects the platform or another tool to fill. Name the gap.
2. **The concept.** Introduce it as the solution, by its glossary term. Link to the concepts it builds on.
3. **The concept working.** A concise example that solves the problem. See [`examples.md`](examples.md).
4. **What it unlocks.** A line that points to the sections that build on it.

## Asides

Depth a first-time reader can skip goes in an **aside**: a collapsible block, closed by default. Leaves of the learning graph and edge cases are typical asides. A returning reader opens it; a first-time reader keeps their place in the line.

## Homes

Each concept's home is a heading in Learn. A concept does not need its own page or chapter, but its heading has a stable anchor, because Reference, Guides and the rest of Learn link to it.

---

### MIT license

```text
MIT License

Copyright (c) 2026 Matt Pocock

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```