diff options
author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-01-10 15:10:16 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2024-01-12 10:38:15 +0100 |
commit | b52274d6e8060fc7a05e5b7d854d95dd7084b24b (patch) | |
tree | 286172bf797b0216415f739aa1dfbcf8b7ec5616 /book/src | |
parent | 12e178ce405225f2cd65ab4f68b67fefc89dec2b (diff) | |
download | askama-b52274d6e8060fc7a05e5b7d854d95dd7084b24b.tar.gz askama-b52274d6e8060fc7a05e5b7d854d95dd7084b24b.tar.bz2 askama-b52274d6e8060fc7a05e5b7d854d95dd7084b24b.zip |
Add documentation for `as_ref` builtin filter
Diffstat (limited to '')
-rw-r--r-- | book/src/filters.md | 18 |
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 |