mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-03 15:55:31 +00:00
Add doc about unique
filter
This commit is contained in:
parent
d0d23cad0b
commit
d2a788a740
@ -560,6 +560,31 @@ Output:
|
|||||||
he...
|
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 | uppercase
|
||||||
[#upper]: #upper--uppercase
|
[#upper]: #upper--uppercase
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user