<commit_before>{##
    PROPERTY                REQUIRED
    =================================

    breadcrumbs             required
    items *                 required

    * each item must be like
        {
            description,
            twig,
            preview_parameters **
        }

        ** each preview_parameter must be like
            {
                params
            }
#}
{%- macro tab(tab_level) -%}
{% for level in 0..tab_level %}{{ '&#9' }}{% endfor %}
{%- endmacro -%}

{%- macro print_param_value(param_value, tab_level) -%}
{% import _self as macros %}
{% if param_value is iterable %}
{% for key, value in param_value %}
{% if value is iterable %}
{{-macros.tab(tab_level)-}}{{- key -}}: [{% for k, v in value %}{&#10{{- macros.print_param_value(v, tab_level + 1) -}}&#10{{-macros.tab(tab_level)-}}}{% if not loop.last %},{% endif %}{% endfor %}]{% else %}{{-macros.tab(tab_level)-}}{{- key -}}: '{{- value -}}'{% if not loop.last %},&#10{% endif %}
{% endif %}
{% endfor %}
{% else %}
{{- param_value -}}
{% endif %}
{%- endmacro -%}

{% import _self as macros %}

<article class="article">
    <p class="article__breadcrumbs">
    {% for breadcrumb in breadcrumbs %}
        {% if not loop.last %}
            {{ breadcrumb }}
            <span class="article__breadcrumbs-separator">/</span>
        {% else %}
    </p>
            <h1 class="article__title">{{ breadcrumb|replace({'-': ' '}) }}</h1>
        {% endif %}
    {% endfor %}

    <div class="article__description">
        {{ macros.tab(3) }}
        {{ item.description|raw }}
    </div>

    {% for params in item.preview_parameters %}
        {% set item_preview = include(item.twig, params) %}
        {% set item_twig %}
<pre><code class="language-twig">
{{- '{% include \'' ~ item.twig ~ '\' with {' -}}
&#10{{- macros.print_param_value(params, 0) -}}&#10
{{- '} %}' -}}
</code></pre>
        {% endset %}

        {% set item_html = '<pre><code class="language-html">' ~ item_preview|tidy|nl2br ~ '</code></pre>' %}

        {% include '@lin3s_pattern_library_builder/components/tabbed.html.twig' with {
            tabs: [{
                content: item_preview,
                title: 'Preview'
            }, {
                content: item_twig,
                title: 'Twig'
            }, {
                content: item_html,
                title: 'Html'
            }]
        } %}
    {% endfor %}
</article><commit_msg>Updated article.html.twig. It now uses the PrettifyTwigParametersExtension function instead of the previously used macro.<commit_after>{##
    PROPERTY                REQUIRED
    =================================

    breadcrumbs             required
    items *                 required

    * each item must be like
        {
            description,
            twig,
            preview_parameters **
        }

        ** each preview_parameter must be like
            {
                params
            }
#}

<article class="article">
    <p class="article__breadcrumbs">
    {% for breadcrumb in breadcrumbs %}
        {% if not loop.last %}
            {{ breadcrumb }}
            <span class="article__breadcrumbs-separator">/</span>
        {% else %}
    </p>
            <h1 class="article__title">{{ breadcrumb|replace({'-': ' '}) }}</h1>
        {% endif %}
    {% endfor %}

    <div class="article__description">
        {{ macros.tab(3) }}
        {{ item.description|raw }}
    </div>

    {% for params in item.preview_parameters %}
        {% set item_preview = include(item.twig, params) %}
        {% set item_twig %}
<pre><code class="language-twig">
{{- '{% include \'' ~ item.twig ~ '\' with {' -}}
{{ prettify_twig_parameters(params) }}
{{- '} %}' -}}
</code></pre>
        {% endset %}

        {% set item_html = '<pre><code class="language-html">' ~ item_preview|tidy|nl2br ~ '</code></pre>' %}

        {% include '@lin3s_pattern_library_builder/components/tabbed.html.twig' with {
            tabs: [{
                content: item_preview,
                title: 'Preview'
            }, {
                content: item_twig,
                title: 'Twig'
            }, {
                content: item_html,
                title: 'Html'
            }]
        } %}
    {% endfor %}
</article>
{'fraction_non_alphanumeric': 0.18443871572533396, 'fraction_numerical': 0.005624560581204594, 'mean_word_length': 1.8857336037863421, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '378702', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1264, 'n_words': 260}