{#- Template for "Yields" sections in docstrings. This template renders a list of documented yielded values (generators) in the format specified with the [`docstring_section_style`][] configuration option. Context: section (griffe.DocstringSectionAttributes): The section to render. -#} {% block logs scoped %} {#- Logging block. This block can be used to log debug messages, deprecation messages, warnings, etc. -#} {{ log.debug("Rendering yields section") }} {% endblock logs %} {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #} {% import "language"|get_template as lang with context %} {#- Language module providing the `t` translation method. -#} {% if config.docstring_section_style == "table" %} {% block table_style scoped %} {#- Block for the `table` section style. -#} {% set name_column = section.value|selectattr("name")|any %}
{{ section.title or lang.t("Yields:") }}
| {{ lang.t("Name") }} | {% endif %}{{ lang.t("Type") }} | {{ lang.t("Description") }} |
|---|---|---|
{% if yields.name %}{{ yields.name }}{% endif %} | {% endif %}
{% if yields.annotation %}
{% with expression = yields.annotation, backlink_type = "yielded-by" %}
{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
{% include "expression"|get_template with context %}
{% endwith %}
{% endif %}
|
{{ yields.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
|
{{ section.title or lang.t("Yields:") }}
{{ yields.name }}{% endif %}
{% if yields.annotation %}
{% with expression = yields.annotation, backlink_type = "yielded-by" %}
{% if yields.name %} ({% endif %}
{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
{% include "expression"|get_template with context %}
{% if yields.name %}){% endif %}
{% endwith %}
{% endif %}
–
| {{ (section.title or lang.t("YIELDS")).rstrip(":").upper() }} | {{ lang.t("DESCRIPTION") }} |
|---|---|
{% if yields.name %}
{{ yields.name }}
{% elif yields.annotation %}
{% with expression = yields.annotation, backlink_type = "yielded-by" %}
{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
{% include "expression"|get_template with context %}
{% endwith %}
{% endif %}
|
{{ yields.description|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
{% if yields.name and yields.annotation %}
{{ lang.t("TYPE:") }}:
{% with expression = yields.annotation, backlink_type = "yielded-by" %}
{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
|