{#- Template for Python classes. This template renders a Python class. Context: class (griffe.Class): The class to render. root (bool): Whether this is the root object, injected with `:::` in a Markdown page. heading_level (int): The HTML heading level to use. config (dict): The configuration options. -#} {% block logs scoped %} {#- Logging block. This block can be used to log debug messages, deprecation messages, warnings, etc. -#} {{ log.debug("Rendering " + class.path) }} {% endblock logs %}
'|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else class.name),
) %}
{% block heading scoped %}
{#- Heading block.
This block renders the heading for the class.
-#}
{% if config.show_symbol_type_heading %}{% endif %}
{% if config.separate_signature %}
{{ config.heading if config.heading and root else class_name }}
{% elif config.merge_init_into_class and "__init__" in all_members %}
{% with function = all_members["__init__"] %}
{%+ filter highlight(language="python", inline=True) -%}
{#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
{{ class_name }}{% include "signature"|get_template with context %}
{%- endfilter %}
{% endwith %}
{% else %}
{{ class_name }}
{% endif %}
{% endblock heading %}
{% block labels scoped %}
{#- Labels block.
This block renders the labels for the class.
-#}
{% with labels = class.labels %}
{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
{% include "labels"|get_template with context %}
{% endwith %}
{% endblock labels %}
{% endfilter %}
{% block signature scoped %}
{#- Signature block.
This block renders the signature for the class.
Overloads of the `__init__` method are rendered if `merge_init_into_class` is enabled.
The actual `__init__` method signature is only rendered if `separate_signature` is also enabled.
-#}
{% if config.merge_init_into_class %}
{% if "__init__" in all_members %}
{% with function = all_members["__init__"] %}
{% if function.overloads and config.show_overloads %}
'|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else class.name),
hidden=True,
) %}
{% endfilter %}
{% endif %}
{% set heading_level = heading_level - 1 %}
{% endif %}
Bases: {% for expression in class.bases -%}
{%- with backlink_type = "subclassed-by" -%}
{#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
{%- include "expression"|get_template with context -%}
{%- endwith -%}
{% if not loop.last %}, {% endif %}
{% endfor -%}
{%- if init.relative_filepath.is_absolute() -%}
{{ init.relative_package_filepath }}
{%- else -%}
{{ init.relative_filepath }}
{%- endif -%}
{%- if class.relative_filepath.is_absolute() -%}
{{ class.relative_package_filepath }}
{%- else -%}
{{ class.relative_filepath }}
{%- endif -%}