Closed ubmarco closed 4 years ago
I just realized I have another option to achieve my goals:
.. requirement:: Wheel requirement
:id: wheel_4
:status: implemented
:domain: chassis
The car shall have 4 wheels. The following meta-data applies:
============== ===
Field Value
============== ===
status **[[copy('status')]]**
domain **[[copy('domain')]]**
============== ===
With this solution, I don't need the proposed feature. It looks cleaner to me because fields are explicitly set. I also have the markup feature, so in above example the copied fields will be rendered bold. I'll close the issue.
I have a proposal for a new feature. My goal is to set a need's fields from its content. The idea is to support the following field definition style:
This would set 2 fields,
:status: implemented
and:domain: chassis
. The fields must be defined in conf.py usingneeds_extra_options
. The functionset_field_from_content
must return the field value so it appears in the content text and the Sphinx/Docutils markup can be applied. I see the following benefits:I already implemented that locally using dynamic functions, but it would be nice to have it as part of the extension. Here's my implementation:
The function name can, however, be shortened to 'set_field'. I think that would make it more readable.