From e2f4b35d29eca6f68afbd2e728ef7542a2abc992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Tue, 18 Jun 2024 13:23:21 +0200 Subject: [PATCH] refactor: Only filter out imported objects instead of non-public ones after applying filters Issue-mkdocstrings/griffe-294: https://github.com/mkdocstrings/griffe/issues/294 --- pyproject.toml | 2 +- .../python/templates/material/_base/children.html.jinja | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9d99d612..4e3629f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ ] dependencies = [ "mkdocstrings>=0.25", - "griffe>=0.46", + "griffe>=0.47", ] [project.urls] diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja index 492272a4..97c276a4 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja +++ b/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja @@ -49,7 +49,7 @@ Context: {% endif %} {% with heading_level = heading_level + extra_level %} {% for attribute in attributes|order_members(config.members_order, members_list) %} - {% if members_list is not none or attribute.is_public %} + {% if members_list is not none or not attribute.is_imported %} {% include attribute|get_template with context %} {% endif %} {% endfor %} @@ -69,7 +69,7 @@ Context: {% endif %} {% with heading_level = heading_level + extra_level %} {% for class in classes|order_members(config.members_order, members_list) %} - {% if members_list is not none or class.is_public %} + {% if members_list is not none or not class.is_imported %} {% include class|get_template with context %} {% endif %} {% endfor %} @@ -90,7 +90,7 @@ Context: {% with heading_level = heading_level + extra_level %} {% for function in functions|order_members(config.members_order, members_list) %} {% if not (obj.kind.value == "class" and function.name == "__init__" and config.merge_init_into_class) %} - {% if members_list is not none or function.is_public %} + {% if members_list is not none or not function.is_imported %} {% include function|get_template with context %} {% endif %} {% endif %} @@ -112,7 +112,7 @@ Context: {% endif %} {% with heading_level = heading_level + extra_level %} {% for module in modules|order_members(config.members_order.alphabetical, members_list) %} - {% if members_list is not none or module.is_public %} + {% if members_list is not none or not module.is_alias %} {% include module|get_template with context %} {% endif %} {% endfor %}