1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
extensions = ["sphinx_needs"]
needs_extra_options = [
"introduced",
"updated",
{"name": "impacts", "description": "What is the impact of this need?"},
{},
1,
]
needs_build_json = True
needs_reproducible_json = True
needs_json_remove_defaults = True
def setup(app):
from sphinx_needs.api.configuration import add_extra_option
add_extra_option(app, "introduced")
add_extra_option(app, "modified", description="When was this need last modified?")
needs_template_collapse = """
.. _{{id}}:
{% if hide == false -%}
.. role:: needs_tag
.. role:: needs_status
.. role:: needs_type
.. role:: needs_id
.. role:: needs_title
.. rst-class:: need
.. rst-class:: need_{{type_name}}
.. container:: need
`{{id}}` - {{content|indent(4)}}
.. container:: toggle
.. container:: header
Details
{% if status and status|upper != "NONE" %} | status: :needs_status:`{{status}}`{% endif %}
{% if tags %} | tags: :needs_tag:`{{tags|join("` :needs_tag:`")}}`{% endif %}
{% if introduced %} | introduced: `{{introduced}}` {% endif %}
{% if updated %} | updated: `{{updated}}` {% endif %}
{% if impacts %} | impacts: `{{impacts}}` {% endif %}
| links incoming: :need_incoming:`{{id}}`
| links outgoing: :need_outgoing:`{{id}}`
{% endif -%}
"""
|