Phase 04: Lesson framework: types, registry, renderer
Issue #5 · open
Part of #1.
What this phase delivers
The lesson content type, the registry that holds all lessons, and the LessonView component (prose + bottom Gotcha callout). One fully wired sample lesson (Hello, world).
Scope
src/content/types.ts:Lessonwithslug,title,section,order,body(markdown),runMode("playground" | "terminal" | "annotated"),starterCode?,terminalOutput?,streamReplay?: boolean,gotcha?: string,checkpoint?(Phase 10).src/content/lessons.ts: typed registry, exportslessons: Lesson[]andlessonBySlug(slug).src/components/LessonView.tsx: title, prose (react-markdown+remark-gfm), Gotcha callout box at bottom, placeholder code/terminal slot.- One authored sample: Hello, world (
runMode: "playground"). /lesson/:slugroute wired toLessonViewvia the registry.
Acceptance criteria
- [ ]
/lesson/hello-worldrenders prose + placeholder code area; no console errors. - [ ]
LessonViewshowsgotchaonly when present in a visually distinct callout. - [ ] Lesson type is exported and consumed in
lessons.tswith full type safety. - [ ] Markdown supports code fences, lists, links, inline code.
Dependencies
Requires: #4. Unblocks: #6, #7, #11, #12–#19.
Out of scope
- Real Monaco editor (Phase 05). Terminal pane (Phase 06). Checkpoint UI (Phase 10).
Decision references
D1.6, D1.7, D5.1, D5.2, D5.3, D5.4.
Estimate: 5–7h.