How to¶
Pipeline position¶
Hooks doctree-resolved at priority 600, after sphinx-autodoc-api-style
at 500. Consumes the api_slot nodes that producer packages inject into
desc_signature during earlier transforms, and composes them into the final
gp-sphinx-api-layout-right subcomponent (badges, source link, permalink).
The extension also overrides Sphinx’s built-in desc_signature HTML visitor
(app.add_node(addnodes.desc_signature, override=True, ...)). This is a
deliberate platform decision: taking ownership of signature rendering allows
the gp-sphinx-api-link permalink to be placed inside the managed layout rather than
appended by Sphinx’s default handler.
Event |
Hook |
Priority |
|---|---|---|
|
|
600 (after api-style at 500) |
|
— |
not used |
Downstream conf.py¶
With gp-sphinx:
conf = merge_sphinx_config(
project="my-project",
version="1.0.0",
copyright="2026, Your Name",
source_repository="https://github.com/your-org/my-project/",
extra_extensions=["sphinx_ux_autodoc_layout"],
api_layout_enabled=True,
api_collapsed_threshold=10,
)
Or without merge_sphinx_config:
extensions = ["sphinx.ext.autodoc", "sphinx_ux_autodoc_layout"]
api_layout_enabled = True
Configuration¶
Generated from app.add_config_value() registrations in
sphinx_ux_autodoc_layout/__init__.py.
-
api_layout_enabled¶api_layout_enabled¶
Master switch for the componentized autodoc layout. When
True,descnodes emitted by domain autodocumenters are wrapped inapi_region/api_signature/api_foldcontainers; whenFalse, default Sphinx rendering is preserved unchanged.- Type:
bool- Default:
False- Registered by:
sphinx_ux_autodoc_layout.setup()
-
api_fold_parameters¶api_fold_parameters¶
When
True, parameter lists exceedingapi_collapsed_thresholditems are wrapped in a click-to-expand<details>element. Set toFalseto render every parameter inline regardless of count.- Type:
bool- Default:
True- Registered by:
sphinx_ux_autodoc_layout.setup()
-
api_collapsed_threshold¶api_collapsed_threshold¶
Minimum number of parameters before
api_fold_parameters=Truecollapses the list. Has no effect when folding is disabled.- Type:
int- Default:
10- Registered by:
sphinx_ux_autodoc_layout.setup()
-
api_signature_show_annotations¶api_signature_show_annotations¶
When
True, signature blocks render type annotations inline next to each parameter.Falsestrips them — useful when annotations are documented separately in a Parameters section to avoid duplication.- Type:
bool- Default:
True- Registered by:
sphinx_ux_autodoc_layout.setup()