{% extends 'base.html' %}

{% macro entry_module(module) %}{% include 'entry-module.html' %}{% endmacro %}
{% 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_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_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">module</span>
        </h1>
        {% if page.summary %}
        <p>{{ page.summary }}</p>
        {% endif %}
        {% if page.modules or page.classes or page.functions or page.data %}
        <nav class="m-block m-default">
          <h3>Contents</h3>
          <ul>
            <li>
              Reference
              <ul>
                {% if page.modules %}
                <li><a href="#packages">Modules</a></li>
                {% endif %}
                {% if page.classes %}
                <li><a href="#classes">Classes</a></li>
                {% endif %}
                {% if page.enums %}
                <li><a href="#enums">Enums</a></li>
                {% endif %}
                {% if page.functions %}
                <li><a href="#functions">Functions</a></li>
                {% endif %}
                {% if page.data %}
                <li><a href="#data">Data</a></li>
                {% endif %}
              </ul>
            </li>
          </ul>
        </nav>
        {% endif %}
        {% if page.content %}
{{ page.content }}
        {% endif %}
        {% if page.modules %}
        <section id="namespaces">
          <h2><a href="#namespaces">Modules</a></h2>
          <dl class="m-doc">
            {% for module in page.modules %}
{{ entry_module(module) }}
            {% endfor %}
          </dl>
        </section>
        {% 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.functions %}
        <section id="functions">
          <h2><a href="#functions">Functions</a></h2>
          <dl class="m-doc">
            {% for function in page.functions %}
{{ entry_function(function) }}
            {% 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>Function documentation</h2>
          {% for function in page.functions %}
          {% if function.has_details %}
{{ details_function(function, 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 %}
