{% block main %}
    {{ block('snippets') }}
{% endblock main %}

{% if false %} {# avoid output of block directly #}
    {# Iterate over the snippets #}
    {%- block snippets -%}
        {%- for document in snippetData -%}
            {% apply spaceless %}
                {% set content = document.content %}
                {% set prefix = '' %}
            {% endapply %}{{ block('snippet') }}
        {%- endfor -%}
    {%- endblock snippets -%}

    {# Output snippet #}
    {% block snippet %}
        {{- block('content') -}}
    {% endblock snippet %}

    {# Output content #}
    {%- block content -%}
        {% set properties = content %}
        {{- block('properties') -}}
    {%- endblock content -%}

    {# Output properties #}
    {%- block properties -%}
        {%- for property in properties -%}
            {% if property.value is defined %}
                {{- block('model') -}}
            {% endif %}
            {%- if property.children is defined -%}
                {%- for key, child in property.children -%}
                    {% set prefixBefore = prefix %}
                    {% set prefix = prefix ~ property.name ~ '#' ~ key ~ '-' %}
                    {% set properties = child %}
                    {{- block('properties') -}}
                    {% set prefix = prefixBefore %}
                {%- endfor -%}
            {%- endif -%}
        {%- endfor -%}
    {%- endblock properties -%}

    {# Output model #}
    {%- block model -%}
        {% apply spaceless %}
            {% set name = prefix ~ property.name %}
            {% set options = property.options|default('') %}
            {% set value = property.value %}
            {% set type = property.type|default('') %}
        {% endapply %}{{- block('view') -}}
    {%- endblock model -%}

    {# View #}
    {%- block view -%}{%- endblock view -%}
{% endif %}
