Skip to content

Commit

Permalink
Add documentation for as_ref builtin filter
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jan 10, 2024
1 parent d5e6dbf commit 8537983
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions book/src/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ but are disabled by default. Enable them with Cargo features (see below for more

* **[Built-in filters][#built-in-filters]:**
[`abs`][#abs],
[`as_ref`][#as_ref],
[`capitalize`][#capitalize],
[`center`][#center],
[`escape|e`][#escape],
Expand Down Expand Up @@ -62,6 +63,23 @@ Output:
2
```

### as_ref
[#as_ref]: #as_ref

Put the given argument behind a reference.

```
{{ "a"|as_ref }}
{{ self.x|as_ref }}
```

will become:

```
&a
&self.x
```

### capitalize
[#capitalize]: #capitalize

Expand Down

0 comments on commit 8537983

Please sign in to comment.