stilo

The tutorial

How the tutorial that stilo tutor serves is built, how its lessons check exercises, and how to change it. Decision: S14. The command itself is in The CLI.

What it is

tutorial/, at the root of the repository, is a folder of Texl documents in the Stilo file format: a guided tutorial for new users, which teaches by doing. The OnLabs.org manual stays the reference; lessons link to its pages (https://www.onlabs.org/manual/…) instead of repeating them.

tutorial/
├─ index.texl                  the table of lessons, with each one's progress
├─ 01-welcome.texl … 12-…      the core path, about 30–45 minutes
├─ 13-…, 14-…                  advanced lessons
├─ files/                      what lessons link to: beam.svg, beam-drawing.pdf,
│                              report.texl (lesson 11, one error on purpose)
└─ references/
   ├─ tutorial/index.texl      the checks: `tutorial.check`, `.progress`, `.tag`
   └─ steel/sections.texl      the reference lesson 8 imports

The user never edits this folder: stilo tutor copies it and makes the copy a package (package.texl, references/stilo.texlz), so ~ and data tables work. The source alone is not a package: open lessons through a copy (uv run stilo tutor --dir /tmp/t), not with stilo serve tutorial.

Lessons

Each lesson starts with a hidden formula cell that imports the tutorial library:

<!--{ fo00 : formula | hidden }-->
<% texl.import "~/references/tutorial/index.texl" ~> (lib -> bind "tutorial" lib.data) %>

then a heading # N. Title, short sections, and at the end a line Next: [N+1. Title](….texl) · Back to the [index](index.texl). Cell names are four characters, a two-letter prefix per lesson and a number (fo05). Prose cells are rich when they can be (no tags, tables or HTML), otherwise markdown.

index.texl imports every lesson in a hidden cell, one tag each (a tag waits only for the promise it returns), and tutorial.progress counts the tags of each that showed “✓ Done” or “○ Not yet”. A lesson without checks shows “try it”.

Tests

Keeping it current

A change visible to users (a key, a command, a pane, a cell type, a stilo option) updates the lesson that teaches it, in the same commit, together with its solution if a check changes. CLAUDE.md and the /commit-changes skill say so. Lessons that change for an existing user show up only after stilo tutor --reset; stilo tutor proposes it when the copy was made by an older Stilo.