aboutsummaryrefslogtreecommitdiffstats
path: root/book
diff options
context:
space:
mode:
authorLibravatar Guillaume Gomez <guillaume1.gomez@gmail.com>2024-01-10 15:10:16 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2024-01-12 10:38:15 +0100
commitb52274d6e8060fc7a05e5b7d854d95dd7084b24b (patch)
tree286172bf797b0216415f739aa1dfbcf8b7ec5616 /book
parent12e178ce405225f2cd65ab4f68b67fefc89dec2b (diff)
downloadaskama-b52274d6e8060fc7a05e5b7d854d95dd7084b24b.tar.gz
askama-b52274d6e8060fc7a05e5b7d854d95dd7084b24b.tar.bz2
askama-b52274d6e8060fc7a05e5b7d854d95dd7084b24b.zip
Add documentation for `as_ref` builtin filter
Diffstat (limited to 'book')
-rw-r--r--book/src/filters.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/book/src/filters.md b/book/src/filters.md
index e85068f..ea8198a 100644
--- a/book/src/filters.md
+++ b/book/src/filters.md
@@ -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],
@@ -62,6 +63,23 @@ Output:
2
```
+### as_ref
+[#as_ref]: #as_ref
+
+Creates a reference to the given argument.
+
+```
+{{ "a"|as_ref }}
+{{ self.x|as_ref }}
+```
+
+will become:
+
+```
+&a
+&self.x
+```
+
### capitalize
[#capitalize]: #capitalize