|
JS8Call-Improved master
|
This guide describes the repository's Doxyfile (.github/workflows/misc/Doxyfile) and the project's documentation conventions. Read this before writing a block, and run the check at the end before submitting one.
Commands are written with @, not \, throughout the tree. Keep to that, and do not use @fn: it misbehaves under 1.16.
WARN_AS_ERROR = NO, so the docs build will not fail on any of this. Nobody is going to catch it for you; check the log yourself.
At the top of every new file, named to match the file exactly, case included - a @file carrying the wrong name is a warning:
On a class, a @brief of one line, then as many plain paragraphs as the design needs - why it exists, what it guarantees, what it deliberately does not do:
On a function, a @brief, every parameter if any parameter is documented, and a useful return description for a non-void result:
Put the block immediately before the declaration, and leave out the structural command naming it: @fn, @class, @var and the rest are for blocks that sit elsewhere. @file is the exception.
A named namespace needs a block too, since doxygen documents a member only if the namespace holding it is documented. The anonymous namespace is exempt.
Because INHERIT_DOCS = YES, an undocumented override can inherit the base declaration's documentation. Do not restate it; document an override only where its behaviour genuinely differs.
Because DISTRIBUTE_GROUP_DOC = NO, documentation attached to one member is not distributed to the other members in its member group. Give each member its own block. Separately, assign module membership with @ingroup or by placing the declaration inside an @{ and @} group range; membership does not require physically moving the declaration. New groups are defined in docs/defines.dox; source files only join one.
An addition to the API gets @note Network Message API x.y+ in its block, where the version is the next release, and docs/API.md is updated in the same PR.
Markdown works inside blocks, and AUTOLINK_SUPPORT turns names that resolve into links. A name that does not resolve is silently left as plain text rather than warning, so wrap anything you do not want linked - and anything you are unsure of - in backticks.
That holds inside a Markdown table as well: a bare @name in a cell is read as a command and warns, while backticks, \@ and @@ each silence it and render a plain at-sign. An HTML entity does not - @ reaches the page unrendered.
Write for the maintainer who has to change the code: the brief, the contract a caller has to honour, and any constraint the signature does not show. Not the implementation, not the reasoning behind it. A block longer than the function is hard obstructs as much as the inline comments it replaced.
CI builds the docs with doxygen 1.16.1, fetched prebuilt by build-and-deploy-docs.yml. A distro package may report a different set of warnings, so check its version first and account for the version when investigating a discrepancy.
Define this helper in a shell. It reads the complete configuration, disables every output generator and Graphviz, and optionally narrows INPUT:
The first line of the log is always warning: No output formats selected!. That is the helper doing its job - it has turned every generator off - not something in the tree. Ignore it.
Run the same command on committed revisions in separate clean worktrees and compare the logs. Do not switch a worktree that contains edits: Git can carry those edits across the switch and spoil the baseline. For example, after creating worktrees at /tmp/js8-master and /tmp/js8-change:
Strip each worktree's own prefix before the diff, as above. Doxygen reports absolute paths, so the two logs share no line at all until you do, and the diff comes back one hundred per cent changed. This is the step that makes the comparison worth running: on a tree that emits roughly two thousand warning lines to begin with, an unnormalised diff tells you nothing.
Investigate each remaining difference by cause. A changed line number can make an existing diagnostic look new, and a change can expose a regression reported in a file that the diff did not touch.
While iterating on a single file you can narrow the input, which is much faster:
A narrowed run reports references it cannot resolve because the rest of the tree is missing, so use it to iterate and the full run above to decide you are done.
The full docs build only runs on a PR labelled documentation, or on a manual dispatch of build-and-deploy-docs.yml. Do not rely on it to tell you about a problem you could have seen locally.
The three failures that actually happen, in order: omitting @brief because the prose reads like one; documenting two of three parameters; and inventing a command or a tag that this Doxyfile does not define. Write the block, run the warning-only command, and investigate every diagnostic change your diff causes. Do not start rewriting unrelated documentation because the log mentions it; that backlog predates you, and a diff that grows into it will be rejected on scope.