:html_theme.sidebar_secondary.remove:

{% if module == "xlearn" -%}
{%- set module_hook = "xlearn" -%}
{%- elif module.startswith("xlearn.") -%}
{%- set module_hook = module[8:] -%}
{%- else -%}
{%- set module_hook = None -%}
{%- endif -%}

{% if module_hook %}
.. _{{ module_hook }}_ref:
{% endif %}

{{ module }}
{{ "=" * module|length }}

.. automodule:: {{ module }}

{% if module_info["description"] %}
{{ module_info["description"] }}
{% endif %}

{% for section in module_info["sections"] %}
{% if section["title"] and module_hook %}
.. _{{ module_hook }}_ref-{{ section["title"]|lower|replace(" ", "-") }}:
{% endif %}

{% if section["title"] %}
{{ section["title"] }}
{{ "-" * section["title"]|length }}
{% endif %}

{% if section["description"] %}
{{ section["description"] }}
{% endif %}

.. autosummary::
  :nosignatures:
  :toctree: ../modules/generated/
  :template: base.rst

{% for obj in section["autosummary"] %}
  {{ obj }}
{%- endfor %}
{% endfor %}
