Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple item/attribute presentation from content #370

Open
gcrabbe opened this issue Feb 16, 2024 · 0 comments
Open

Decouple item/attribute presentation from content #370

gcrabbe opened this issue Feb 16, 2024 · 0 comments
Assignees

Comments

@gcrabbe
Copy link

gcrabbe commented Feb 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants