From b52274d6e8060fc7a05e5b7d854d95dd7084b24b Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 10 Jan 2024 15:10:16 +0100 Subject: Add documentation for `as_ref` builtin filter --- book/src/filters.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 -- cgit