Skip to content

Decouple item/attribute presentation from content #370

@gcrabbe

Description

@gcrabbe

Currently, items (and attributes) are defined and rendered through the same directive, item (respectively, item-attribute, although the latter is just for the description).

I would like to be able to re-render existing items by reference in multiple locations. These referenced items could have a distinct visual style from the "canonical" definition (e.g. green instead of blue), but should otherwise be identical to the real deal.

I'm almost able to do so through item-list:

.. item-list::
    :filter: RQT-
    :showcontents:

But the resulting render is quite different (no relationships, for starters).

I propose to add an item-render directive (alternative names: item-display, item-present, item-reference) with a similar syntax to item-list that generates "full-fat" renders of matching items:

.. item-render:: <regex>
    :<attribute>: <attribute-value>

Attributes could have a similar attribute-render (item-attribute-render?) directive.

This decoupling could eventually allow importing item definitions from external sources, such as a (yet to be defined) JSON importer, and describing attributes directly in conf.py, alongside their definition.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions