# Document Structure — oma-explanation > The structural and rhetorical contract for all generated HTML explainer documents. > Read this document to understand WHAT content is generated and in what tone. > For HOW the HTML is styled and behaves, see `html-contract.md`. > **Authoring path**: write a draft and render it with `oma explain render` (see > `draft-format.md`). The four sections below become panels in the same order; the renderer > supplies the page shell, so the TOC and diagram-markup rules in sections 1 and 6 apply > literally only to the hand-written HTML fallback. Topic-mode pages follow `draft-format.md` > and are not bound to the four sections. --- ## 1. Overall Shape Every explainer document must be a **single long scrolling page**. Do **not** use top-level tabs or multi-page navigation. The document must begin with a Table of Contents (TOC), followed strictly by these four fixed sections in order: 1. **Background** 2. **Intuition** 3. **Code** 4. **Quiz** --- ## 2. Background The Background section establishes context before presenting any code changes. It is composed of two tiers: - **Tier A (Deep Background)**: Broadly explains the surrounding system or architecture. Must be explicitly marked "skippable if you already know the system." - **Tier B (Narrow Background)**: Directly explains the context relevant to the specific change. *Note on Reader Level:* If the requested reader level is `reviewer`, aggressively condense Tier A (Deep Background). --- ## 3. Intuition The Intuition section conveys the core essence of the change without diving into full implementation details. - **Toy-Data Examples**: Concrete toy-data examples are **mandatory**. Show, don't just tell, how the inputs and outputs change. - **Visuals**: Liberally use diagrams (see Section 6) to establish mental models early. --- ## 4. Code The Code section is a high-level walkthrough of the changes. - **Comprehension Order**: Group and order the code walkthrough for human comprehension. Do **not** simply list files in alphabetical or git-diff order. - **Reference**: Reference code using `file:line` notation where useful. --- ## 5. Quiz The Quiz verifies understanding. While `html-contract.md` defines the interaction and JS behavior, this document governs question quality: - **Count**: 5 questions by default (this count is parameterizable). - **Difficulty**: Medium. Questions must be answerable only if the reader understood the substance of the change. No trick questions or gotchas. - **Coverage**: Each question must target a distinct aspect of the change. - **Distractors**: Wrong options (distractors) must be highly plausible. - **Feedback**: **Every** option (correct and incorrect) must have accompanying feedback text explaining exactly why it is right or wrong. --- ## 6. Diagram Families Visual consistency is critical. Pick **2–3 diagram families** per document and **reuse** them across sections to build continuity. ### Family Catalog Choose from the following conceptual families: - **Simplified UI Mock**: Abstracted representation of what the user sees. - **System/Data-Flow Diagram**: Component interaction flows carrying **example data** directly on the arrows. - **Before/After State**: Visual comparison of the system state before and after the change. ### Format & Responsiveness Constraints - Diagrams must be rendered using **HTML/CSS** or **inline SVG** only. - **ASCII art is strictly forbidden.** - **Responsive Container**: Every diagram must be wrapped in a `