From dcead320ee50c45c735ea547e9d49c4c2a05969a Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Mon, 20 Apr 2026 13:49:30 +0000 Subject: [PATCH] Create a re-export table for the imports a python module exposes --- docs/source/_templates/autoapi/python/module.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/source/_templates/autoapi/python/module.rst b/docs/source/_templates/autoapi/python/module.rst index 1f683fa..9195be1 100644 --- a/docs/source/_templates/autoapi/python/module.rst +++ b/docs/source/_templates/autoapi/python/module.rst @@ -48,12 +48,25 @@ Submodules {% endblock %} {% block content %} {% if obj.all is not none %} -{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %} +{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|rejectattr("imported")|list %} +{% set re_exports = obj.children|selectattr("short_name", "in", obj.all)|selectattr("imported")|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 re_exports %} +Re-Exports +~~~~~~~~~~ + +.. autoapisummary:: + +{% for klass in re_exports %} + {{ klass.obj["original_path"] }} +{% endfor %} +{% endif %} + {% if visible_children %} {{ obj.type|title }} Contents {{ "-" * obj.type|length }}---------