Preview and build the documentation¶
The site uses Material for MkDocs and the Markdown in documentation/.
Run these commands from the repository root:
uv sync --locked --group docs
uv run --locked --group docs python -m mkdocs serve
Open the address printed by MkDocs. Changes to a page or the configuration reload the preview. Check navigation, code blocks, search, and the architecture diagram in both light and dark mode.
To check the complete static build:
uv run --locked --group docs python -m mkdocs build --strict
The output goes to the ignored site/ folder. Fix warnings instead of disabling
strict mode. The full navigation, theme, Markdown extensions, and Mermaid
configuration are in mkdocs.yml.
Use python -m mkdocs so the repository root is on Python's import path for
the local rendering hooks, including on Windows.
Generated command reference¶
The reference is built from the checked-in
reference_manifest.json.
Codegen supplies the public groups, methods, model names and relationships;
the documentation does not rediscover those from the client containers.
reference_pages.py turns that index into
virtual Markdown pages. MkDocs builds them in memory: there is no generated
Markdown tree to edit or commit. Navigation includes every command group and
one filterable type page per namespace. Lists longer than 80 types use A–Z
sections in the table of contents; filtering to 80 or fewer shows individual
type names there instead. Each definition appears
once in its Official or Tapir namespace; re-exported names link to that definition.
mkdocstrings and Griffe read signatures, docstrings, model fields and enum values
from src/. A documentation build does not run codegen. Regenerate the manifest
with the unified pipeline when changing the generated API, then use the normal
mkdocs serve or mkdocs build command. The preview watches the manifest,
source and rendering scripts as well as the guides. Restart the preview after
editing the Python rendering hooks to reload their modules.
reference_extension.py adapts the
library's dynamic Pydantic base for static analysis and normalizes parameter
entries that have a type but no description, including wrapped parameter and
return headers. It changes documentation metadata
only. Source inspection is static: the build does not import MultiConn Archicad
or connect to Archicad.
Maintain descriptions in the schemas and code generator. Generated pages select
members from the manifest and link related parameter/result types automatically.
Short group introductions live in one file:
group_descriptions.json.
It uses the manifest's namespace and group names as keys. Keep each description
to one or two plain sentences about what the group does; examples belong in the
guides. Command pages are fully generated, with no individual Markdown files or
manual member lists. Missing, empty or obsolete group descriptions fail the build.
The codegen skill maintains these introductions when groups are added, renamed
or removed.
Reference layout¶
Use docstring_section_style in mkdocs.yml to choose lists or tables for
parameters and returns. The command page disables repeated Raises sections
with show_docstring_raises: false and links to the shared error guide.
Custom templates under
scripts/reference_templates/ show each
model's fields in one code block and each enum's values in one code block.
Field descriptions become comments; type links remain clickable. Keep this
content generated from the source rather than maintaining a second list of
fields or enum values. The reference stylesheet adjusts spacing within generated
objects without changing the guide layout.
Reference filters¶
reference_catalogue.py adds the virtual
files and navigation, then writes site/assets/command-catalogue.json. Every
catalogue entry links to its generated reference anchor. Missing or unsupported
manifests fail the build; missing or duplicate rendered definitions also fail it.
The documentation tests check the table-of-contents threshold, type links, navigation on rebuild,
and catalogue URLs with and without directory URLs.
The command catalogue searches command names across groups and shows 50 results per page. Exact name matches come first. Choosing a namespace limits the group dropdown to its groups. A selected group is retained when available in the new namespace, otherwise it resets to all groups. Filters are saved in the URL so a filtered list can be shared or reloaded. Command-group pages and type pages filter their definitions directly, by name, and hide unmatched table-of-contents entries. Models, enums and aliases all participate in the type filter. Without JavaScript, the references remain readable.
Type pages include a compact name/anchor index generated from the manifest, so
the filter does not scan model headings. The theme override in
scripts/theme/main.html initializes the reference
controls before Material's header widgets, giving in-page search priority.
Off-screen type blocks use content-visibility: auto
to defer layout and painting; their content stays in the document for direct
links and browser Find. Printing renders the complete definitions.
The controls live in documentation/javascripts/reference.js. Check namespace
and group filters, pagination, no-match messages, clear buttons, keyboard focus,
and links to reference blocks when changing them. Serve the built site over HTTP
for this check; opening the HTML directly from disk does not support fetching
the catalogue index reliably.
Links to files outside the site¶
Keep links between guides relative. Links to source files, tests, examples, skills, and generation reports can also stay repository-relative in Markdown. A build hook converts those outside-site links to GitHub URLs for the checked-out commit. Files and folders remain browsable on GitHub; they are not copied into the public documentation site.
This keeps the source Markdown useful in a checkout and pins a release site's source links to that release's code. Missing links remain visible to the build's validation rather than being silently replaced.
Publish with a GitHub release¶
The documentation workflow runs when a GitHub
release is published. It checks out that release's tag, installs the locked
documentation dependencies, builds with --strict, and deploys to GitHub Pages.
Pull requests and branch pushes do not publish the site.
Before the first release using this workflow:
- In the repository's Settings → Pages, set Source to GitHub Actions.
- If the
github-pagesenvironment restricts deployment branches or tags, allow your release tags in Settings → Environments → github-pages. - Include the site configuration, lockfile, and workflow in the release tag.
The site will be available at szamosimate.github.io/multiconn_archicad. Each published release, including a prerelease, replaces the current site; there is no separate site for each version.
If publishing fails, open the Publish documentation run in GitHub Actions, fix the cause, and rerun the failed jobs. A rerun still builds the original release tag. Changes to the documentation need a new release to reach the site.