diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja
index fd537034..11bc4e77 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja
@@ -1,4 +1,20 @@
+{#- Template for Python attributes.
+
+This template renders a Python attribute (or variable).
+This can be a module attribute or a class attribute.
+
+Context:
+ attribute (griffe.dataclasses.Attribute): The attribute 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 " + attribute.path) }}
{% endblock logs %}
@@ -27,6 +43,10 @@
) %}
{% block heading scoped %}
+ {#- Heading block.
+
+ This block renders the heading for the attribute.
+ -#}
{% if config.show_symbol_type_heading %}{% endif %}
{% if config.separate_signature %}
{{ attribute_name }}
@@ -39,6 +59,10 @@
{% endblock heading %}
{% block labels scoped %}
+ {#- Labels block.
+
+ This block renders the labels for the attribute.
+ -#}
{% with labels = attribute.labels %}
{% include "labels"|get_template with context %}
{% endwith %}
@@ -47,6 +71,10 @@
{% endfilter %}
{% block signature scoped %}
+ {#- Signature block.
+
+ This block renders the signature for the attribute.
+ -#}
{% if config.separate_signature %}
{% filter format_attribute(attribute, config.line_length, crossrefs=config.signature_crossrefs) %}
{{ attribute.name }}
@@ -70,7 +98,17 @@
{% endif %}
{% if config.separate_signature %}
{{ class_name }}
@@ -42,6 +61,10 @@
{% endblock heading %}
{% block labels scoped %}
+ {#- Labels block.
+
+ This block renders the labels for the class.
+ -#}
{% with labels = class.labels %}
{% include "labels"|get_template with context %}
{% endwith %}
@@ -50,6 +73,10 @@
{% 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__"] %}
@@ -76,7 +103,17 @@
Bases: {% for expression in class.bases -%} @@ -87,6 +124,10 @@ {% endblock bases %} {% block docstring scoped %} + {#- Docstring block. + + This block renders the docstring for the class. + -#} {% with docstring_sections = class.docstring.parsed %} {% include "docstring"|get_template with context %} {% endwith %} @@ -100,6 +141,10 @@ {% endblock docstring %} {% block source scoped %} + {#- Source block. + + This block renders the source code for the class. + -#} {% if config.show_source %} {% if config.merge_init_into_class %} {% if "__init__" in class.all_members and class.all_members["__init__"].source %} @@ -132,6 +177,10 @@ {% endblock source %} {% block children scoped %} + {#- Children block. + + This block renders the children (members) of the class. + -#} {% set root = False %} {% set heading_level = heading_level + 1 %} {% include "children"|get_template with context %} @@ -140,5 +189,4 @@
{{ section.title or lang.t("Attributes:") }}