{%- macro automodule(modname, options) -%}
.. automodule:: {{ modname }}
{%- for option in options %}
   :{{ option }}:
{%- endfor %}
{%- endmacro %}

{%- macro toctree(docnames) -%}
.. toctree::
    :maxdepth: 4
{% for docname in docnames %}
   {{ docname }}
{%- endfor %}
{%- endmacro %}

{{- [pkgname, "package"] | join(" ") | e | heading }}
