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

Variant to allow multiple values

Open David-Le-Nir opened this issue 2 years ago • 0 comments

It seems not possible to define a variant value with a list of values, i.e I can't do

:my_field: var_a: val1, val2; var_b: val3

only the val1 appears for my_field and variant var_a. if using space, it is seen as a single value.

I understand the complexity of creating a regexp to accept all possibilities

Actually it would be possible if only the ; char was used to separate variant keys and not both , and ;. IMHO this is the simplest fix we could provide for this use case

Another possibility would be to allow the use of [ ] to define a list, something like :my_field: var_a: [val1, val2]; var_b: val3 but I guess the parsing will be more complex

David-Le-Nir avatar Apr 21 '23 09:04 David-Le-Nir