{#- 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 '') + 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 %}
{{ class_name }}
{% elif config.merge_init_into_class and "__init__" in class.all_members %}
{% with function = class.all_members["__init__"] %}
{%+ filter highlight(language="python", inline=True) %}
{{ class_name }}{% include "signature.html.jinja" 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 %}
{% include "labels.html.jinja" with context %}
{% endwith %}
{% endblock labels %}
{% endfilter %}
{% block signature scoped %}
{#- Signature block.
This block renders the signature for the class.
-#}
{% if config.separate_signature and config.merge_init_into_class %}
{% if "__init__" in class.all_members %}
{% with function = class.all_members["__init__"] %}
{% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %}
{{ class.name }}
{% endfilter %}
{% endwith %}
{% endif %}
{% endif %}
{% endblock signature %}
{% else %}
{% if config.show_root_toc_entry %}
{% filter heading(heading_level,
role="class",
id=html_id,
toc_label=(' '|safe if config.show_symbol_type_toc else '') + class.name,
hidden=True,
) %}
{% endfilter %}
{% endif %}
{% set heading_level = heading_level - 1 %}
{% endif %}
Bases: {% for expression in class.bases -%}
{% include "expression.html.jinja" with context %}{% if not loop.last %}, {% endif %}
{% endfor -%}
{{ init|source_location }}{{ class|source_location }}