{% extends 'base.template.html' -%}

{% macro listItems(items, title) %}
  {% if items.length %}
  <section class="export-list">
    <h3>{$ title $}</h3>
    <table class="is-full-width list-table">
      {% for item in items %}
      <tr>
        <td><code class="code-anchor">
          <a href="{$ item.path $}">{$ item.name $}</a></code></td>
        <td>{% if item.shortDescription %}{$ item.shortDescription | marked $}{% endif %}</td>
      </tr>
      {% endfor %}
    </table>
  </section>
  {% endif %}
{% endmacro %}

{% block body -%}
  {% include "includes/deprecation.html" %}
  {$ doc.shortDescription | marked $}
  {% if doc.description %}{$ doc.description | marked $}{% endif %}

  {% include "includes/see-also.html" %}

  <h2>Entry points</h2>
  {$ listItems([doc.packageInfo.primary], 'Primary') $}
  {$ listItems(doc.packageInfo.secondary, 'Secondary') $}


  <h2>Exports</h2>
  {$ listItems(doc.classes, 'Classes') $}
  {$ listItems(doc.decorators, 'Decorators') $}
  {$ listItems(doc.functions, 'Functions') $}
  {$ listItems(doc.structures, 'Structures') $}
  {$ listItems(doc.directives, 'Directives') $}
  {$ listItems(doc.pipes, 'Pipes') $}
  {$ listItems(doc.types, 'Types') $}
{%- endblock %}
