{% macro member(m) %}
<div class="member{% if m.deprecated %} is-deprecated{% endif %}" id="{{ m.name }}">
    <div class="member-head">
    <span class="member-signature">{{ m.display | safe }}</span>
    {% if m.deprecated %}<span class="deprecated-badge">Deprecated</span>{% endif %}
    </div>
  <div class="member-body">
    {% if m.description %}<div class="docblock">{{ m.description }}</div>{% endif %}
    {% if m.overloads %}
    <div class="member-detail">
      <div class="detail-title">Overloads</div>
      <div class="member-overloads">
        {% for o in m.overloads %}<div class="member-signature">{{ o | safe }}</div>{% endfor %}
      </div>
    </div>
    {% endif %}
    {% if m.params %}
    <div class="member-detail">
      <div class="detail-title">Parameters</div>
      <dl class="param-list">
        {% for p in m.params %}
        <div class="param-row">
          <dt><code>{{ p.name }}</code>{% if p.type_html %}<span class="param-type">{{ p.type_html | safe }}</span>{% endif %}</dt>
          <dd>{% if p.description %}{{ p.description }}{% endif %}</dd>
        </div>
        {% endfor %}
      </dl>
    </div>
    {% endif %}
    {% if m.returns %}
    <div class="member-detail">
      <div class="detail-title">Returns</div>
      <dl class="param-list">
        {% for r in m.returns %}
        <div class="param-row">
          <dt>{% if r.name %}<code>{{ r.name }}</code>{% endif %}{% if r.type_html %}<span class="param-type">{{ r.type_html | safe }}</span>{% endif %}</dt>
          <dd>{% if r.description %}{{ r.description }}{% endif %}</dd>
        </div>
        {% endfor %}
      </dl>
    </div>
    {% endif %}
    {% if m.deprecated %}<div class="deprecated">{{ m.deprecated }}</div>{% endif %}
    {% if m.see %}<div class="see">See: {{ m.see }}</div>{% endif %}
    {% if m.other %}<div class="other">{{ m.other }}</div>{% endif %}
  </div>
</div>
{% endmacro %}

{% macro index_section(id, title, groups) %}
{% if groups %}
<section class="section" id="{{ id }}">
    <h2><a class="section-link" href="#{{ id }}">{{ title }}</a></h2>
    <nav class="letter-bar" aria-label="Jump to letter">
        {% for group in groups %}
        <a href="#{{ id }}-{{ group.anchor }}">{{ group.letter }}</a>
        {% endfor %}
    </nav>
    <div class="index-groups">
        {% for group in groups %}
        <div class="index-group" id="{{ id }}-{{ group.anchor }}">
            <div class="index-letter">{{ group.letter }}</div>
            <ul class="index-list">
                {% for item in group.items %}
                <li>
                    <a href="{{ item.href }}">{% if item.kind_letter %}<span class="kind-badge kind-{{ item.kind }}"
                            aria-hidden="true">{{ item.kind_letter
                            }}</span>{% endif %}{{ item.short_name }}</a>
                </li>
                {% endfor %}
            </ul>
        </div>
        {% endfor %}
    </div>
</section>
{% endif %}
{% endmacro %}
