Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example

{% autoescape "js" %}
${content}
{% endautoescape %}

Anchor
_block
_block
block

...

Template

{% block "${blockName}" %}
${content}
{% endblock %}

Anchor
_extends
_extends
extends

The extends tag is used to declare a parent template. It should be the very first tag used in a child template and a child template can only extend up to one parent template.

Template

{% extends "${templateName}" %}

Anchor
_filter
_filter
filter

The filter tag allows you to apply a filter to a large chunk of template.

Template

{% filter ${filter} %}
${content}
{% endfilter %}

Template 2

{% filter ${filter1} | ${filter2} %}
${content}
{% endfilter %}

Anchor
_for
_for
for

The for tag is used to iterate through a collection or map.

Template

{% for ${i} in ${collection} %}
${content}
{% endfor %}

Anchor
_for_else
_for_else
for else

The for tag is used to iterate through a collection or map with a convenient way to check for emptiness.

Template

{% for ${i} in ${collection} %}
${content}

{% else %}
${content}

{% endfor %}

Anchor
_if
_if
if

The if tag allows you to designate a chunk of content as conditional depending on the result of an expression.

Template

{% if ${condition} %}
${content}
{% endif %}

Anchor
_if_else
_if_else
if else

The if tag allows you to designate a chunk of content as conditional depending on the result of an expression.

Template

{% if ${condition} %}
${content}
{% else %}
${content}
{% endif %}

Anchor
_if_elseif
_if_elseif
if elseif

The if tag allows you to designate a chunk of content as conditional depending on the result of an expression.

Template

{% if ${condition} %}
${content}
{% elseif %}
${content}
{% else %}
${content}
{% endif %}

Anchor
_import
_import
import

The import tag allows you to use macros defined in another template.

Template

{% import "${templateName}" %}

Anchor
_include
_include
include

The include tag allows you to insert the rendered output of another template directly into the current template. The included template will have access to the same variables that the current template does.

Template

{% include "${templateName}" %}

Anchor
_include_with
_include_with
include with

The include tag allows you to insert the rendered output of another template directly into the current template. The included template will have access to the same variables that the current template does with additional variables.

Template

{% include "${templateName}" with { ${mapOfVariables} } %}

Anchor
_macro
_macro
macro

The macro tag allows you to create a chunk of reusable and dynamic content. The macro can be called multiple times in the current template or even from another template with the help of the import tag.

Example

{% macro concat(left, right) %}
{{ left }} {{ right }}
{% endmacro %}

Anchor
_parallel
_parallel
parallel

The parallel tag allows you to designate a chunk of content to be rendered using a new thread.

Template

{% parallel %}
${content}
{% endparallel %}

Anchor
_set
_set
set

The set tag allows you to define a variable in the current context, whether it currently exists or not.
Will initialize the variable or override the current value in the variable.

...

The verbatim tag allows you to write Pebble syntax that won't be parsed.

Example

{% verbatim %}
{% if not varA is defined %}
{% set varA = "Abc" %}
{% endif %}
{% endverbatim %}

Anchor
_br
_br
br

The br tag adds a line break token at the current position.
Use an additional parameter to change the type of line break: lf (Default), crlf, other "token".

Template

{% br %}
{% br lf %}
{% br crlf %}
{% br other "

|" %}

Anchor
_counter
_counter
counter

The counter tag outputs an integer value that is incremented by one for each use.
Use the parameter local to make the counter increments per used template.

Example

{% counter %} pencil
{% counter %} pens

Output

1 pencil
2 pens

Example 2

Template "Other": {% counter local %}
Main template: {% counter local %}{% include "Other" %}

Outputs

11

Anchor
_declare
_declare
declare

The declare tag allows you to define a variable in the current context if it does not exist. If the variable does exist it will not be changed.

Note
titleNote

The following are the same:

{% declare encapsulation = true %}
{% set

...

 encapsulation = encapsulation | default(true) %}


Example

{% set varA = "aa" %}
{% declare varA = "bb" %}
{% declare varB = "cc" %}
{{ varA }} {{ varB }}

Outputs

aa cc

Anchor
_error
_error
error

The error tag allows you to fail generating the template with an error message, e.g. if something unexpected occurs.

Example

{% if not requiredVar is defined %}
{% error "Something terrible has occurred" %}

Anchor
_indent
_indent
indent

The indent tag adds one or more 4-space indents at the current position.

Example

{% indent %}

Example 2

{% indent 3 %}

Anchor
_from
_from
from

The from tag is used to iterate a subset of a collection defined by the where condition.

Template

{% from ${collection} as ${var} where ${test} %}
${content}
{% endfrom %}

Example

{% from range(1,10) as num where num is even %}
{{- num }}{% br %}
{% endfrom %}

Output

2
4
6
8
10

Anchor
_from_else
_from_else
from else

The from tag is used to iterate a subset of a collection defined by the where condition with a convenient way to check for emptiness.

{% from [] as num where num is even -%}
]]></ac:plain-text-body></ac:structured-macro>
Even numbers{% br

Template

{% from ${collection} as ${var} where ${test} %}
${content}
{% else %}
${content}
{% endfrom %}

Example

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="dabd2011-7538-4e2e-850b-fdf27eee36af"><ac:plain-text-body><![CDATA[

{% from [] as num where num is even -%}
Even numbers{% br %}
{% else -%}
Empty collection{% endfrom %}

Output

Empty collection

Anchor
_list_add
_list_add
list add

The list with add tag is used to append a value to a list.

Example

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0cedd645-de41-481c-a89d-983775d818d2"><ac:plain-text-body><![CDATA[

{% set alphabet = ["a", "b", "c"] %}

]]></ac:plain-text-body></ac:structured-macro>

{{ alphabet }}{% br %}
{% list alphabet add "d" -%}
{{ alphabet }}

Outputs

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c5170336-1e3f-4aea-9fa3-5f17a09f05fe"><ac:plain-text-body><![CDATA[

[a, b, c]

]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="bfa00ab0-ee96-4a6d-8634-4209365435f9"><ac:plain-text-body><![CDATA

[

[

a, b, c, d]

]]></ac:plain-text-body></ac:structured-macro>

