httk.core.docs.sphinx_ext¶
Sphinx glue for version labels, development warnings, and the selector UI.
The module itself has no Sphinx import dependency. Sphinx is imported only by
setup(), allowing the rest of the documentation library to remain
stdlib-only and usable by release workflows.
Functions¶
|
Return a validated documentation label, defaulting to |
|
Return |
|
Return the URL path depth used by the selector for label. |
|
Render the tiny JSON configuration literal consumed by |
|
Return mapping with declared internal dependencies versioned. |
|
Register the extension with Sphinx and inject version-selector assets. |
Module Contents¶
- httk.core.docs.sphinx_ext.document_label(value: str | None) str[source]¶
Return a validated documentation label, defaulting to
dev:local.
- httk.core.docs.sphinx_ext.channel_for_label(label: str) Literal['release', 'dev'][source]¶
Return
releasefor a version tag anddevfor a development label.
- httk.core.docs.sphinx_ext.version_depth(label: str) int[source]¶
Return the URL path depth used by the selector for label.
- httk.core.docs.sphinx_ext.selector_config_literal(label: str) str[source]¶
Render the tiny JSON configuration literal consumed by
selector.js.
- httk.core.docs.sphinx_ext.derive_internal_intersphinx_mapping(mapping: collections.abc.Mapping[str, tuple[str, str | list[str]]], config: httk.core.docs.config.VersioningConfig, pins: collections.abc.Mapping[str, str], base_url: str, label: str, *, temporary_inventory_dir: str | pathlib.Path | None = None, committed_inventory_dir: str | pathlib.Path | None = None) dict[str, tuple[str, str | list[str]]][source]¶
Return mapping with declared internal dependencies versioned.
The function is deliberately side-effect free. The Sphinx callback fetches the development inventories separately, then supplies their paths here.
dev:localis handled by the callback before this function is called so that the configuration object remains byte-for-byte untouched for local builds.