API Reference

CSS classes

Class

Element

Purpose

gp-sphinx-api-container

<dl>

Managed autodoc shell

gp-sphinx-api-header

<dt>

Signature row shell

gp-sphinx-api-content

<dd>

Description/content shell

gp-sphinx-api-layout

<div>

Header split between left and right

gp-sphinx-api-layout-left

<div>

Signature text, custom disclosure, permalink

gp-sphinx-api-layout-right

<div>

Badge container and source link

gp-sphinx-api-signature

<div>

Compact signature row

gp-sphinx-api-link

<a>

Managed permalink in the left layout

gp-sphinx-api-badge-container

<span>

Wrapper for badge group output

gp-sphinx-api-source-link

<span>

Wrapper for the [source] link

gp-sphinx-api-description

<div>

Wraps paragraphs, notes, examples

gp-sphinx-api-parameters

<div>

Wraps field lists (Parameters, Returns)

gp-sphinx-api-footer

<div>

Wraps nested method/attribute entries

gp-sphinx-api-region

<div>

Compatibility alias on content sections

gp-sphinx-api-region--narrative

<div>

Compatibility alias on narrative sections

gp-sphinx-api-region--fields

<div>

Compatibility alias on parameter sections

gp-sphinx-api-region--members

<div>

Compatibility alias on footer/member sections

gp-sphinx-api-fold

<details>

Disclosure wrapper for large sections

gp-sphinx-api-fold-summary

<summary>

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=())
function[source]
function[source]
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-desc consumers.

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_signature path 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 the gp-sphinx-api-signature wrapper.

  • content_children (Sequence[nodes.Node]) – Children appended to gp-sphinx-api-content.

  • badge_group (nodes.Node | None) – Shared badge group rendered inside gp-sphinx-api-badge-container.

  • permalink (api_permalink | None) – Explicit header permalink placed in gp-sphinx-api-layout-left.

  • entry_classes (tuple[str, ...]) – Extra CSS classes for the outer gp-sphinx-api-entry wrapper.

  • signature_classes (tuple[str, ...]) – Extra classes for the gp-sphinx-api-signature wrapper.

  • content_classes (tuple[str, ...]) – Extra classes for the gp-sphinx-api-content wrapper.

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=())
function[source]
function[source]
sphinx_ux_autodoc_layout.build_api_summary_section(*children, classes=())

Wrap summary or index content in the shared gp-sphinx-api-summary region.

Parameters:
  • *children (nodes.Node) – Summary or index nodes to render in the shared summary region.

  • classes (tuple[str, ...]) – Extra CSS classes appended to the summary wrapper.

Returns:

Shared summary wrapper.

Return type:

api_component

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=())
function[source]
function[source]
sphinx_ux_autodoc_layout.build_api_table_section(name, *children, classes=())

Wrap one or more table-like body nodes in a shared API section.

Parameters:
Return type:

api_component

sphinx_ux_autodoc_layout.build_api_facts_section(rows, *, classes=())
function[source]
function[source]
sphinx_ux_autodoc_layout.build_api_facts_section(rows, *, classes=())

Render a shared gp-sphinx-api-facts section from typed fact rows.

Parameters:
Return type:

api_component

Copyable config snippet

extensions = [
    "sphinx_ux_autodoc_layout",
]