Where help lives: help systems and docs-as-code¶
Exercise help-systems-docs-as-code-annex.pdf · PDF
Have you ever read the manual of your phone? No. Have you searched "how to..." for an app this week? Probably. Have you hovered over an icon to find out what it does? Almost certainly, without even noticing. So you do read documentation, all the time. You just never read it where its author expected.
Your app can already draw screens, save data and print a report. Nobody but you knows how. This unit fixes that by putting the help where the reader already is. This page draws the map: where help can live, which tools produce it, and how to write it once instead of three times.
What you will learn
- Name the three places where help lives and what each one is good and bad at
- Tell apart the kinds of documentation and the three readers they serve
- Identify help-generation systems by what goes in and what comes out
- Explain docs-as-code and why a single source in Markdown beats copying text around
- Draw the docs map of your own app
- The trap: why "documentation is a PDF you write at the end" guarantees three versions that disagree
The game box¶
Keep one picture in your head for the whole unit: a board-game box.
Open the box of Catan (Klaus Teuber, 1995). Its rules say on the first page that they come in three parts: a Game Overview on the back cover, the Game Rules to start playing, and an Almanac to look things up during the game. There is a fourth kind of help that nobody calls documentation: the text printed on the cards themselves.
Every piece of the box has a twin in your app:
| In the box | In your app | Lesson |
|---|---|---|
| Overview and beginners' set-up | Tutorial: learn by playing one guided game | Admin manuals, data and tutorials |
| Game rules | User manual: how to do each task | Zensical site and Pandoc PDF |
| Almanac | Reference guide: every control, ready to look up | Zensical site and Pandoc PDF |
| Text on the cards | Context-sensitive help: on the screen, at the moment you need it | Context help and screenshots |
| "Before your first game: punch out the pieces" | Installation, configuration and administration manuals | Admin manuals, data and tutorials |
| The list of components | The structure of the persistent data | Admin manuals, data and tutorials |
Two words need separating:
Documentation is everything that explains the app to someone who is not you. Help is the documentation the user meets while using it.
And "someone who is not you" comes in three kinds. Keep them in a column in your head, because every page you write is for one of them:
| Reader | Who it is | What they want |
|---|---|---|
| End user | The person using the app | To get something done |
| Administrator | Whoever installs it and keeps it running | To get it working, and keep it working |
| Developer | The next programmer, or you in June | To understand it without breaking it |
Three places where help lives¶
Open LibreOffice Writer and press F1. A help window appears. Where did that text come from: your disk, or the internet?
Both answers have been true. Windows 3.0 (1990) shipped help as WinHelp files (.hlp). Microsoft released HTML Help (.chm) as its replacement in 1997. Today F1 usually opens a web page. The formats change, but the question stays: where should this sentence live so the reader finds it?
There are three answers:
| Place | What it is | Good at | Bad at |
|---|---|---|---|
| Web docs | A documentation website: many linked pages and a search box | Always the latest version. Searchable. You can send someone one page | Needs a connection. Nobody reads it in order |
| One document with a cover, page numbers and a table of contents | Works offline. Printable. One file to attach to a delivery or a contract | Out of date the day after. Hard to reach from inside the app | |
| In-app help | Text on the screen itself: labels, hints under a field, tooltips, tours | There at the exact moment and place of the doubt | No room: one or two sentences. Costs code to change |
Which one is best? None. A real product has all three, and they all say the same thing. That is exactly the problem the rest of this page solves.
Careful: documentation is not a PDF you write at the end
A PDF is one format. The same content must also be a website and live inside the app. Start with the PDF and you will copy and paste it twice. From that day on, the three versions disagree.
Help-generation systems¶
You do not write a website or a PDF by hand. You write a source, and a tool produces the result.
A help-generation system is a tool that takes a source and produces help in a format.
For each tool, ask two questions: what goes in, and what comes out?
| System | What goes in | What comes out | Where you meet it |
|---|---|---|---|
| Zensical | A folder of Markdown files and a zensical.toml |
A documentation website (static HTML) | The site you are reading |
| Pandoc | One document in almost any format | The same document in another format: PDF, DOCX, HTML... | This unit |
| Typst | A .typ file, or what Pandoc hands it |
A typeset PDF | Unit 6 |
| Storybook | Your components and their stories | A site documenting each component | Unit 4 |
| Playwright | A script that drives the real app | Screenshots, identical on every run | Unit 4 |
| Your Svelte app | Text in the components | The in-app help | This unit |
Two of these have a story worth knowing. Pandoc dates from 2006. Its author, John MacFarlane, is a philosophy professor at Berkeley, and the project describes itself as "a universal document converter". Zensical is far younger: Martin Donath and the team behind Material for MkDocs announced it on 5 November 2025. It is younger than your phone and it is still before version 1.0, so check its documentation when something looks different.
Notice the last row. Not everything has a generator. If the answer must appear next to a form field, no tool writes it for you: it is code, in your app.
Docs-as-code¶
Lessons on this site live in plain files like docs/tema-1/apple-hig.md. Change one word, save, and zensical serve reloads the page. Run git log and you see commits, exactly like code.
Docs-as-code means writing documentation with the same tools as code.
The Write the Docs community lists those tools: plain text markup, version control, code reviews, automated tests and issue trackers. For you, it means Markdown files, in the same Git repository as the app, built by commands.
The format is Markdown, created by John Gruber in 2004. It is plain text that you can read before any tool touches it, which is why it survives every change of tool. Write it once and let two tools read it:
flowchart LR
S["<b>docs/*.md</b><br>one text, written once"]
S -->|"Zensical"| W["<b>Website</b><br>the rules, online"]
S -->|"Pandoc + Typst"| P["<b>PDF</b><br>the rules, printed"]
That idea is called a single source: every format is generated from one text, so a correction reaches all of them. It is the same promise as the variables you met in Figma: change it in one place.
Careful: docs-as-code does not mean comments in the code
The documentation is treated like code. It lives in its own files (docs/), next to the code. A change in the app and the change in its manual travel in the same commit.
A few more wrong ideas you will hear:
| You may hear | The truth |
|---|---|
| "Nobody reads documentation." | Nobody reads it in order. Everybody searches it, and everybody reads what is on the screen |
| "I will write the docs when the app is finished." | Then they describe an app that no longer exists. Same commit: the change and its page |
| "A good interface needs no documentation." | It needs less user help. Installation, settings and data still have to be written down |
| "Markdown is too simple for a manual." | Simple is the point: it is the one format every tool in this unit can read |
The docs map of your app¶
Before writing a word, draw the plan. A docs map is a sitemap for your documentation: one card per page. Every card answers four questions:
- Who reads it?
- When do they read it?
- Where does it live: web, PDF or in-app?
- Which file produces it?
Here is the map of NoteBox, the small notes app used as the example throughout this unit:
| Page | File | Reader and moment | Format |
|---|---|---|---|
| NoteBox documentation | docs/index.md |
Everyone, arriving. One table: "If you want to... read..." | Web |
| Your first note (tutorial) | docs/tutorial.md |
New user, the first two minutes | Web + tour |
| User manual | docs/user-manual.md |
User with a task: add, tag, delete and undo, move notes to another PC | Web + PDF |
| Reference guide | docs/reference.md |
User looking up one control: every field, button, setting and message | Web + PDF |
| Admin manuals | docs/admin.md |
Whoever installs and maintains: requirements, settings, backup, reset | Web + PDF |
| Data structure | docs/data.md |
Developer or administrator: keys, fields, types, rules, backup file | Web |
| Help on the screen | src/lib/HelpTip.svelte |
User in the middle of a task | In-app |
Look at the last row. It is not a docs page, it is a component. Help on the screen lives in your code.
Now draw yours, with seven cards at least: one tutorial, two user-manual tasks, one reference page, one page to install, configure and administer, one data page, and two things marked in-app. Four mistakes are common:
- Cards named after screens ("Settings", "Home"). Ask what the reader wants to do. A user-manual card is a task: "Export a report as PDF".
- The reader is "the user" on every card. The installation page is for whoever installs. The data page is for a developer or an administrator.
- Everything is web and PDF. Which page would somebody really print or attach to a delivery? Usually the user manual and the admin manuals, not the tutorial.
- Nothing is in-app. Which field of your app did your classmates fill in wrong when they tested it? That one.
Your map is more than a drawing. It becomes the table of contents of everything you write in this unit.
Key takeaways¶
- Help lives in three places: web docs, PDF and in-app. A real product has all three, saying the same thing.
- Documentation explains the app to someone who is not you, and it has three readers: end user, administrator and developer.
- A help-generation system turns a source into a format. For each tool, ask what goes in and what comes out.
- Docs-as-code means Markdown files, in Git, next to the code, built by commands.
- A single source is written once and generated into every format, so the versions cannot drift apart.
- A docs map gives every page a reader, a moment, a format and a file.
Quick check¶
1. A small shop wants its staff to have the manual on paper in the back room, where there is no internet. Which place suits that need best?
- A PDF, because it works offline and can be printed
- A website, because it always shows the latest version
- In-app help, because it appears at the moment of doubt
- Code comments, because they sit next to the program
A PDF works offline and prints as one file. Its weakness is that it goes out of date, which is why you generate it from a single source instead of editing it by hand.
2. What makes a tool a help-generation system?
- It takes a source and produces help in a format
- It answers users' questions in a chat window
- It stores every old version of a document
- It checks the spelling of a finished manual
A help-generation system has an input and an output. Zensical turns Markdown into a website. Pandoc turns one document format into another. Playwright turns a script into screenshots.
3. Which description matches docs-as-code?
- Documentation in plain text files, in Git, built by commands
- Documentation written as comments inside the source code
- Documentation generated by reading the compiled program
- Documentation kept in a shared word processor online
Docs-as-code treats documentation like code: plain text, version control, reviews and automated checks. It lives in its own files, such as docs/, next to the code and not inside it.
4. Why write one Markdown source instead of a website and a PDF separately?
- A correction made once reaches every format
- A Markdown file is smaller than a PDF file
- Readers prefer to read the raw Markdown text
- Websites cannot display text written by hand
With a single source, every format is generated from one text. Two separate documents start to disagree the first time somebody fixes only one of them.
5. Who is the main reader of a page that explains how to back up the app and restore it?
- The administrator who keeps the app running
- The end user in the middle of a task
- The developer who is adding a new feature
- The designer who is drawing the next screen
Backup and restore are about keeping the app alive, which is the job of the administrator. Naming the reader of each card is what stops every page turning into "for the user".
6. In a docs map, which card title is written the right way for a user manual?
- Export a report as PDF
- Settings screen
- The Home page
- Report component
A user-manual card names a task, something the reader wants to do. The other three name parts of the app, which tell you nothing about what the reader came to achieve.
7. A library's lending app has a long manual, yet readers keep entering their card number with spaces and getting an error. Where should the fix go first?
- On the screen, next to the card number field
- In a new chapter at the start of the manual
- In a printed sheet handed out at the front desk
- In the data structure page of the documentation
The doubt appears at one moment, in one field, so that is where the help belongs: in-app. The reader in the middle of a task will not go and open a manual.
Now you have a map. In the next lesson, Zensical site and Pandoc PDF, the map becomes a real website and a real PDF.