From 63e1169d51f507a2bae4d6dcaec564badd0525ae Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 28 Feb 2024 10:39:30 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Remove=20usage=20of=20`hide=5Fst?= =?UTF-8?q?atus`=20and=20`hide=5Ftags`=20(#1130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These needs fields were removed in v0.5.0 --- docs/configuration.rst | 8 ++++---- docs/dynamic_functions.rst | 2 -- sphinx_needs/layout.py | 2 +- sphinx_needs/needsfile.py | 2 -- sphinx_needs/utils.py | 2 -- tests/doc_test/add_sections/conf.py | 4 ++-- tests/doc_test/extra_options/conf.py | 4 ++-- tests/doc_test/import_doc/conf.py | 4 ++-- tests/doc_test/import_doc_empty/conf.py | 4 ++-- tests/doc_test/import_doc_invalid/conf.py | 4 ++-- tests/doc_test/non_exists_file_import/conf.py | 4 ++-- 11 files changed, 17 insertions(+), 23 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 1914ce56c..39a79db72 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -2204,10 +2204,10 @@ If nothing is set, the following default template is used: :class: need :needs_type:`{{type_name}}`: :needs_title:`{{title}}` :needs_id:`{{id}}` - {%- if status and status|upper != "NONE" and not hide_status %} + {%- if status and status|upper != "NONE" %} | status: :needs_status:`{{status}}` {%- endif -%} - {%- if tags and not hide_tags %} + {%- if tags %} | tags: :needs_tag:`{{tags|join("` :needs_tag:`")}}` {%- endif %} | links incoming: :need_incoming:`{{id}}` @@ -2265,10 +2265,10 @@ Default value: :needs_type:`{{type_name}}`: :needs_title:`{{title}}` :needs_id:`{{id}}` :needs_type:`{{type_name}}`: :needs_title:`{{title}}` :needs_id:`{{id}}` - {%- if status and status|upper != "NONE" and not hide_status %} + {%- if status and status|upper != "NONE" %} | status: :needs_status:`{{status}}` {%- endif -%} - {%- if tags and not hide_tags %} + {%- if tags %} | tags: :needs_tag:`{{tags|join("` :needs_tag:`")}}` {%- endif %} | links incoming: :need_incoming:`{{id}}` diff --git a/docs/dynamic_functions.rst b/docs/dynamic_functions.rst index 4deee4be4..a5d38de0f 100644 --- a/docs/dynamic_functions.rst +++ b/docs/dynamic_functions.rst @@ -165,8 +165,6 @@ need structure 'content': str: unparsed need content, 'collapse': bool: true if meta data shall be collapsed, 'hide': bool: true if complete need shall be hidden, - 'hide_tags': bool: if tags shall be hidden, - 'hide_status': bool: true if status shall be hidden, } Adding new keywords to need object will be treated as extra_option in need meta area. diff --git a/sphinx_needs/layout.py b/sphinx_needs/layout.py index a4d14b58b..800b10173 100644 --- a/sphinx_needs/layout.py +++ b/sphinx_needs/layout.py @@ -705,7 +705,7 @@ def meta_all( ``content``, ``collapse``, ``parts``, ``id_parent``, ``id_complete``, ``title``, ``full_title``, ``is_part``, ``is_need``, ``type_prefix``, ``type_color``, ``type_style``, ``type``, ``type_name``, ``id``, - ``hide``, ``hide_status``, ``hide_tags``, ``sections``, ``section_name``. + ``hide``, ``sections``, ``section_name``. To exclude further need-data, use ``exclude``, like ``exclude=['status', 'tags']`` diff --git a/sphinx_needs/needsfile.py b/sphinx_needs/needsfile.py index cf1184fc8..fa06c045d 100644 --- a/sphinx_needs/needsfile.py +++ b/sphinx_needs/needsfile.py @@ -26,13 +26,11 @@ class NeedsList: JSON_KEY_EXCLUSIONS_NEEDS = { "links_back", "type_color", - "hide_status", "hide", "type_prefix", "lineno", "collapse", "type_style", - "hide_tags", "content", "content_node", # id_parent, id_parent are added on calls to `prepare_need_list` diff --git a/sphinx_needs/utils.py b/sphinx_needs/utils.py index d297eed86..8887a3243 100644 --- a/sphinx_needs/utils.py +++ b/sphinx_needs/utils.py @@ -64,8 +64,6 @@ class NeedFunctionsType(TypedDict): "type_name", "id", "hide", - "hide_status", - "hide_tags", "sections", "section_name", "content_node", diff --git a/tests/doc_test/add_sections/conf.py b/tests/doc_test/add_sections/conf.py index ea5667392..0a67ad2bb 100644 --- a/tests/doc_test/add_sections/conf.py +++ b/tests/doc_test/add_sections/conf.py @@ -29,8 +29,8 @@ Details -{% if status and status|upper != "NONE" and not hide_status %} | status: :needs_status:`{{status}}`{% endif %} -{% if tags and not hide_tags %} | tags: :needs_tag:`{{tags|join("` :needs_tag:`")}}`{% endif %} +{% 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 %} diff --git a/tests/doc_test/extra_options/conf.py b/tests/doc_test/extra_options/conf.py index 323f4113d..cb7c3c6a6 100644 --- a/tests/doc_test/extra_options/conf.py +++ b/tests/doc_test/extra_options/conf.py @@ -32,8 +32,8 @@ def setup(app): Details -{% if status and status|upper != "NONE" and not hide_status %} | status: :needs_status:`{{status}}`{% endif %} -{% if tags and not hide_tags %} | tags: :needs_tag:`{{tags|join("` :needs_tag:`")}}`{% endif %} +{% 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 %} diff --git a/tests/doc_test/import_doc/conf.py b/tests/doc_test/import_doc/conf.py index 5ddaeb329..4c044331f 100644 --- a/tests/doc_test/import_doc/conf.py +++ b/tests/doc_test/import_doc/conf.py @@ -47,10 +47,10 @@ {% if hide == false -%} {{type_name}}: **{{title}}** ({{id}}) - {%- if status and status|upper != "NONE" and not hide_status %} + {%- if status and status|upper != "NONE" %} | status: {{status}} {%- endif -%} - {%- if tags and not hide_tags %} + {%- if tags %} | tags: {{tags|join("; ")}} {%- endif %} | links incoming: :need_incoming:`{{id}}` diff --git a/tests/doc_test/import_doc_empty/conf.py b/tests/doc_test/import_doc_empty/conf.py index 7e12482c6..6f192ba59 100644 --- a/tests/doc_test/import_doc_empty/conf.py +++ b/tests/doc_test/import_doc_empty/conf.py @@ -45,10 +45,10 @@ {% if hide == false -%} {{type_name}}: **{{title}}** ({{id}}) - {%- if status and status|upper != "NONE" and not hide_status %} + {%- if status and status|upper != "NONE" %} | status: {{status}} {%- endif -%} - {%- if tags and not hide_tags %} + {%- if tags %} | tags: {{tags|join("; ")}} {%- endif %} | links incoming: :need_incoming:`{{id}}` diff --git a/tests/doc_test/import_doc_invalid/conf.py b/tests/doc_test/import_doc_invalid/conf.py index 7e12482c6..6f192ba59 100644 --- a/tests/doc_test/import_doc_invalid/conf.py +++ b/tests/doc_test/import_doc_invalid/conf.py @@ -45,10 +45,10 @@ {% if hide == false -%} {{type_name}}: **{{title}}** ({{id}}) - {%- if status and status|upper != "NONE" and not hide_status %} + {%- if status and status|upper != "NONE" %} | status: {{status}} {%- endif -%} - {%- if tags and not hide_tags %} + {%- if tags %} | tags: {{tags|join("; ")}} {%- endif %} | links incoming: :need_incoming:`{{id}}` diff --git a/tests/doc_test/non_exists_file_import/conf.py b/tests/doc_test/non_exists_file_import/conf.py index 7e12482c6..6f192ba59 100644 --- a/tests/doc_test/non_exists_file_import/conf.py +++ b/tests/doc_test/non_exists_file_import/conf.py @@ -45,10 +45,10 @@ {% if hide == false -%} {{type_name}}: **{{title}}** ({{id}}) - {%- if status and status|upper != "NONE" and not hide_status %} + {%- if status and status|upper != "NONE" %} | status: {{status}} {%- endif -%} - {%- if tags and not hide_tags %} + {%- if tags %} | tags: {{tags|join("; ")}} {%- endif %} | links incoming: :need_incoming:`{{id}}`