From 35eb81162582d794f170cd7e8c68f10ecfd8ff9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Wed, 23 Aug 2023 22:39:34 +0200 Subject: [PATCH] refactor: Improve guessing whether an object is public --- pyproject.toml | 2 +- .../python/templates/material/_base/children.html | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c25588d5..d7f58317 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ ] dependencies = [ "mkdocstrings>=0.20", - "griffe>=0.33", + "griffe>=0.35", ] [project.urls] diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/children.html b/src/mkdocstrings_handlers/python/templates/material/_base/children.html index 2fd16450..19b9c676 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/children.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/children.html @@ -31,7 +31,7 @@ {% endif %} {% with heading_level = heading_level + extra_level %} {% for attribute in attributes|order_members(config.members_order, members_list) %} - {% if not attribute.is_alias or attribute.is_explicitely_exported or attribute.inherited %} + {% if members_list is none and attribute.is_public(check_name=False) %} {% include attribute|get_template with context %} {% endif %} {% endfor %} @@ -51,7 +51,7 @@ {% endif %} {% with heading_level = heading_level + extra_level %} {% for class in classes|order_members(config.members_order, members_list) %} - {% if not class.is_alias or class.is_explicitely_exported or class.inherited %} + {% if members_list is none and class.is_public(check_name=False) %} {% include class|get_template with context %} {% endif %} {% endfor %} @@ -72,7 +72,7 @@ {% 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 not function.is_alias or function.is_explicitely_exported or function.inherited %} + {% if members_list is none and function.is_public(check_name=False) %} {% include function|get_template with context %} {% endif %} {% endif %} @@ -94,7 +94,7 @@ {% endif %} {% with heading_level = heading_level + extra_level %} {% for module in modules|order_members(config.members_order.alphabetical, members_list) %} - {% if not module.is_alias or module.is_explicitely_exported or module.inherited %} + {% if members_list is none and module.is_public(check_name=False) %} {% include module|get_template with context %} {% endif %} {% endfor %} @@ -119,7 +119,7 @@ {% if not (obj.is_class and child.name == "__init__" and config.merge_init_into_class) %} - {% if not child.is_alias or child.is_explicitely_exported or child.inherited %} + {% if members_list is none and child.is_public(check_name=False) %} {% if child.is_attribute %} {% with attribute = child %} {% include attribute|get_template with context %}