xoxys.general/docs/filters/wrap.md
Robert Kaussow 181dd5ce32
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/unit-test Pipeline was successful
ci/woodpecker/push/sanity-test Pipeline was successful
ci/woodpecker/push/build-package Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/notify Pipeline was successful
ci: cleanup env vars and fix linting (#8)
Reviewed-on: #8
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-committed-by: Robert Kaussow <mail@thegeeklab.de>
2023-12-15 13:05:48 +01:00

402 B

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

my_list:
  - item1
  - item2

{{ my_list | wrap | join(',') }}

# result:
# "'item1','item2'"

Or pass a custom wrapper:

my_list:
  - item1
  - item2

{{ my_list | wrap(wrapper='/') | join(',') }}

# result:
# "/item1/,/item2/"