From b63056ca0c9ec99f0ca32cfd7bc19a1af6706aee Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Thu, 16 May 2024 08:37:41 -0700 Subject: [PATCH] docs: Added a section that shows the submodules of each subpackage in the summary --- CHANGELOG.md | 4 ++++ .../python/readthedocs/children.html.jinja | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08fe5486..36760992 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ Valid subsections within a version are: Things to be included in the next release go here. +### Added + +- Added a new section in the documentation of each package/subpackage that shows the submodules (files) of that package/subpackage. + ### Removed - docs: Removed the copy code button from the Python API signatures in the documentation. diff --git a/docs/_templates/mkdocstrings/python/readthedocs/children.html.jinja b/docs/_templates/mkdocstrings/python/readthedocs/children.html.jinja index 96cb66cc..6fd5c88e 100644 --- a/docs/_templates/mkdocstrings/python/readthedocs/children.html.jinja +++ b/docs/_templates/mkdocstrings/python/readthedocs/children.html.jinja @@ -93,6 +93,17 @@ Context: {{ create_summary_table(functions) }} {% endif %} {% endwith %} + {% with modules = obj.modules|filter_objects( + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring)|selectattr("is_init_module", "equalto", false)|list|order_members(config.members_order, members_list) + %} + {% if modules %} + {% filter heading(heading_level, id=html_id ~ "-modules") %}Submodules{% endfilter %} + {{ create_summary_table(modules) }} + {% endif %} + {% endwith %} {% else %} {% if config.group_by_category %}