commit d88d71f073
Author: Robert Kaussow <mail@geeklabor.de> Date: Sat Aug 22 20:29:58 2020 +0200 fix docs
This commit is contained in:
parent
0b536fb4b7
commit
0fa31f8998
10
_index.md
Normal file
10
_index.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
title: general
|
||||||
|
geekdocFlatSection: true
|
||||||
|
---
|
||||||
|
|
||||||
|
General custom content collection for Ansible.
|
||||||
|
|
||||||
|
<!-- spellchecker-disable -->
|
||||||
|
{{< toc-tree >}}
|
||||||
|
<!-- spellchecker-enable -->
|
3
filters/_index.md
Normal file
3
filters/_index.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
title: Filters
|
||||||
|
---
|
26
filters/prefix.md
Normal file
26
filters/prefix.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
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"
|
||||||
|
```
|
26
filters/wrap.md
Normal file
26
filters/wrap.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
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:
|
||||||
|
```Yaml
|
||||||
|
my_list:
|
||||||
|
- item1
|
||||||
|
- item2
|
||||||
|
|
||||||
|
{{ my_list | wrap(wrapper='/') | join(',') }}
|
||||||
|
|
||||||
|
# result:
|
||||||
|
# "/item1/,/item2/"
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user