Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 1.58 KB

syntax.md

File metadata and controls

76 lines (56 loc) · 1.58 KB
layout
home

Syntax

The silverfin templating languages uses 3 kinds of tags:

Each has its own purpose as explained below.

Print tags

Print tags {% raw %}{{ }}{% endraw %} are used to print variables on the screen.

{% capture input %} {% raw %}

// {% assign variable = 100 %}
{{ variable }} {% endraw %} {% endcapture %} {% capture output %} 100 {% endcapture %} {% include preview.html %}

Logic tags

Logic tags {% raw %}{% %}{% endraw %} are used for logic and control flows.

{% capture input %}

{% raw %}
{% assign variable = 100 %}

{% if variable > 0 %}
    Hello world
{% else %}
    Bye World
{% endif %}
{% endraw %}

{% endcapture %} {% capture output %} Hello world {% endcapture %} {% include preview.html %}

Layout tags

The Layout tags {% raw %}{:: }{% endraw %} and {% raw %}{:/ }{% endraw %} are used to adjust the layout within silverfin.

{% capture input %}

{% raw %}
{::infotext}
  Some info about a subject
{:/infotext}
{% endraw %}

{% endcapture %} {% capture output %} {% endcapture %} {% include preview.html %}