Preview docs locally¶
The project's documentation is a properdocs site with mkdocstrings for the API reference. One task builds it; another serves it with live reload.
One-shot build¶
./workflow.cmd document
Runs properdocs build and opens the rendered site/index.html in your default browser. Good for a quick check.
Under WSL the file is handed to Windows instead, since there is no Linux browser to open it with: the path is translated with wslpath -w and passed to cmd.exe. If you still have wslview from the deprecated wslu package installed it is used first, but it is no longer required. Opening is best-effort on WSL only — cmd.exe reports failure even when it worked, so the task prints a message rather than failing if the browser can't be reached. If your distro has Windows interop disabled, ./workflow.cmd document.build still builds the site and you can open site/index.html yourself.
Live reload¶
./workflow.cmd document.serve
Starts a local server (default http://127.0.0.1:8000) and watches src/ plus docs/ for changes. Edit a docstring or a markdown file and the browser refreshes in place. Press Ctrl-C to stop.
src/ is in the watch list because mkdocstrings reads docstrings directly — changing a Google-format docstring in src/afas_mcp_server/ regenerates the API reference page on the fly.
What the build does¶
- Reads
properdocs.ymlfor site config, nav, and plugins. - The
include-markdownplugin pullsREADME.mdintodocs/index.md. - The
mkdocstringsplugin walkssrc/and renders the API reference underdocs/reference/api.md. - The rest of
docs/is rendered as plain markdown.
Adding a page¶
- Drop a new
.mdunderdocs/<section>/. - Add it to the
nav:block inproperdocs.yml. - Either rebuild (
./workflow.cmd document) or rely on the live-reload server.
Docstring style¶
mkdocstrings is configured for Google style (docstring_style: google in properdocs.yml). Sections it understands: Args:, Returns:, Raises:, Yields:, Examples:. Other formats render as plain text — useful, but you'll get less typed output and fewer cross-links.
See also¶
- Document your project — what to write in each section, and how the API reference is generated from your docstrings.
- Reference: API — the page mkdocstrings populates.
- Reference: configuration files —
properdocs.ymlreference.