a b/doc/template/package.rst_t
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 | e | heading }}
18
{% else %}
19
{{- pkgname | e | heading }}
20
{% endif %}
21
22
{%- if modulefirst and not is_namespace %}
23
{{ automodule(pkgname, automodule_options) }}
24
{% endif %}
25
26
{{ toctree(subpackages) }}
27
28
{%- if submodules %}
29
{% if separatemodules %}
30
{{ toctree(submodules) }}
31
{% else %}
32
{%- for submodule in submodules %}
33
{% if show_headings %}
34
{{- submodule | e | heading(2) }}
35
{% endif %}
36
{{ automodule(submodule, automodule_options) }}
37
{% endfor %}
38
{%- endif %}
39
{%- endif %}
40
41
{%- if not modulefirst and not is_namespace %}
42
Module contents
43
---------------
44
45
{{ automodule(pkgname, automodule_options) }}
46
{% endif %}