API Reference¶
Config reference¶
Generated from 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:
- Default:
False- Registered by:
-
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:
- Default:
True- Registered by:
-
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:
- Default:
10- Registered by:
CSS classes¶
Class |
Element |
Purpose |
|---|---|---|
|
|
Managed autodoc shell |
|
|
Signature row shell |
|
|
Description/content shell |
|
|
Header split between left and right |
|
|
Signature text, custom disclosure, permalink |
|
|
Badge container and source link |
|
|
Compact signature row |
|
|
Managed permalink in the left layout |
|
|
Wrapper for badge group output |
|
|
Wrapper for the |
|
|
Wraps paragraphs, notes, examples |
|
|
Wraps field lists (Parameters, Returns) |
|
|
Wraps nested method/attribute entries |
|
|
Compatibility alias on content sections |
|
|
Compatibility alias on narrative sections |
|
|
Compatibility alias on parameter sections |
|
|
Compatibility alias on footer/member sections |
|
|
Disclosure wrapper for large sections |
|
|
Click target showing field count |
API reference¶
-
sphinx_ux_autodoc_layout.build_api_card_entry(*, profile_class, signature_children, content_children=(), badge_group=None, permalink=None, entry_classes=(), signature_classes=(), content_classes=())¶sphinx_ux_autodoc_layout.build_api_card_entry(*, profile_class, signature_children, content_children=(), badge_group=None, permalink=None, entry_classes=(), signature_classes=(), content_classes=())¶
Build a shared
gp-sphinx-api-*card entry for non-descconsumers.The header emits both desktop and mobile layout variants side-by-side so theme CSS can container-query between them just like the managed
desc_signaturepath does in_transforms. Header metadata (data-has-source,data-has-badges,data-badge-count,data-has-fold) is also added so styling can branch on facts the cascade can’t compute.Parameters (10)
- Parameters:
profile_class (
str) – Stable profile class such as"gp-sphinx-api-profile--fastmcp-tool".signature_children (
Sequence[nodes.Node]) – Children placed inside thegp-sphinx-api-signaturewrapper.content_children (
Sequence[nodes.Node]) – Children appended togp-sphinx-api-content.badge_group (
nodes.Node|None) – Shared badge group rendered insidegp-sphinx-api-badge-container.permalink (
api_permalink|None) – Explicit header permalink placed ingp-sphinx-api-layout-left.entry_classes (
tuple[str, ...]) – Extra CSS classes for the outergp-sphinx-api-entrywrapper.signature_classes (
tuple[str, ...]) – Extra classes for thegp-sphinx-api-signaturewrapper.content_classes (
tuple[str, ...]) – Extra classes for thegp-sphinx-api-contentwrapper.
- Returns:
Shared card entry tree using the stable
gp-sphinx-api-*contract.- Return type:
nodes.Element
-
sphinx_ux_autodoc_layout.build_api_summary_section(*children, classes=())¶sphinx_ux_autodoc_layout.build_api_summary_section(*children, classes=())¶
Wrap summary or index content in the shared
gp-sphinx-api-summaryregion.Examples
>>> from docutils import nodes >>> section = build_api_summary_section(nodes.paragraph("", "Summary")) >>> section.get("name") 'gp-sphinx-api-summary'
-
sphinx_ux_autodoc_layout.build_api_table_section(name, *children, classes=())¶sphinx_ux_autodoc_layout.build_api_table_section(name, *children, classes=())¶
Wrap one or more table-like body nodes in a shared API section.
-
sphinx_ux_autodoc_layout.build_api_facts_section(rows, *, classes=())¶sphinx_ux_autodoc_layout.build_api_facts_section(rows, *, classes=())¶
Render a shared
gp-sphinx-api-factssection from typed fact rows.
Copyable config snippet
extensions = [
"sphinx_ux_autodoc_layout",
]