{%- include dependencies.html data=include.data -%}
{%- for code in include.data.codes -%}

{%- capture header -%}
<ul>
    <li><a href="{{ site.github.repository_url }}/blob/{{ site.branch_name | default: "HEAD" }}/{{ site.basedir }}{{ code.path }}">View this file on GitHub</a></li>
    <li>Last update: {{ code.timestamp }}</li>
    {% if code.attributes.PROBLEM %}
    <li>Problem: <a href="{{ code.attributes.PROBLEM }}">{{ code.attributes.PROBLEM | xml_escape }}</a></li>
    {%- endif -%}
    {% if code.pathExtension == "hpp" %}<li><a id="include-directive-anchor">Include: <code id="include-directive-code">#include "{{ code.path }}"</code></a></li>{%- endif -%}
    {%- for link in code.attributes.links -%}
    {%- if link != code.attributes.PROBLEM -%}
    <li>Link: <a href="{{ link | xml_escape }}">{{ link | xml_escape }}</a></li>
    {%- endif -%}
    {%- endfor -%}
</ul>
{{ code.documentContent | markdownify }}
{%- endcapture -%}

{%- if code.title -%}
    {%- capture page_title -%}{{code.title | xml_escape }} <small>({{ code.path | xml_escape }})</small>{%- endcapture -%}
{%- else -%}
    {%- capture page_title -%}{{code.path | xml_escape }}{%- endcapture -%}
{%- endif -%}
{%- include code_and_testcases.html data=code title=page_title header=header test_cases_tag='h3' -%}
{%- endfor -%}