sphinx-needs icon indicating copy to clipboard operation
sphinx-needs copied to clipboard

filter strings multiline

Open kreuzberger opened this issue 1 year ago • 2 comments

When giving a filter string to a need, most seem to be one-liners. Sometimes it is required to give more complex filter strings, maybe with one or more and or or parts.

For readability it is helpful to have this lines as multiline filter strings, but this is not possible if the syntax breaks at the first line. Maybe this could be fixed cause other options support multiple lines.

Example:

.. needtable::
    :style: table
    :filter: id in ['a','b','c','d','e','f','g'] or
             id.startswith("h")

kreuzberger avatar Jul 12 '23 14:07 kreuzberger

For complex filter logic, you can use the filter-code or filter-function method. See: https://sphinx-needs.readthedocs.io/en/latest/filter.html#filter-code

I think this would fulfill your requirements.

danwos avatar Jul 24 '23 15:07 danwos

:+1: https://sphinx-needs.readthedocs.io/en/latest/filter.html#filter-code

kreuzberger avatar Jul 25 '23 06:07 kreuzberger