Skip to content

Dynamic Style is not refreshed when variables are updated using needextend #1594

@MrChocolateMoose

Description

@MrChocolateMoose

I was experimenting with styling and I created a predicate based assignment of style based upon the status field.

ubproject.toml

[needs.global_options.style]
predicates = [
    [
        "status == 'passed'",
        "green_bar",
    ],
    [
        "status == 'failed'",
        "red_bar",
    ],
]
default = "discreet"

For objects that applied their status within the need it was working

file abc.rst

.. need:: abc
  :id: ABC
  :status: passed

But when I added the :status: via needextend it did not work. The field was added fine, but the style was not recomputed.

file def.rst

.. need:: def
   :id: DEF

file def2.rst

.. needextend:: def
   :status: passed

In the case of styling, is there any fundamental arch reason why this isn't supported? Would either deferring rendering or re-rendering be viable? Would any approach also allow for other fields like template and layout to achieve the same dynamism?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions