mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-27 13:00:57 +00:00
Add doc about unique
filter
This commit is contained in:
parent
d0d23cad0b
commit
d2a788a740
@ -560,6 +560,31 @@ Output:
|
||||
he...
|
||||
```
|
||||
|
||||
### unique
|
||||
[#unique]: #unique
|
||||
|
||||
Returns an iterator with all duplicates removed.
|
||||
|
||||
**This filter is only available with the `std` feature enabled.**
|
||||
|
||||
With this data:
|
||||
|
||||
```rust
|
||||
vec!["a", "b", "a", "c"]
|
||||
```
|
||||
|
||||
And this template:
|
||||
|
||||
```jinja
|
||||
{% for elem in data|unique %}{{ elem }},{% endfor %}
|
||||
```
|
||||
|
||||
Output will be:
|
||||
|
||||
```text
|
||||
a,b,c,
|
||||
```
|
||||
|
||||
### upper | uppercase
|
||||
[#upper]: #upper--uppercase
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user