-
Notifications
You must be signed in to change notification settings - Fork 71
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
PR - Add 'hide' support and a new meta-data option to List2need directive #1345
base: master
Are you sure you want to change the base?
PR - Add 'hide' support and a new meta-data option to List2need directive #1345
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great enhancement.
I really like the benefit of it.
The PR is also looking already quite good, just 1-2 minor comments to the code. And 1-2 test cases are missing :)
Can you add them? Then I will give it a go 👍
If any help is needed, just let me know.
:columns: id, title, content, links | ||
|
||
|
||
meta-data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should rename meta-data
to something with global
or option
in the name because we already have needs_global_options
as a config parameter, which does something similar: setting values globally for specific needs.
That's the same here.
So, what about naming the parameter just global
?`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to stay in the same mind, I've renamed to list_global_options
I would like to know if these is a way to perform the tests based on the needs.json output instead of parsing/inspecting the html output. At this level, I don't want to test if the "hidden state" or "all options" are properly rendered, but I want to focus on "if the needs in the list have these global options attached to them (and the same with the hide status) |
For sure you can also build the test-projects with the "needs" builder to check the And we also have some test cases, where the internal data (stored in the |
I fixed some bugs and added tests for both features (list_global_inputs and hide) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess list_global_options
needs to be documented also in the docs.
There it is still meta-data
.
The tests are looking go.
When documentation fix is done and CI is green, I would give it a go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heya, the whole list_global_options
I feel is overcomplicating things, and also negates the need for a separate hide
option (or in-fact tags
etc).
Just do this:
.. list2need::
:need-options:
:hide:
:tags: a,b,c
:status: open
:validation: Test, Review of Design
then there is no need for any complex regex parsing; you just basically take the whole block and insert it into the jinja (removing top/bottom blank-lines)
@@ -2,7 +2,7 @@ | |||
name = "sphinx-needs" | |||
|
|||
# !! Don't miss updates in sphinx_needs.__version__, changelog.rst, and .github/workflows/docker !!! | |||
version = "4.1.0" | |||
version = "4.2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "4.2.0" | |
version = "4.1.0" |
you don't need to change the version in a PR
I though about something like that, I'm just a bit concerned about the fact I've never seen "nested" options elsewhere. So, I though that adding ":hide:", ":tags:", ... would be more the same syntax than with the ..need / ..req directive. What do you think ? |
How I said above is the way to go; it is much clearer to the user what options will be parsed through to the needs |
Added the support for "hide" option to affect the hidden status to all requirements in the list. This allows to easily create a list of requirements that could be only presented as a table in the final output.
this example is added in the documentation
The PR also add a new meta-data option to give the ability to set meta-data (including extra defined custom option to all elements in the list)