{% extends "default/module.html.jinja2" %}

{% block nav_members %}
    {% if module.members %}
        {{ nav_members(module.members.values()) }}
    {% endif %}
{% endblock %}

{% defaultmacro default_value(var) -%}
    {%- if var.default_value_str %}

        {% if var.default_value_str | length > 100 -%}
            <input id="{{ var.qualname }}-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
            <label class="view-value-button pdoc-button" for="{{ var.qualname }}-view-value"></label>
        {%- endif -%}
        <span class="default_value"><i>defined at runtime</i></span>
    {%- endif -%}
{% enddefaultmacro %}

{% block nav_index %}
    {% set index = module.docstring | to_markdown | to_html | attr("toc_html") %}
    {% if index %}
        <h2>Conteúdos</h2>
        {{ index | safe }}
    {% endif %}
{% endblock %}

{% block nav_submodules %}
    {% if module.submodules %}
        <h2>Submódulos</h2>
        <ul>
        {% for submodule in module.submodules if is_public(submodule) | trim %}
            <li>{{ submodule.taken_from | link(text=submodule.name) }}</li>
        {% endfor %}
        </ul>
    {% endif %}
{% endblock %}

{% block search_box %}
    {% if search and all_modules|length > 1 %}
        {# we set a pattern here so that we can use the :valid CSS selector #}
        <input type="search" placeholder="Pesquisar..." role="searchbox" aria-label="search"
            pattern=".+" required>
    {% endif %}
{% endblock %}

{% block attribution %}
    <a class="attribution" title="pdoc: Python API documentation generator" href="https://pdoc.dev" target="_blank">
        feito com<span class="visually-hidden">pdoc</span><img
        alt="pdoc logo"
        src="data:image/svg+xml,
            {%- filter urlencode %}{% include "resources/pdoc-logo.svg" %}{% endfilter %}"/>
    </a>
{% endblock %}
