Skip to main content

rendering.ReferenceSectionRenderer

A section of the reference index, with a heading, description and summary rows

Usage

Source

rendering.ReferenceSectionRenderer(
    node,
    level=1,
    display_format="list",
    *,
    renderers=_default_renderers(),
    extension=_default_extension(),
    context_page_path=None,
)

The rows form a definition list unless display_format selects a table. An object whose summary row is hidden stays in the section.

Parameter Attributes

node: (
    APIReference
    | content.DocClass
    | content.DocFunction
    | content.DocAttribute
    | content.DocTypeAlias
    | content.DocModule
    | content.Page
    | content.Section
)

The node being documented

level: int = 1

The heading depth of this appearance

display_format: Literal["list", "table"] = "list"

Whether the summary rows form a definition list or a table

renderers: Renderers = _default_renderers()

Renderer choices shared with nested objects, pages and summaries

extension: Extension = _default_extension()

The extension that supplies settings and project directories

A standalone renderer uses default settings and has no project directories.

context_page_path: str | None = None
The containing page’s path relative to the output directory, apart from summary links

Methods

Name Description
__post_init__() Expose the resolved section as section
render_body() Render the section’s summary rows as a definition list or table
render_description() Render the description of the section
render_title() Render the section’s title or subtitle as a heading

__post_init__()

Expose the resolved section as section

Usage

Source

__post_init__()

render_body()

Render the section’s summary rows as a definition list or table

Usage

Source

render_body()

Each entry renders only its summary rows, not its body.

Returns

BlockContent
The entries’ summary rows, or None for an empty section.

render_description()

Render the description of the section

Usage

Source

render_description()

Returns

BlockContent
The description in a doc-description block.

render_title()

Render the section’s title or subtitle as a heading

Usage

Source

render_title()

A title is one level below the base heading level and a subtitle two levels below. Standard group titles are translated; custom titles keep their text.

Returns

BlockContent
The heading, or None when the section has neither a title nor a subtitle.