2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-08 19:10:41 +00:00
bat/tests/syntax-tests/highlighted/Jinja2/template.jinja2
2020-10-04 21:31:19 +02:00

31 lines
5.1 KiB
Django/Jinja
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends 'base.jinja2' %}
<h1>{% block title %}{% endblock %}</h1>
{% for entry in entries %}
 <span>Entry {{ loop.index }}</span>
 {% if entry.show %}
 <p>{{ entry.value }}</p>
 {% else if false %}
 <p>No value</p>
 {% endif %}
{% endfor %}
{% set some_value = 123 %}
 <div>{{ some_value | custom_filter }}, {{ some_value | abs }}</div>
{% endset %}
{{ some_dict['val'].val }}
{# comment #}
{#
 longer comment
 {{ value }}
#}
{% raw %}
 {{ do not transform }}
{% endraw %}
{% macro some_macro(value) -%}
 <p style="color: red;">{{ value }}</p>
{%- endmacro %}
{% if another_val is defined %}
 <h3>{{ another_val }}</h3>
{% else %}
 <h3>Unknown</h3>
{% endif %}