-
Notifications
You must be signed in to change notification settings - Fork 72
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
✨ Add list-needs
directive
#1427
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1427 +/- ##
==========================================
+ Coverage 86.87% 88.26% +1.38%
==========================================
Files 56 61 +5
Lines 6532 7471 +939
==========================================
+ Hits 5675 6594 +919
- Misses 857 877 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Very useful improvement.
In addition to my comments I would directly deprecate list2needs.
:links-down: blocks, triggers | ||
:links-up: tests, checks |
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.
In the example below, LIST-l2b triggers LIST-l3
and LIST-l3 checks LIST-l2b
.
These are 2 different link types, while SN offers back-links for this.
If links-up
and link-down
are independent from each other and one can be left out, I'm ok with this.
Then it's up to the developer to decide how they want to link. And whether they want 2-sided links with different types (and different back-links each).
``maxdepth`` | ||
~~~~~~~~~~~~ | ||
|
||
The ``maxdepth`` option allows you to limit the depth of converted field lists. |
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.
Please state the consequence if a nested item is deeper than the given maxdepth
.
The main motivation of The new one is quite overhanging for this use case. I like the implementation itself, but for the syntax we should try to keep it comprehensive and short. For instance the list-level shall automatically define the need-type. So the question is, can we save the syntax (mostly) but have a better implementation (without jinja)? |
In its most basic form, the new directive looks like this: .. list-needs::
:req: Need example title
:req: Another need example with nested needs.
:spec: Sub-Need on level 2
:spec: Another sub-need I think this is also comprehensive and short. (I updated above example, it's messed up due to tabs/spaces mix.) We win
We lose:
Any other opinions from the community? |
I would cc @christopheseyler, as this would essentially supersede #1416 (and contains the |
I do not see the benefit comparing to the existing : the list2need provides a lightweight and more direct syntax to quickly write a list of requirements .. list-need
:req: Need example on level 1
:req id=NEED-002: Another Need example on level 1 with a given ID
instead of .. need:: Need example on level 1
.. need:: Another Need example on level 1 with a given ID
:id: NEED-002
The syntax of the actual list2need is more compact and more readable, IMO |
The
list2need
directive has a number of notable issues:list2need
is part ofThis directive is intended to replace
list2need
, using parsing logic similar to thelist-table
directive, whereby the content is first parsed as a standard field list, then converted to needs.This contains no bespoke syntax, preserves source mapping, and can be used within a MyST document.
See https://sphinx-needs--1427.org.readthedocs.build/en/1427/directives/list-needs.html
TODO: if agreed, look to "soft deprecate"
list2need
, so that at least new users don't use it, and old users can be guided to start portingComparision:
Most basic example: