{#- Minimally patched from upstream mkdocstrings-python: material/_base/function.html.jinja Our deviations from upstream are marked with `CHANGE relative to upstream` comments below: - prefix each signature (and overload) with a `def ` keyword - drop the `first` CSS class (better formatting for the common API index) Re-derive from the installed upstream template when bumping mkdocstrings, re-applying those changes. -#} {% block logs scoped %} {{ log.debug("Rendering " + function.path) }} {% endblock logs %} {% import "language"|get_template as lang with context %}
')|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else function.name),
) %}
{% block heading scoped %}
{% if config.show_symbol_type_heading %}{% endif %}
{% if config.heading and root %}
{{ config.heading }}
{% elif config.separate_signature %}
{{ function_name }}
{% else %}
{%+ filter highlight(language="python", inline=True) -%}
{{ function_name }}{% include "signature"|get_template with context %}
{%- endfilter %}
{% endif %}
{% endblock heading %}
{% block labels scoped %}
{% with labels = function.labels %}
{% include "labels"|get_template with context %}
{% endwith %}
{% endblock labels %}
{% endfilter %}
{% block signature scoped %}
{% if function.overloads and config.show_overloads %}
{# CHANGE relative to upstream: prefix each signature with a `def ` keyword. #}
{# `format_signature` deliberately omits it, but we prefer the fuller form. #}
{# It always emits the function name as the first `nf` span, so inject before that. #}
')|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else function.name),
hidden=True,
) %}
{% endfilter %}
{% endif %}
{% set heading_level = heading_level - 1 %}
{% endif %}
{# CHANGE relative to upstream: don't apply the 'first' class. It causes worse CSS #}
{# formatting for our generated common API index, since we inline bare functions #}
{# that become root-level rather than modules. #}
{%- if function.relative_filepath.is_absolute() -%}
{{ function.relative_package_filepath }}
{%- else -%}
{{ function.relative_filepath }}
{%- endif -%}