xoxys.general/prefix.md
Robert Kaussow dff4b91525
Some checks failed
continuous-integration/drone/push Build is failing
add documentation
2020-08-22 20:07:48 +02:00

27 lines
376 B
Markdown

Simple filter to prefix all items from a list. Default prefix will be `--` but you can also pass a custom one.
## Example
```Yaml
my_list:
- item1
- item2
{{ my_list | prefix | join(' ') }}
# result:
# "--item1 --item2"
```
Or pass a custom prefix:
```Yaml
my_list:
- item1
- item2
{{ my_list | prefix(prefix='-') | join(' ') }}
# result:
# "-item1 -item2"
```