Keep the docs current¶
The reference pages describe behavior, so a change to the code can make a page wrong. Treat the docs as part of the change:
- Before you open a pull request, run
rake docs:stale. It lists each page whosesourcesyou changed while the page didn't change. Read each page it names, and update what your change made wrong. A page that's still right needs no edit. CI prints the same list as warnings on the pull request. - When a page starts or stops describing a file, add it to or remove it from the page's
sources. A source can be a file or a directory. - When you add a page or change a page's
titleordescription, runrake docs:indexto regenerate the page lists in everyindex.md. - Run
rake docs:check. It fails on a page withouttype,title, ordescription, on a source that doesn't exist, and on an index that's out of date. CI runs it on every push, and so doesrake.
Frontmatter¶
Each page starts with Open Knowledge Format (OKF) frontmatter:
type:Referencefor a page that describes behavior,Glossaryfor the terms,Designfor the rationale, andContributingfor the pages about working on Hot Cell itself.titleanddescription: the page's name and one-line summary, which the section's index lists.order: optional. An index lists the pages that have anorderfirst, in that order, and the rest by file name.sources: the code that the page describes. When that code changes, the page might need to change too.
Tables held to the code¶
Some tables are held to the code by tests, which fail when the two disagree:
| Table | Test |
|---|---|
Codes and kill causes in docs/codes.md |
hotcell-core/test/docs_test.rb |
Events in docs/observability.md, and defaults in docs/cell-settings.md |
hotcell-server/test/docs_test.rb |
Shipped operation limits in docs/active-storage.md |
activestorage-hotcell-server/test/docs_test.rb |