{{ log.debug("Rendering parameters section") }}

{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
  {% block table_style scoped %}
  <p><strong>{{ section.title or lang.t("Parameters:") }}</strong></p>
  <table>
    <thead>
      <tr>
        <th>{{ lang.t("Name") }}</th>
        <th>{{ lang.t("Type") }}</th>
        <th>{{ lang.t("Description") }}</th>
        <th>{{ lang.t("Default") }}</th>
      </tr>
    </thead>
    <tbody>
      {% for parameter in section.value %}
        <tr>
          <td><code>{{ parameter.name }}</code></td>
          <td>
            {% if parameter.annotation %}
              {% with expression = parameter.annotation %}
                <code>{% include "expression.html" with context %}</code>
              {% endwith %}
            {% endif %}
          </td>
          <td>
            <div class="doc-md-description">
              {{ parameter.description|convert_markdown(heading_level, html_id) }}
            </div>
          </td>
          <td>
            {% if parameter.default %}
              {% with expression = parameter.default %}
                <code>{% include "expression.html" with context %}</code>
              {% endwith %}
            {% else %}
              <em>{{ lang.t("required") }}</em>
            {% endif %}
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
  {% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
  {% block list_style scoped %}
  <p class="doc-section-head">{{ section.title or lang.t("Parameters:") }}</p>
  <ul>
    {% for parameter in section.value %}
      <li class="field-body">
        <b><code>{{ parameter.name }}</code></b>
        {% if parameter.annotation %}
          {% with expression = parameter.annotation %}
            (<code>{% include "expression.html" with context %}</code>
            {%- if parameter.default %}, {{ lang.t("default:") }}
              {% with expression = parameter.default %}
                <code>{% include "expression.html" with context %}</code>
              {% endwith %}
            {% endif %})
          {% endwith %}
        {% endif %}
        –
        <div class="doc-md-description">
          {{ parameter.description|convert_markdown(heading_level, html_id) }}
        </div>
      </li>
    {% endfor %}
  </ul>
  {% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
  {% block spacy_style scoped %}
  <p class="doc-section-head">{{ section.title or lang.t("Parameters:") }}</p>
  <dl class="doc-field-list">
    {% for parameter in section.value %}
    <dt class="doc-field-term"><code>{{ parameter.name }}</code></dt>
    <dd class="doc-field-def">
      <div class="doc-md-description">
        {{ parameter.description|convert_markdown(heading_level, html_id) }}
      </div>
      {% if parameter.annotation %}<p class="doc-param-annotation">
        <span class="doc-param-key">{{ lang.t("TYPE:") }}</span>
        {% with expression = parameter.annotation %}
          <code>{% include "expression.html" with context %}</code>
        {% endwith %}
      </p>{% endif %}
      {% if parameter.default %}<p class="doc-param-default">
        <span class="doc-param-key">{{ lang.t("DEFAULT:") }}</span>
        {% with expression = parameter.default %}
          <code>{% include "expression.html" with context %}</code>
        {% endwith %}
      </p>{% endif %}
    </dd>
  {% endfor %}
  </dl>
  {% endblock spacy_style %}
{% endif %}
