HenniOKF
Documentation

Guide

Writing documentation

The rules of the bundle docs/, a new page, a new area and the test that checks everything.

What it is about

docs/ is a bundle in the Open Knowledge Format. The application shows it under /docs, see The documentation in the application. The documentation describes how the application is. The SPEC says how it shall be. If they contradict each other, the documentation is corrected.

The rules

  • Every file except index.md and log.md begins with YAML front matter:

    ---
    type: Guide
    title: Setup
    description: One sentence saying what is on the page.
    tags: [installation, setup]
    timestamp: 2026-11-30T12:00:00+01:00
    ---
    

    type is Concept (how something is), Guide (how to do something) or Reference (to look up). timestamp is a point in time after ISO 8601 with zone.

  • Every page stands in the index.md of its directory as the line * [<title>](<file>.md) - <description>, title and description word for word as in the front matter. The order there is the order in the table of contents.

  • An index.md has no front matter. Its title is its first heading. Only docs/index.md names okf_version and lists every area.

  • Sections begin with #. The application sets the title itself as the top heading and moves the others one level down.

  • Links are relative, such as [Security](../application/security.md). None leads into nothing or out of the bundle. Files outside, such as AGENTS.md or SPEC.md, stand in code notation.

  • File names of lowercase letters, digits and hyphens, also for images. Images as PNG, JPEG or WebP, no SVG.

  • log.md is ordered by days (## YYYY-MM-DD), newest first. An entry names the kind (Create, Update), the page and what changed.

  • Not in the docs: values of secrets, the development token, paths of a single computer, names of the own network and own domains. Placeholders stand in code notation instead, such as <subdomain>.<domain> or <path>. The documentation stands in the application, which reads it out publicly, and the repository becomes public.

  • English, addressing the reader as "you", factual and exact. What the documentation claims is checked against the code. A German UI text is quoted as it appears, in quotation marks.

Add a page

  1. Create the file in the fitting area, with complete front matter.
  2. Its line into the index.md of the area.
  3. An entry in docs/log.md under today.
  4. npm run check.

If a page changes, update timestamp and add to log.md.

Add an area

  1. A directory under docs/ with an index.md: first heading as title, a sentence, then # Pages with the lines.
  2. A line under "Areas" in docs/index.md.
  3. The path <area>/index.md in AREAS in tests/docs.test.ts. The test requires exactly the areas listed there.

The test

tests/docs.test.ts runs with npm run check and checks:

CheckWhat fails
exactly the expected areasa directory without an entry in AREAS or the other way round
complete front matter with a known typea missing field, another type, a timestamp without zone
every page in the directory of its foldera missing or differing line in index.md
no front matter in directoriesfront matter in an index.md other than the root
the root lists every areaan area missing in docs/index.md
no link into nothinga target that does not exist or leaves the bundle
the log by daysa heading in log.md that is no date, or the wrong order
no forbidden patternsa match from FORBIDDEN: paths in a home directory on macOS or Linux, the word of the development token, names of a tailnet

tests/docs-pages.test.ts checks the pages in the application: every file has exactly one address, every link has a page as target, every image is an image of the bundle.

The browser tests depend on single pages. e2e/docs.spec.ts, e2e/shell.spec.ts, e2e/access.spec.ts and e2e/i18n.spec.ts expect the heading "Documentation of HenniOKF" of docs/index.md with a link named "Application", the pages application/overview.md (type Concept, the only page of its area with "Overview" in its title), installation/setup.md (title "Setup") and development/structure.md with the section "Commands", a table with app/, a code block with npm run check and nowhere the front matter key of the time. Whoever renames or rebuilds them updates the tests.

Next: Texts in two languages.