{% import "macros.html" as ui %} {% include "header.html" %} {% set role = page_role(state, entity) %} {% call ui.section("description", "Description", divider=true) %} {% set texts = other_sections(entity) | selectattr("kind", "equalto", "text") | list %} {% if texts %}
{% for section in texts %}{{ section.text | markdown | safe }}{% endfor %}
{% else %}

No docstring.

{% endif %} {% endcall %} {% call ui.section(role, "Signature", name="signature", divider=true) %} {% if entity.decorators %}

{% for decorator in entity.decorators %}@{{ decorator }}{% endfor %}

{% endif %}
{{ signature(entity) | highlight }}
{% if entity.kind == "class" and entity.bases %}

Bases: {% for base in entity.bases %}{{ base }}{% endfor %}

{% endif %} {% endcall %} {% set rows = parameter_rows(entity) %} {% if rows %} {% call ui.section(role, "Parameters", count=rows | length, name="parameters", divider=true) %} {% for row in rows %} {% endfor %}
NameTypeDefaultDescription
{{ row.name }} {% if row.annotation %}{{ row.annotation }}{% else %}-{% endif %} {% if row.default %}{{ row.default }}{% else %}-{% endif %} {% if row.description %}{{ row.description | markdown | safe }}{% else %}-{% endif %}
{% endcall %} {% endif %} {% set documented = other_sections(entity) | rejectattr("kind", "equalto", "text") | list %} {% if entity.kind == "function" and entity.returns and not documented | selectattr("kind", "equalto", "returns") | list %} {% call ui.section("returns", "Returns", divider=true) %}

{{ entity.returns }}

{% endcall %} {% endif %} {% for section in documented %} {% set count = section["items"] | length %} {% call ui.section(section.kind, section.title or section.kind, count=count if count > 1 else none, divider=true) %} {% if section.text %}{{ section.text | markdown | safe }}{% endif %} {% if section["items"] %} {% endif %} {% endcall %} {% endfor %} {% if entity.kind == "class" %} {% with divider = true %}{% include "members.html" %}{% endwith %} {% endif %} {# Open by default; the code is fetched right after the page is shown, so the page itself stays light. #} {% set source_attrs = 'hx-get="/source/%s" hx-trigger="load" hx-target="find .code"' | format(entity.path | e) %} {% call ui.section("source", "Source", divider=true, attrs=source_attrs) %} {# Changing the theme saves it to doc/config/config.json. #}

Loading…

{% endcall %}