{% extends "frame.html.jinja2" %} {% block title %}{{ module.modulename }} API documentation{% endblock %} {% block nav %} {% block module_list_link %} {% set parentmodule = ".".join(module.modulename.split(".")[:-1]) %} {% if parentmodule and parentmodule in all_modules %} {% include "resources/box-arrow-in-left.svg" %}   {{- parentmodule -}} {% elif not root_module_name %} {% include "resources/box-arrow-in-left.svg" %}   Module Index {% endif %} {% endblock %} {% block nav_title %} {% if logo %} {% if logo_link %}{% endif %} {% if logo_link %}{% endif %} {% endif %} {% endblock %} {% if module.members %}

API Documentation

{% endif %} {% block search_box %} {% if search and all_modules|length > 1 %} {# we set a pattern here so that we can use the :valid CSS selector #} {% endif %}
{% endblock %} {% set index = module.docstring | to_markdown | to_html | attr("toc_html") %} {% if index %}

Contents

{{ index | safe }} {% endif %} {% if module.submodules %}

Submodules

{% endif %} {% if module.members %}
{{ nav_members(module.members.values()) }} {% endif %} {% block nav_footer %} {% if footer_text %} {% endif %} {% endblock %} {% block attribution %} built with pdocpdoc logo {% endblock %} {% endblock nav %} {% block content %}
{% block module_info %}
{% block edit_button %} {% if edit_url %} {% if "github.com" in edit_url %} {% set edit_text = "Edit on GitHub" %} {% elif "gitlab" in edit_url %} {% set edit_text = "Edit on GitLab" %} {% else %} {% set edit_text = "Edit Source" %} {% endif %} {{ edit_text }} {% endif %} {% endblock %} {{ module_name() }} {{ docstring(module) }} {{ view_source_state(module) }} {{ view_source_button(module) }} {{ view_source_code(module) }}
{% endblock %} {% block module_contents %} {% for m in module.flattened_own_members if is_public(m) | trim %}
{{ member(m) }} {% if m.kind == "class" %} {% for m in m.own_members if m.kind != "class" and is_public(m) | trim %}
{{ member(m) }}
{% endfor %} {% if "shapes" not in module_name() %} {% set inherited_members = inherited(m) | trim %} {% if inherited_members %}
Inherited Members
{{ inherited_members }}
{% endif %} {% endif %} {% endif %}
{% endfor %} {% endblock %}
{% if mtime %} {% include "livereload.html.jinja2" %} {% endif %} {% block search_js %} {% if search and all_modules|length > 1 %} {% include "search.html.jinja2" %} {% endif %} {% endblock %} {% endblock content %} {# End of content, beginning of helper macros. See https://pdoc.dev/docs/pdoc/render_helpers.html#DefaultMacroExtension for an explanation of defaultmacro. #} {% defaultmacro bases(cls) %} {%- if cls.bases -%} ( {%- for base in cls.bases -%} {{ base[:2] | link(text=base[2]) }} {%- if loop.nextitem %}, {% endif %} {%- endfor -%} ) {%- endif -%} {% enddefaultmacro %} {% defaultmacro default_value(var) -%} {%- if var.default_value_str -%} {{ var.default_value_str | escape | linkify }} {%- endif -%} {% enddefaultmacro %} {% defaultmacro annotation(var) %} {%- if var.annotation_str -%} {{ var.annotation_str | escape | linkify }} {%- endif -%} {% enddefaultmacro %} {% defaultmacro decorators(doc) %} {% for d in doc.decorators if not d.startswith("@_") %}
{{ d }}
{% endfor %} {% enddefaultmacro %} {% defaultmacro function(fn) -%} {{ decorators(fn) }} {% if fn.name == "__init__" %} {{ ".".join(fn.qualname.split(".")[:-1]) }} {{- fn.signature_without_self | format_signature(colon=False) | linkify }} {% else %} {{ fn.funcdef }} {{ fn.name }} {{- fn.signature | format_signature(colon=True) | linkify }} {% endif %} {% enddefaultmacro %} {% defaultmacro variable(var) -%} {{ var.name }}{{ annotation(var) }}{{ default_value(var) }} {% enddefaultmacro %} {% defaultmacro submodule(mod) -%} {{ mod.taken_from | link }} {% enddefaultmacro %} {% defaultmacro class(cls) -%} {{ decorators(cls) }} class {{ cls.qualname }} {{- bases(cls) -}}: {% enddefaultmacro %} {% defaultmacro member(doc) %} {{- view_source_state(doc) -}}
{% if doc.kind == "class" %} {{ class(doc) }} {% elif doc.kind == "function" %} {{ function(doc) }} {% elif doc.kind == "module" %} {{ submodule(doc) }} {% else %} {{ variable(doc) }} {% endif %} {{ view_source_button(doc) }}
{{ view_source_code(doc) }} {{ docstring(doc) }} {% enddefaultmacro %} {% defaultmacro docstring(var) %} {% if var.docstring %}
{{ var.docstring | to_markdown | to_html | linkify(namespace=var.qualname) }}
{% endif %} {% enddefaultmacro %} {% defaultmacro nav_members(members) %} {% enddefaultmacro %} {% defaultmacro is_public(doc) %} {# This macro is a bit unconventional in that its output is not rendered, but treated as a boolean: Returning no text is interpreted as false, returning any other text is iterpreted as true. Implementing this as a macro makes it very easy to override with a custom template, see https://github.com/mitmproxy/pdoc/tree/main/examples/custom-template. #} {% if doc.name == "__init__" %} {# show all constructors #} true {% elif doc.name == "__doc__" %} {# We don't want to document __doc__ itself, https://github.com/mitmproxy/pdoc/issues/235 #} {% elif doc.kind == "module" and doc.fullname not in all_modules %} {# Skip modules that were manually excluded, https://github.com/mitmproxy/pdoc/issues/334 #} {% elif (doc.qualname or doc.name) is in(module.obj.__all__ or []) %} {# members starting with an underscore are still public if mentioned in __all__ #} true {% elif not doc.name.startswith("_") and (doc.kind != "variable" or doc.is_enum_member or doc.docstring) %} {# members not starting with an underscore are considered public by default #} true {% endif %} {% enddefaultmacro %} {# fmt: off #} {% defaultmacro inherited(cls) %} {% for base, members in cls.inherited_members.items() %} {% set m = None %}{# workaround for https://github.com/pallets/jinja/issues/1427 #} {% set member_html %} {% for m in members if is_public(m) | trim %}
{{- m.taken_from | link(text=m.name.replace("__init__",base[1])) -}}
{% endfor %} {% endset %} {# we may not have any public members, in which case we don't want to print anything. #} {% if member_html and "vtkmodules" not in base | link %}
{{ base | link }}
{{ member_html }}
{% endif %} {% endfor %} {% enddefaultmacro %} {# fmt: on #} {% defaultmacro view_source_state(doc) %} {% if show_source and doc.source %} {% endif %} {% enddefaultmacro %} {% defaultmacro view_source_button(doc) %} {% if show_source and doc.source %} {% endif %} {% enddefaultmacro %} {% defaultmacro view_source_code(doc) %} {% if show_source and doc.source %} {{ doc | highlight }} {% endif %} {% enddefaultmacro %} {% defaultmacro module_name() %}

{% set parts = module.modulename.split(".") %} {% for part in parts %} {%- set fullname = ".".join(parts[:loop.index]) -%} {%- if fullname in all_modules and fullname != module.modulename -%} {{ part }} {%- else -%} {{ part }} {%- endif -%} {%- if loop.nextitem -%} . {%- endif -%} {% endfor %}

{% enddefaultmacro %}