{% from 'icons.html.jinja' import show_icon_map, input_icon_map %}


{% set table %}

<table>
    <thead>
        <tr>
            <th>Name</th>
            <th>Definition</th>
            <th>Type</th>
        </tr>
    </thead>
    <tbody>
    {% for entry in predicate_info.values() %}
        <tr>
            <td><a href="#{{ entry.identifier }}-{{ entry.arity }}"><code>{{ entry.signature }}</code></a></td>
            <td>
            {%- if entry.documentation %}
            {{ entry.documentation.description | convert_markdown(5, html_id) }}
            {% endif %}
            {# TODO: Here we could use AI to make a summary that is smaller than some length and only text #}
            </td>
            <td style="padding-top: 0; padding-bottom: 0;">
                {{input_icon_map[entry.is_input]}} {{show_icon_map[entry.show_status]}}
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>

{% endset %}


{% set toc_label %}
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m0 4v4h6V8zm8 0v4h6V8zm-8 6v4h6v-4zm8 0v4h6v-4z"></path></svg>
    <span class="md-ellipsis" style="vertical-align: top;">Predicate Summary</span>
{% endset %}

{% filter heading(config.start_level+1, id="predicate_summary", toc_label=toc_label) %}
<span class="md-icon">{{ ":material-table:"|convert_markdown(3) }}</span> Predicate Summary
{% endfilter %}

{{ table }}
