rerun_py/docs/writing_docs.md
A high-level overview of writing and previewing the Rerun Python documentation.
The set of symbols documented at ref.rerun.io/docs/python/ is derived
automatically from the public-API conventions in the SDK source. There is no
hand-curated index to maintain in lockstep — adding a new public symbol via
the conventions below is sufficient to surface it in the docs.
A symbol is considered public (and gets documented) when any of the following applies in its module:
__all__.from ._x import Foo as Foo (PEP 484 redundant alias).__all__.The conventions are detected by griffe
plus the griffe-public-redundant-aliases
extension (configured in mkdocs.yml).
from ._impl import Foo as Foo to the
relevant __init__.py. The redundant as Foo form matters — it is also
required by pyright's strict-mode reportPrivateUsage rule."Foo" in the module's
__all__ (e.g., see rerun_sdk/rerun/urdf.py, rerun_sdk/rerun/server.py).DOCUMENTED_PACKAGES in docs/gen_common_index.py mapping the dotted path
to its nav title (e.g., "rerun.foo": ("Foo",) for a top-level entry, or
"rerun.bar.baz": ("Bar", "Baz") to nest it under "Bar"). The first build
will tell you about every public symbol so you can decide what (if anything)
belongs in EXPLICIT_DOC_EXCLUDES.CURATED_GROUPS in
docs/gen_common_index.py. Curated groups are tables only — they do not
gate coverage and may safely duplicate symbols already listed by Track A.Add it (per package) to EXPLICIT_DOC_EXCLUDES in docs/gen_common_index.py
with an inline comment explaining why. Each entry is a deliberate decision;
unexplained entries get rejected in code review.
pixi run py-docs-build fails (and CI fails) on any of:
rerun_sdk/rerun/ — or a new
nested subpackage (a directory with __init__.py) under any documented
package — that is neither in DOCUMENTED_PACKAGES nor in
EXCLUDED_FROM_TRACK_A. This is the freshness check that prevents new
modules from going silently undocumented.DOCUMENTED_PACKAGES or EXCLUDED_FROM_TRACK_A entry that no longer
exists on disk (catches renames and removals).DOCUMENTED_PACKAGES entry whose module has no public surface
(no __all__, no redundant aliases, no in-file definitions).DOCUMENTED_PACKAGES entry whose entire public surface is in
EXPLICIT_DOC_EXCLUDES (the page would emit members: [], which is
undefined in mkdocstrings).CURATED_GROUPS entry that references a symbol that doesn't exist —
catches stale entries when symbols are renamed or removed.__getattr__ aliases (used for deprecated re-exports) are
invisible to static analysis. To document such a name, expose it via a
real redundant-alias re-export and accept the validator's prompt.__all__ constructions (e.g., __all__ = list(SOMETHING))
are not supported; keep __all__ a static list/tuple of string constants.This will watch the contents of the rerun_py folder and refresh documentation live as files are changed.
pixi run py-docs-serve
Our documentation is versioned with releases and generated via mkdocs.
The mkdocs dependencies are managed via uv (see the docs dependency group in pyproject.toml).
The documentation exists as bucket on GCS which is hosted on the https://ref.rerun.io domain.
Every commit that lands to main will generate bleeding edge documentation as HEAD. Behind the scenes, a
GitHub action is running pixi run py-docs-build, and uploading the result to GCS at
docs/python/main.
Releases will push to a version instead: docs/python/0.23.3