taper / docs /docs-as-code.md
abr00kx's picture
Upload Taper: hardened ephemeral E2EE messaging protocol (Matrix hard fork) (part 3)
24c463f verified
|
Raw History Blame Contribute Delete
2.4 kB
# Documentation as code
Taper's documentation is treated like its code: it lives in this
repository, changes through commits, and is checked automatically before
anything is pushed.
## The rules
1. **Docs live next to what they describe.** Each component has a README
(`server/`, `client/`, `desktop/`, `deploy/`). Guides and design notes are
in `docs/`, and the protocol specification is in `content/`.
2. **A change and its documentation land together.** A commit that adds a
setting, a command or a behavior updates the docs in the same commit (or
the same branch). A reviewer should reject a change whose docs are
missing.
3. **Plain text, standard formats.** Markdown for documents, CycloneDX JSON
for SBOMs, OpenAPI and JSON Schema for the specification's APIs. No
documents that only open in one program.
4. **Docs are versioned with the release.** A release's documentation is
whatever was in the repository at that tag. The source tarball contains
all of it.
5. **Write for the reader.** Short sentences, the active voice, and say
what something does before how. Present limits and risks as plainly as
features.
## What is checked
The local CI gate (`scripts/ci/gate.sh`, run by the git hooks) runs:
| Check | What it catches |
|-------|-----------------|
| `scripts/ci/check-docs.py` | Broken relative links and `#anchors`; a `TAPER_*` setting the code reads but no document mentions; a document in `docs/` missing from [the index](README.md) |
| Spell check (`typos`) | Misspellings, with the project's word list in `_typos.toml` |
| Spec checks and Hugo build | Invalid examples in the specification's schemas; a site that doesn't build |
| SBOM check | SBOMs that no longer match the lockfiles |
| Commit messages | [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), enforced by `.githooks/commit-msg` |
Behavior the documents promise is tested where it can be. For example,
every claim under "Proof that it works" in
[dead-mans-switch.md](dead-mans-switch.md) is an assertion in
`server/test-dms.js`.
## Commit messages
Commits follow Conventional Commits: `type(scope): description`, with types
`feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`,
`chore`, `revert` and `security`. Use `docs:` for documentation-only
changes. Install the hooks once per clone:
```sh
scripts/ci/install-hooks.sh
```