2020-08-22 18:34:53 +00:00
|
|
|
Simple filter to wrap all items form a list. Default will wrap items in single quotes but you can also pass a custom wrapper character.
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```Yaml
|
|
|
|
my_list:
|
|
|
|
- item1
|
|
|
|
- item2
|
|
|
|
|
|
|
|
{{ my_list | wrap | join(',') }}
|
|
|
|
|
|
|
|
# result:
|
|
|
|
# "'item1','item2'"
|
|
|
|
```
|
|
|
|
|
|
|
|
Or pass a custom wrapper:
|
2023-12-15 12:09:38 +00:00
|
|
|
|
2020-08-22 18:34:53 +00:00
|
|
|
```Yaml
|
|
|
|
my_list:
|
|
|
|
- item1
|
|
|
|
- item2
|
|
|
|
|
|
|
|
{{ my_list | wrap(wrapper='/') | join(',') }}
|
|
|
|
|
|
|
|
# result:
|
|
|
|
# "/item1/,/item2/"
|
|
|
|
```
|