{% extends 'base.html' %}

{% macro entry_class(class) %}{% include 'entry-class.html' %}{% endmacro %}
{% macro entry_enum(enum) %}{% include 'entry-enum.html' %}{% endmacro %}
{% macro entry_function(function) %}{% include 'entry-function.html' %}{% endmacro %}
{% macro entry_property(property) %}{% include 'entry-property.html' %}{% endmacro %}
{% macro entry_data(data) %}{% include 'entry-data.html' %}{% endmacro %}

{% macro details_enum(enum, prefix) %}{% include 'details-enum.html' %}{% endmacro %}
{% macro details_function(function, prefix) %}{% include 'details-function.html' %}{% endmacro %}
{% macro details_property(property, prefix) %}{% include 'details-property.html' %}{% endmacro %}
{% macro details_data(data, prefix) %}{% include 'details-data.html' %}{% endmacro %}

{% block title %}{% set j = joiner('.') %}{% for name, _ in page.breadcrumb %}{{ j() }}{{ name }}{% endfor %} | {{ super() }}{% endblock %}

{% block main %}
        <h1>
          {%+ for name, target in page.breadcrumb[:-1] %}<span class="m-breadcrumb"><a href="{{ target }}">{{ name }}</a>.<wbr/></span>{% endfor %}{{ page.breadcrumb[-1][0] }} <span class="m-thin">class</span>
        </h1>
        {% if page.summary %}
        <p>{{ page.summary }}</p>
        {% endif %}
        {% if page.classes or page.classmethods or page.staticmethods or page.methods or page.dunder_methods or page.properties or page.data %}
        <div class="m-block m-default">
          <h3>Contents</h3>
          <ul>
            <li>
              Reference
              <ul>
                {% if page.classes %}
                <li><a href="#classes">Classes</a></li>
                {% endif %}
                {% if page.enums %}
                <li><a href="#enums">Enums</a></li>
                {% endif %}
                {% if page.classmethods %}
                <li><a href="#classmethods">Class methods</a></li>
                {% endif %}
                {% if page.staticmethods %}
                <li><a href="#staticmethods">Static methods</a></li>
                {% endif %}
                {% if page.methods %}
                <li><a href="#methods">Methods</a></li>
                {% endif %}
                {% if page.dunder_methods %}
                <li><a href="#dunder-methods">Special methods</a></li>
                {% endif %}
                {% if page.properties %}
                <li><a href="#properties">Properties</a></li>
                {% endif %}
                {% if page.data %}
                <li><a href="#data">Data</a></li>
                {% endif %}
              </ul>
            </li>
          </ul>
        </div>
        {% endif %}
        {% if page.content %}
{{ page.content }}
        {% endif %}
        {% if page.classes %}
        <section id="classes">
          <h2><a href="#classes">Classes</a></h2>
          <dl class="m-doc">
            {% for class in page.classes %}
{{ entry_class(class) }}
            {% endfor %}
          </dl>
        </section>
        {% endif %}
        {% if page.enums %}
        <section id="enums">
          <h2><a href="#enums">Enums</a></h2>
          <dl class="m-doc">
            {% for enum in page.enums %}
{{ entry_enum(enum) }}
            {% endfor %}
          </dl>
        </section>
        {% endif %}
        {% if page.classmethods %}
        <section id="classmethods">
          <h2><a href="#classmethods">Class methods</a></h2>
          <dl class="m-doc">
            {% for function in page.classmethods %}
{{ entry_function(function) }}
            {% endfor %}
          </dl>
        </section>
        {% endif %}
        {% if page.staticmethods %}
        <section id="staticmethods">
          <h2><a href="#staticmethods">Static methods</a></h2>
          <dl class="m-doc">
            {% for function in page.staticmethods %}
{{ entry_function(function) }}
            {% endfor %}
          </dl>
        </section>
        {% endif %}
        {% if page.methods %}
        <section id="methods">
          <h2><a href="#methods">Methods</a></h2>
          <dl class="m-doc">
            {% for function in page.methods %}
{{ entry_function(function) }}
            {% endfor %}
          </dl>
        </section>
        {% endif %}
        {% if page.dunder_methods %}
        <section id="dunder-methods">
          <h2><a href="#dunder-methods">Special methods</a></h2>
          <dl class="m-doc">
            {% for function in page.dunder_methods %}
{{ entry_function(function) }}
            {% endfor %}
          </dl>
        </section>
        {% endif %}
        {% if page.properties %}
        <section id="properties">
          <h2><a href="#properties">Properties</a></h2>
          <dl class="m-doc">
            {% for property in page.properties %}
{{ entry_property(property) }}
            {% endfor %}
          </dl>
        </section>
        {% endif %}
        {% if page.data %}
        <section id="data">
          <h2><a href="#data">Data</a></h2>
          <dl class="m-doc">
            {% for data in page.data %}
{{ entry_data(data) }}
            {% endfor %}
          </dl>
        </section>
        {% endif %}
        {% if page.has_enum_details %}
        <section>
          <h2>Enum documentation</h2>
          {% for enum in page.enums %}
          {% if enum.has_details %}
{{ details_enum(enum, page.prefix_wbr) }}
          {% endif %}
          {% endfor %}
        </section>
        {% endif %}
        {% if page.has_function_details %}
        <section>
          <h2>Method documentation</h2>
          {% for function in page.classmethods %}
          {% if function.has_details %}
{{ details_function(function, page.prefix_wbr) }}
          {% endif %}
          {% endfor %}
          {% for function in page.staticmethods %}
          {% if function.has_details %}
{{ details_function(function, page.prefix_wbr) }}
          {% endif %}
          {% endfor %}
          {% for function in page.methods %}
          {% if function.has_details %}
{{ details_function(function, page.prefix_wbr) }}
          {% endif %}
          {% endfor %}
          {% for function in page.dunder_methods %}
          {% if function.has_details %}
{{ details_function(function, page.prefix_wbr) }}
          {% endif %}
          {% endfor %}
        </section>
        {% endif %}
        {% if page.has_property_details %}
        <section>
          <h2>Property documentation</h2>
          {% for property in page.properties %}
          {% if property.has_details %}
{{ details_property(property, page.prefix_wbr) }}
          {% endif %}
          {% endfor %}
        </section>
        {% endif %}
        {% if page.has_data_details %}
        <section>
          <h2>Data documentation</h2>
          {% for data in page.data %}
          {% if data.has_details %}
{{ details_data(data, page.prefix_wbr) }}
          {% endif %}
          {% endfor %}
        </section>
        {% endif %}
{% endblock %}
