File: module.rst

package info (click to toggle)
python-cloup 2.0.0.post1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 944 kB
  • sloc: python: 5,193; makefile: 116
file content (115 lines) | stat: -rw-r--r-- 2,866 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{% if not obj.display %}
:orphan:
{% endif %}

:mod:`{{ obj.name }}`
======={{ "=" * obj.name|length }}

.. py:module:: {{ obj.name }}

{% if obj.docstring %}
.. autoapi-nested-parse::

   {{ obj.docstring|prepare_docstring|indent(3) }}
{% endif %}

{% block subpackages %}
{% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
{% if visible_subpackages %}
Subpackages
-----------
.. toctree::
   :titlesonly:
   :maxdepth: 2

{% for subpackage in visible_subpackages %}
   {{ subpackage.short_name }} <{{ subpackage.short_name }}/index.rst>
{% endfor %}
{% endif %}
{% endblock %}

{% block submodules %}
{% set visible_submodules = obj.submodules|selectattr("display")|list %}
{% if visible_submodules %}
Submodules
----------
.. toctree::
   :titlesonly:
   :maxdepth: 1

{% for submodule in visible_submodules %}
   {{ submodule.short_name }} <{{ submodule.short_name }}/index.rst>
{% endfor %}
{% endif %}
{% endblock %}

{% if obj.all is not none %}
{%     set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %}
{% elif obj.type is equalto("package") %}
{%     set visible_children = obj.children|selectattr("display")|list %}
{% else %}
{%     set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %}
{% endif %}

{% if visible_children %}                              {# if visible_children #}

{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %}
{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %}
{% set visible_attributes = visible_children|selectattr("type", "equalto", "data")|list %}
{% if "show-module-summary" in autoapi_options
    and (visible_classes or visible_functions or visible_attributes) %}
                                                         {# if show-summaries #}
{# === CLASSES SUMMARY === #}
{% block classes scoped %}
{% if visible_classes %}
Classes
-------

.. autosummary::

{% for klass in visible_classes %}
   ~{{ klass.id }}
{% endfor %}
{% endif %}
{% endblock %}

{# === FUNCTIONS SUMMARY === #}
{% block functions scoped %}
{% if visible_functions %}
Functions
---------

.. autosummary::

{% for function in visible_functions %}
   ~{{ function.id }}
{% endfor %}
{% endif %}
{% endblock %}

{# === ATTTRIBUTES SUMMARY === #}
{% block attributes scoped %}
{% if visible_attributes %}
Attributes
----------

.. autoapisummary::

{% for data in visible_attributes %}
   {{ data.id }}
{% endfor %}
{% endif %}
{% endblock %}

{% endif %}                                           {# endif show-summaries #}

{# === CONTENTS === #}
{% block contents scoped %}
Contents
--------
{% for obj_item in visible_children %}
{{ obj_item.rendered|indent(0) }}
{% endfor %}
{% endblock %}

{% endif %}                                         {# endif visible-children #}