diff --git a/src/ansys_sphinx_theme/__init__.py b/src/ansys_sphinx_theme/__init__.py index b8869cf9..af91067f 100644 --- a/src/ansys_sphinx_theme/__init__.py +++ b/src/ansys_sphinx_theme/__init__.py @@ -11,7 +11,7 @@ from ansys_sphinx_theme.extension.linkcode import DOMAIN_KEYS, sphinx_linkcode_resolve from ansys_sphinx_theme.latex import generate_404 # noqa: F401 -__version__ = "0.11.1" +__version__ = "0.11.2" # Declare the fundamental paths of the theme diff --git a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/_templates/autoapi/python/module.rst b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/_templates/autoapi/python/module.rst index 9aa214f6..d068ed85 100644 --- a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/_templates/autoapi/python/module.rst +++ b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/_templates/autoapi/python/module.rst @@ -79,10 +79,23 @@ Summary {% set visible_interfaces = [] %} {% set visible_enums = [] %} {% for element in visible_classes_and_interfaces %} - {% if element.name.startswith("I") and element.name[1].isupper() and ("enum.Enum" not in element.bases) %} - {% set _ = visible_interfaces.append(element) %} - {% elif "enum.Enum" in element.bases %} + + {# + HACK: there is not built-in "startswith" test, no "break" statement, and + no limited scope for variables inside blocks, see: + https://stackoverflow.com/questions/4870346/can-a-jinja-variables-scope-extend-beyond-in-an-inner-block + #} + {% set has_enum_base = [] %} + {% for base in element.bases %} + {% if base.startswith("enum.") %} + {% set _ = has_enum_base.append(true) %} + {% endif %} + {% endfor %} + + {% if has_enum_base %} {% set _ = visible_enums.append(element) %} + {% elif element.name.startswith("I") and element.name[1].isupper() and not has_enum_base %} + {% set _ = visible_interfaces.append(element) %} {% else %} {% set _ = visible_classes.append(element) %} {% endif %}