Anchor
_list_adds
_list_adds
list adds

The list with add tag is used to append one or more values to a list.

Example

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2eaab83f-6c7e-450a-99a5-ba5ec9177c28"><ac:plain-text-body><![CDATA[

{% set alphabet = ["a", "b", "c"] %}

]]></ac:plain-text-body></ac:structured-macro>

{{ alphabet }}{% br %}
{% list alphabet add "d", "e", "f" -%}
{{ alphabet }}

Outputs

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f0bb21cb-27e4-45b7-ab38-bf21bafc80c8"><ac:plain-text-body><![CDATA[

[a, b, c]

]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f082b706-09a4-48fc-baa0-9d447b4595b4"><ac:plain-text-body><![CDATA[

[a, b, c, d, e, f]

]]></ac:plain-text-body></ac:structured-macro>

Anchor
_list_remove
_list_remove
list remove

The list with remove tag is used to remove a value from a list.

{% set alphabet =

Example

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="8f929fb2-961f-4c4c-834d-3c98a54b59bb"><ac:plain-text-body><![CDATA[

{% set alphabet = ["a", "b", "c", "d", "e", "f"] %}


]]></ac:plain-text-body></ac:structured-macro>

{{ alphabet }}{% br %}


{% list alphabet remove "d", "e", "f" -%}
{{ alphabet }}

Outputs

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="071b402f-43b4-43b3-9bdf-af934b8edeff"><ac:plain-text-body><!

[

CDATA[[

a, b, c, d, e, f]

]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="faa6e075-80d6-401b-9baf-a7cad9582951"><ac:plain-text-body><![CDATA[

[a, b, c

, e, f

]

]]></ac:plain-text-body></ac:structured-macro>

Anchor
_list_removes
_list_removes
list removes

The list with remove tag is used to remove one or more values from a list.

{% set alphabet =

Example

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="dbe62065-cf99-438e-a145-ef5755c3622f"><ac:plain-text-body><![CDATA[

{% set alphabet = ["a", "b", "c", "d", "e", "f"] %}

]]></ac:plain-text-body></ac:structured-macro>

{{ alphabet }}{% br %}
{% list alphabet remove "d", "e", "f" -%}
{{ alphabet }}

Outputs

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="7e892a71-54a9-49f6-ba14-1e0de11f7a75"><ac:plain-text-body><![CDATA[

[a, b, c, d, e, f]

]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="d21a329f-2180-4035-9b7b-0e6918d1d8ec"><ac:plain-text-body><!

[

CDATA[[

a, b, c]

]]></ac:plain-text-body></ac:structured-macro>

Anchor
_map_put
_map_put
map put

The map put tag is used to set a key-value pair into a map, whether it currently exists or not.

Template

{% map ${mapVar} put ${key} = ${value} %}

Anchor
_map_remove
_map_remove
map remove

The map remove tag is used to remove a key from a map.

Template

{% map ${mapVar} remove ${key} %}

Anchor
_placebottom
_placebottom
placebottom

The placebottom tag allows defining a block in the template that will be placed at the end of the output. The priority argument defines the order of multiple place bottom blocks.

Template

{% placebottom ${priority} %}
${content}
{% endplacebottom %}

Anchor
_get
_get
get

The get tag defines a variable as a subset of a collection based on the given condition.

Example

{% get evenNums from range(1,10) as num where num is even %}
{{ evenNums }}

Output

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="4c86ddba-be11-4ece-92f8-bbc1002b8a38"><ac:plain-text-body><![CDATA[[2, 4, 6, 8, 10]]]></ac:plain-text-body></ac:structured-macro>