{% for kind, title in kinds.items() %}
<h2>{{ title }}</h2>
<ul class="full-width">
{% for title,data in ids[kind]|dictsortunicode -%}
<li id="{{ data.idsp_id }}" class="indexnp-entry">
    <span class="text">
        {% if data.glossaire_id -%}
            <a href="{{ data.glossaire_id }}">{{ title|markdownem }}</a>
        {%- else -%}
            {{ title|markdownem }}
        {%- endif %}
    </span>
    <span class="dots"></span>
    <span class="number">
    {% for chapter_id, occurences in refs[title].items() -%}
        <a href="{{ chapter_id }}.html#{{ data.idsp_id }}">{{ chapter_id }}</a> ({{ occurences }} <abbr title="occurences">occ.</abbr>){% if not loop.last %}<br>{% endif %}
    {%- endfor %}
    </span>
</li>
{%- endfor %}
</ul>
{%- endfor %}
