| 1 |
{%- macro automodule(modname, options) -%} |
| 2 |
.. automodule:: {{ modname }} |
| 3 |
{%- for option in options %} |
| 4 |
:{{ option }}: |
| 5 |
{%- endfor %} |
| 6 |
{%- endmacro %} |
| 7 |
|
| 8 |
{%- macro toctree(docnames) -%} |
| 9 |
.. toctree:: |
| 10 |
:maxdepth: {{ maxdepth }} |
| 11 |
{% for docname in docnames %} |
| 12 |
{{ docname }} |
| 13 |
{%- endfor %} |
| 14 |
{%- endmacro %} |
| 15 |
|
| 16 |
{%- if is_namespace %} |
| 17 |
{{- [pkgname, "namespace"] | join(" ") | e | heading }} |
| 18 |
{% else %} |
| 19 |
{{- [pkgname, "package"] | join(" ") | e | heading }} |
| 20 |
{% endif %} |
| 21 |
|
| 22 |
{%- if modulefirst and not is_namespace %} |
| 23 |
{{ automodule(pkgname, automodule_options) }} |
| 24 |
{% endif %} |
| 25 |
|
| 26 |
{%- if subpackages %} |
| 27 |
.. only:: html |
| 28 |
|
| 29 |
Subpackages |
| 30 |
----------- |
| 31 |
{{ toctree(subpackages) }} |
| 32 |
{% endif %} |
| 33 |
|
| 34 |
{%- if submodules %} |
| 35 |
.. only:: html |
| 36 |
|
| 37 |
Submodules |
| 38 |
---------- |
| 39 |
{% if separatemodules %} |
| 40 |
{{ toctree(submodules) }} |
| 41 |
{% else %} |
| 42 |
{%- for submodule in submodules %} |
| 43 |
{% if show_headings %} |
| 44 |
{{- [submodule, "module"] | join(" ") | e | heading(2) }} |
| 45 |
{% endif %} |
| 46 |
{{ automodule(submodule, automodule_options) }} |
| 47 |
{% endfor %} |
| 48 |
{%- endif %} |
| 49 |
{%- endif %} |
| 50 |
|
| 51 |
{%- if not modulefirst and not is_namespace %} |
| 52 |
Module contents |
| 53 |
--------------- |
| 54 |
|
| 55 |
{{ automodule(pkgname, automodule_options) }} |
| 56 |
{% endif %} |