From da4f4401fe2409af7c2b19c7e9d4d7c0bd164d75 Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Sun, 28 Jan 2024 14:00:21 +0000 Subject: [PATCH] Update Templates.md Jinja2 explained --- examples/Templates.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/Templates.md b/examples/Templates.md index da09712..6d17c52 100644 --- a/examples/Templates.md +++ b/examples/Templates.md @@ -2,10 +2,14 @@ # Templates -In order to provide the most functionality possible the content of the menu item comes from a user-defined template (i.e. you generate your own text). This allows you to do some pretty cool things. It also makes the config a bit more complicated. This page will help you understand how to use templates. +In order to provide the most functionality possible the content of the menu item comes from a user-defined template (i.e. you generate your own text). This allows you to do some pretty cool things. It also makes the configuration a bit more complicated. This page will help you understand how to use templates. - In this file anything between `<` and `>` is a placeholder. Replace it with the appropriate value. -- Anything between `{{` and `}}` is a template. Templates are used to dynamically insert values into the content. For more info see [the docs](https://www.home-assistant.io/docs/configuration/templating/). +- [Jinga2](https://palletsprojects.com/p/jinja/) syntax is used by Home Assistant [Templates](https://www.home-assistant.io/docs/configuration/templating/). Templates are used to dynamically insert values into the content. The syntax includes: + + - `{%` ... `%}` for Statements + - `{{` ... `}}` for Expressions to print to the template output + - `{#` ... `#}` for Comments not included in theĀ templateĀ output ## States