{% extends "base.html" %} {#- Docstring sections (Args, Returns, Raises, ...) taken out of a docstring: see `docstring::DocSections`. Descriptions are already rendered HTML. -#} {% component doc_items(title, items) %}

{{ title }}

{% endcomponent doc_items %} {% component doc_sections(s) %}
{%- if s.params %}{{ }}{% endif %} {%- if s.keyword_params %}{{ }}{% endif %} {%- if s.other_params %}{{ }}{% endif %} {%- if s.attributes %}{{ }}{% endif %} {%- if s.returns %}{{ }}{% endif %} {%- if s.yields %}{{ }}{% endif %} {%- if s.raises %}{{ }}{% endif %} {%- for block in s.examples %}

Examples

{{ block.html | safe }}
{%- endfor %} {%- for block in s.notes %}{{ block.html | safe }}{% endfor %} {%- for block in s.warnings %}{{ block.html | safe }}{% endfor %} {%- for block in s.see_also %}

See also

{{ block.html | safe }}
{%- endfor %}
{% endcomponent doc_sections %} {#- A class defined inside another class, rendered inside its parent's card. Anchors use the qualified name ("Outer.Inner"). Calls itself for deeper nesting. -#} {% component nested_class(cls, @module, @source_url = "") %}
class {{ cls.qualname }}{% if cls.bases %}({% if cls.linked %}{{ cls.linked.html | safe }}{% else %}{{ cls.bases | join(sep=", ") }}{% endif %}){% endif %}: {% for badge in cls.badges %}{{ badge }}{% endfor %}{% if source_url %}source{% else %}line {{ cls.line }}{% endif %}
{% if cls.docstring %}
{{ cls.docstring | safe }}
{% endif %}{% if cls.sections %}{{ }}{% endif %} {%- if cls.variables %}

Attributes

{%- for var in cls.variables %}
{% if var.is_type_alias %}type {% endif %}{{ var.name }}{% if var.annotation %}: {% if var.linked %}{{ var.linked.html | safe }}{% else %}{{ var.annotation }}{% endif %}{% endif %}{% if var.value %} = {{ var.value }}{% if var.value_truncated %}…{% endif %}{% endif %}{% for badge in var.badges %}{{ badge }}{% endfor %}{% if source_url %}source{% else %}line {{ var.line }}{% endif %}
{% if var.docstring %}
{{ var.docstring | safe }}
{% endif %}
{%- endfor %}
{%- endif %} {%- if cls.functions %}

Methods

{%- for func in cls.functions %}
{% if func.is_async %}async {% endif %}def {{ func.name }}({% if func.linked %}{{ func.linked.html | safe }}{% else %}{{ func.args | join(sep=", ") }}{% endif %}){% if func.return_type %} -> {% if func.linked %}{{ func.linked.return_type | safe }}{% else %}{{ func.return_type }}{% endif %}{% endif %}:{% for badge in func.badges %}{{ badge }}{% endfor %}{% if source_url %}source{% else %}line {{ func.line }}{% endif %}
{% if func.docstring %}
{{ func.docstring | safe }}
{% endif %}{% if func.sections %}{{ }}{% endif %}
{%- endfor %}
{%- endif %} {%- if cls.classes %}

Nested classes

{%- for inner in cls.classes %} {{ }} {%- endfor %}
{%- endif %}
{% endcomponent nested_class %} {#- Outline entries for a nested class and everything inside it. -#} {% component outline_class(cls) %}
  • {{ cls.qualname }} {%- if cls.variables or cls.functions or cls.classes %}{% endif %}
  • {% endcomponent outline_class %} {% block title %}Module {{ display_module_name }} - {{ package.name }}{% endblock title %} {% block description %}{% if module.summary %}{{ module.summary }}{% else %}{{ display_module_name }} - {{ package.name }} documentation{% endif %}{% endblock description %} {% block header %}

    {% if module.name == "__init__" %}Package{% else %}Module{% endif %} {{ display_module_name }}

    {% endblock header %} {% block content %} {% block module_docstring %} {% if module.docstring %}
    {{ module.docstring | safe }}
    {% endif %} {% endblock module_docstring %} {% block variables %} {% if module.variables %}

    Variables

    {#- Cards are kept on one line each: large projects have thousands. -#} {%- for var in module.variables %}
    {% if var.is_type_alias %}type {% endif %}{{ var.name }}{% if var.annotation %}: {% if var.linked %}{{ var.linked.html | safe }}{% else %}{{ var.annotation }}{% endif %}{% endif %}{% if var.value %} = {{ var.value }}{% if var.value_truncated %}…{% endif %}{% endif %}{% for badge in var.badges %}{{ badge }}{% endfor %}{% if source_url %}source{% else %}{{ module.source_path }}:{{ var.line }}{% endif %}
    {% if var.docstring %}
    {{ var.docstring | safe }}
    {% endif %}
    {%- endfor %}
    {% endif %} {% endblock variables %} {% block classes %} {% if module.classes %}

    Classes

    {% for class in module.classes %}
    class {{ class.name }}{% if class.bases %}({% if class.linked %}{{ class.linked.html | safe }}{% else %}{{ class.bases | join(sep=", ") }}{% endif %}){% endif %}: {% for badge in class.badges %}{{ badge }}{% endfor %}{% if source_url %}source{% else %}{{ module.source_path }}:{{ class.line }}{% endif %}
    {% if class.docstring %}
    {{ class.docstring | safe }}
    {% endif %}{% if class.sections %}{{ }}{% endif %} {% if class.variables %}

    Attributes

    {%- for var in class.variables %}
    {% if var.is_type_alias %}type {% endif %}{{ var.name }}{% if var.annotation %}: {% if var.linked %}{{ var.linked.html | safe }}{% else %}{{ var.annotation }}{% endif %}{% endif %}{% if var.value %} = {{ var.value }}{% if var.value_truncated %}…{% endif %}{% endif %}{% for badge in var.badges %}{{ badge }}{% endfor %}{% if source_url %}source{% else %}line {{ var.line }}{% endif %}
    {% if var.docstring %}
    {{ var.docstring | safe }}
    {% endif %}
    {%- endfor %}
    {% endif %} {% if class.functions %}

    Methods

    {% for func in class.functions %}
    {% if func.is_async %}async {% endif %}def {{ func.name }}({% if func.linked %}{{ func.linked.html | safe }}{% else %}{{ func.args | join(sep=", ") }}{% endif %}){% if func.return_type %} -> {% if func.linked %}{{ func.linked.return_type | safe }}{% else %}{{ func.return_type }}{% endif %}{% endif %}: {% for badge in func.badges %}{{ badge }}{% endfor %}{% if source_url %}source{% else %}line {{ func.line }}{% endif %}
    {% if func.docstring %}
    {{ func.docstring | safe }}
    {% endif %}{% if func.sections %}{{ }}{% endif %}
    {% endfor %}
    {% endif %} {% if class.classes %}

    Nested classes

    {%- for inner in class.classes %} {{ }} {%- endfor %}
    {% endif %}
    {% endfor %}
    {% endif %} {% endblock classes %} {% block functions %} {% if module.functions %}

    Functions

    {% for func in module.functions %}
    {% if func.is_async %}async {% endif %}def {{ func.name }}({% if func.linked %}{{ func.linked.html | safe }}{% else %}{{ func.args | join(sep=", ") }}{% endif %}){% if func.return_type %} -> {% if func.linked %}{{ func.linked.return_type | safe }}{% else %}{{ func.return_type }}{% endif %}{% endif %}: {% for badge in func.badges %}{{ badge }}{% endfor %}{% if source_url %}source{% else %}{{ module.source_path }}:{{ func.line }}{% endif %}
    {% if func.docstring %}
    {{ func.docstring | safe }}
    {% endif %}{% if func.sections %}{{ }}{% endif %}
    {% endfor %}
    {% endif %} {% endblock functions %} {% endblock content %} {% block outline %} {% if module.variables or module.classes or module.functions %} {% endif %} {% endblock outline %}