|
| 1 | +{# Adapted from sphinx-autoapi https://github.com/readthedocs/sphinx-autoapi #} |
| 2 | +{% if obj.display %} |
| 3 | + {% if is_own_page %} |
| 4 | +{{ obj.id }} |
| 5 | +{{ "=" * obj.id|length }} |
| 6 | + |
| 7 | +.. py:module:: {{ obj.name }} |
| 8 | +
|
| 9 | + {% if obj.docstring %} |
| 10 | +.. autoapi-nested-parse:: |
| 11 | + |
| 12 | + {{ obj.docstring|indent(3) }} |
| 13 | + |
| 14 | + {% endif %} |
| 15 | + |
| 16 | + {% block content %} |
| 17 | + {% set visible_children = obj.children|selectattr("display")|list %} |
| 18 | + {% if visible_children %} |
| 19 | + {% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %} |
| 20 | + {% if visible_classes %} |
| 21 | + {% if "class" in own_page_types or "show-module-summary" in autoapi_options %} |
| 22 | +Classes |
| 23 | +------- |
| 24 | + |
| 25 | + {% if "class" in own_page_types %} |
| 26 | +.. toctree:: |
| 27 | + :hidden: |
| 28 | + :caption: Classes |
| 29 | + |
| 30 | + {% for klass in visible_classes %} |
| 31 | + {{ klass.include_path }} |
| 32 | + {% endfor %} |
| 33 | + |
| 34 | + {% endif %} |
| 35 | +.. autoapisummary:: |
| 36 | + |
| 37 | + {% for klass in visible_classes %} |
| 38 | + {{ klass.id }} |
| 39 | + {% endfor %} |
| 40 | + {% endif %} |
| 41 | + |
| 42 | + |
| 43 | + {% endif %} |
| 44 | + {% set visible_exceptions = visible_children|selectattr("type", "equalto", "exception")|list %} |
| 45 | + {% if visible_exceptions %} |
| 46 | + {% if "exception" in own_page_types or "show-module-summary" in autoapi_options %} |
| 47 | +Exceptions |
| 48 | +---------- |
| 49 | + |
| 50 | + {% if "exception" in own_page_types %} |
| 51 | +.. toctree:: |
| 52 | + :hidden: |
| 53 | + |
| 54 | + {% for exception in visible_exceptions %} |
| 55 | + {{ exception.include_path }} |
| 56 | + {% endfor %} |
| 57 | + |
| 58 | + {% endif %} |
| 59 | +.. autoapisummary:: |
| 60 | + |
| 61 | + {% for exception in visible_exceptions %} |
| 62 | + {{ exception.id }} |
| 63 | + {% endfor %} |
| 64 | + {% endif %} |
| 65 | + |
| 66 | + |
| 67 | + {% endif %} |
| 68 | + {% set visible_attributes = visible_children|selectattr("type", "equalto", "data")|list %} |
| 69 | + {% if visible_attributes %} |
| 70 | + {% if "attribute" in own_page_types or "show-module-summary" in autoapi_options %} |
| 71 | +Attributes |
| 72 | +---------- |
| 73 | + |
| 74 | + {% if "attribute" in own_page_types %} |
| 75 | +.. toctree:: |
| 76 | + :hidden: |
| 77 | + |
| 78 | + {% for attribute in visible_attributes %} |
| 79 | + {{ attribute.include_path }} |
| 80 | + {% endfor %} |
| 81 | + |
| 82 | + {% endif %} |
| 83 | +.. autoapisummary:: |
| 84 | + |
| 85 | + {% for attribute in visible_attributes %} |
| 86 | + {{ attribute.id }} |
| 87 | + {% endfor %} |
| 88 | + {% endif %} |
| 89 | + |
| 90 | + |
| 91 | + {% endif %} |
| 92 | + {% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %} |
| 93 | + {% if visible_functions %} |
| 94 | + {% if "function" in own_page_types or "show-module-summary" in autoapi_options %} |
| 95 | +Functions |
| 96 | +--------- |
| 97 | + |
| 98 | + {% if "function" in own_page_types %} |
| 99 | +.. toctree:: |
| 100 | + :hidden: |
| 101 | + |
| 102 | + {% for function in visible_functions %} |
| 103 | + {{ function.include_path }} |
| 104 | + {% endfor %} |
| 105 | + |
| 106 | + {% endif %} |
| 107 | +.. autoapisummary:: |
| 108 | + |
| 109 | + {% for function in visible_functions %} |
| 110 | + {{ function.id }} |
| 111 | + {% endfor %} |
| 112 | + {% endif %} |
| 113 | + |
| 114 | + |
| 115 | + {% endif %} |
| 116 | + {% set visible_subpackages = obj.subpackages|selectattr("display")|list %} |
| 117 | + {% set visible_submodules = obj.submodules|selectattr("display")|list %} |
| 118 | + {% set visible_submodules = (visible_subpackages + visible_submodules)|sort %} |
| 119 | + {% if visible_submodules %} |
| 120 | +.. toctree:: |
| 121 | + :caption: Submodules |
| 122 | + :maxdepth: 1 |
| 123 | + |
| 124 | + {% for submodule in visible_submodules %} |
| 125 | + {{ submodule.include_path }} |
| 126 | + {% endfor %} |
| 127 | + {% endif %} |
| 128 | + {% set this_page_children = visible_children|rejectattr("type", "in", own_page_types)|list %} |
| 129 | + {% if this_page_children %} |
| 130 | +{{ obj.type|title }} Contents |
| 131 | +{{ "-" * obj.type|length }}--------- |
| 132 | + |
| 133 | + {% for obj_item in this_page_children %} |
| 134 | +{{ obj_item.render()|indent(0) }} |
| 135 | + {% endfor %} |
| 136 | + {% endif %} |
| 137 | + {% endif %} |
| 138 | + {% endblock %} |
| 139 | + {% else %} |
| 140 | +.. py:module:: {{ obj.name }} |
| 141 | +
|
| 142 | + {% if obj.docstring %} |
| 143 | + .. autoapi-nested-parse:: |
| 144 | + |
| 145 | + {{ obj.docstring|indent(6) }} |
| 146 | + |
| 147 | + {% endif %} |
| 148 | + {% for obj_item in visible_children %} |
| 149 | + {{ obj_item.render()|indent(3) }} |
| 150 | + {% endfor %} |
| 151 | + {% endif %} |
| 152 | +{% endif %} |
0 commit comments