{{ log.debug("Rendering yields section") }}
{% if config.docstring_section_style == "table" %}
  {% block table_style %}
  {% set name_column = section.value|selectattr("name")|any %}
  <p><strong>{{ section.title or "Yields:" }}</strong></p>
  <table>
    <thead>
      <tr>
        {% if name_column %}<th>Name</th>{% endif %}
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      {% for yields in section.value %}
        <tr>
          {% if name_column %}<td>{% if yields.name %}<code>{{ yields.name }}</code>{% endif %}</td>{% endif %}
          <td>
            {% if yields.annotation %}
              {% with expression = yields.annotation %}
                <code>{% include "expression.html" with context %}</code>
              {% endwith %}
            {% endif %}
          </td>
          <td>{{ yields.description|convert_markdown(heading_level, html_id) }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
  {% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
  {% block list_style %}
  <p>{{ section.title or "Yields:" }}</p>
  <ul>
    {% for yields in section.value %}
      <li class="field-body">
        {% if yields.name %}<b>{{ yields.name }}</b>{% endif %}
        {% if yields.annotation %}
          {% with expression = yields.annotation %}
            {% if yields.name %}({% endif %}
            <code>{% include "expression.html" with context %}</code>
            {% if yields.name %}){% endif %}
          {% endwith %}
        {% endif %}
        – {{ yields.description|convert_markdown(heading_level, html_id) }}
      </li>
    {% endfor %}
  </ul>
  {% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
  {% block spacy_style %}
  <table>
    <thead>
      <tr>
        <th><b>{{ (section.title or "YIELDS").rstrip(":").upper() }}</b></th>
        <th><b>DESCRIPTION</b></th>
      </tr>
    </thead>
    <tbody>
      {% for yields in section.value %}
        <tr>
          <td>
            {% if yields.name %}
              <code>{{ yields.name }}</code>
            {% elif yields.annotation %}
              <span class="doc-yields-annotation">
                {% with expression = yields.annotation %}
                  <code>{% include "expression.html" with context %}</code>
                {% endwith %}
              </span>
            {% endif %}
          </td>
          <td class="doc-yields-details">
            {{ yields.description|convert_markdown(heading_level, html_id) }}
            {% if yields.name and yields.annotation %}
              <p>
                <span class="doc-yields-annotation">
                  <b>TYPE:</b>
                  {% with expression = yields.annotation %}
                    <code>{% include "expression.html" with context %}</code>
                  {% endwith %}
                </span>
              </p>
            {% endif %}
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
  {% endblock spacy_style %}
{% endif %}