Documentation site¶
The documentation at https://wpun.cariss.dev is built from the Markdown files in docs/ with MkDocs Material, in Docker like everything else. mkdocs.yml holds the navigation and the theme, and docs/stylesheets/extra.css the Solarized colour schemes. A new page needs an entry in the nav of mkdocs.yml: the strict build fails on a page that is left out.
Building and checking¶
make docsbuilds it intobuild/docsand is strict: a warning, a broken link or a broken anchor fails it.make docs-servepreviews it on http://localhost:8000 and rebuilds as you edit.make docs-a11yruns axe (WCAG 2.2 A and AA), a no-third-party-requests check and keyboard focus checks on every built page, in the dark and the light scheme, and that every Mermaid diagram parses (a syntax error fails it with Mermaid's message). It takes about 30 seconds, and the reports are intests/e2e/reports/docs/. A colour change inextra.cssmust keep it passing. Do not disable a rule to make it pass.make docs-linkschecks the links to other sites in the built site,README.md, the generatedreadme.txtandCONTRIBUTING.mdwith lychee. It needs only Docker and builds the site first. CI runs it on pull requests that change the documentation or a linked file, on every push tomain, and every Monday, as links break without a change here. Fix a broken link rather than excluding it.docker/docs/lychee.tomlholds the retries, accepts a 429 (a rate limit) and lists the few exclusions, each with its reason. SetGITHUB_TOKENin your environment to avoid GitHub's rate limit on the many github.com links; the token is passed to the container and never printed.
Writing pages¶
- Link to other pages with relative
.mdpaths. A link to code outsidedocs/must be an absolute GitHub URL (https://github.com/l3rady/wp-updates-notifier/blob/main/<path>, ortree/main/<path>for a directory), as those files are not part of the site. docs/developers/hooks.mdis generated: change the hook's doc block, then runmake hook-docs(make check-hooksfails if it is stale).- Translations have their own page: a changed string needs a translation session before CI is green. See Translations.
Versions and deployment¶
The site is versioned with mike and deployed by CI (.github/workflows/docs.yml): main on every push, and each release as its own version and as latest. Published versions are not rebuilt; to fix one, run the workflow by hand on its tag. latest stays on the newest release. make docs-deploy is what the workflow runs.
Pinned packages¶
The Python packages (docker/docs/requirements.txt, with hashes) and Mermaid (docker/docs/package-lock.json, self-hosted so no page loads anything from a third party) are pinned. Regenerate requirements.txt with the command at the top of docker/docs/requirements.in.