issues
search
fiji-flo
/
sprig-rust
sprig-rust: Template functions for Go templates for Rust
MIT License
4
stars
1
forks
source link
support list functions
#11
Open
fiji-flo
opened
7 years ago
fiji-flo
commented
7 years ago
[ ] first: Get the first item in a 'list'. 'list 1 2 3 | first' prints '1'
[ ] last: Get the last item in a 'list': 'list 1 2 3 | last ' prints '3'
[ ] rest: Get all but the first item in a list: 'list 1 2 3 | rest' returns '[2 3]'
[ ] initial: Get all but the last item in a list: 'list 1 2 3 | initial' returns '[1 2]'
[ ] append: Add an item to the end of a list: 'append $list 4' adds '4' to the end of '$list'
[ ] prepend: Add an item to the beginning of a list: 'prepend $list 4' puts 4 at the beginning of the list.
[ ] reverse: Reverse the items in a list.
[ ] uniq: Remove duplicates from a list.
[ ] without: Return a list with the given values removed: 'without (list 1 2 3) 1' would return '[2 3]'
[ ] has: Return 'true' if the item is found in the list: 'has "foo" $list' will return 'true' if the list contains "foo"