Skip to content

Commit 43ddd91

Browse files
authored
Create a re-export table for the imports a python module exposes (#117)
1 parent f12b09c commit 43ddd91

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

docs/source/_templates/autoapi/python/module.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,25 @@ Submodules
4848
{% endblock %}
4949
{% block content %}
5050
{% if obj.all is not none %}
51-
{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %}
51+
{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|rejectattr("imported")|list %}
52+
{% set re_exports = obj.children|selectattr("short_name", "in", obj.all)|selectattr("imported")|list %}
5253
{% elif obj.type is equalto("package") %}
5354
{% set visible_children = obj.children|selectattr("display")|list %}
5455
{% else %}
5556
{% set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %}
5657
{% endif %}
58+
59+
{% if re_exports %}
60+
Re-Exports
61+
~~~~~~~~~~
62+
63+
.. autoapisummary::
64+
65+
{% for klass in re_exports %}
66+
{{ klass.obj["original_path"] }}
67+
{% endfor %}
68+
{% endif %}
69+
5770
{% if visible_children %}
5871
{{ obj.type|title }} Contents
5972
{{ "-" * obj.type|length }}---------

0 commit comments

Comments
 (0)