rerun_py/docs/templates/python/material/function.html
{# Very minimally patched from: https://github.com/mkdocstrings/python/blob/b0123719ae90cb2d47e9b923166ac69fdce86632/src/mkdocstrings\_handlers/python/templates/material/\_base/function.html See: CHANGE comments below #} {{ log.debug("Rendering " + function.path) }}
{% with html_id = function.path %} {% if root %} {% set show_full_path = config.show_root_full_path %} {% set root_members = True %} {% elif root_members %} {% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %} {% set root_members = False %} {% else %} {% set show_full_path = config.show_object_full_path %} {% endif %} {% if not root or config.show_root_heading %} {% filter heading(heading_level, role="function", id=html_id, class="doc doc-heading", toc_label=function.name ~ "()") %} {% if config.separate_signature %} {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %} {% else %} {% filter highlight(language="python", inline=True) %} {# CHANGE: Insert def before function for better highlighting #} def {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %} {% include "signature.html" with context %} {% endfilter %} {% endif %} {% with labels = function.labels %} {% include "labels.html" with context %} {% endwith %} {% endfilter %} {% if config.separate_signature %} {% filter highlight(language="python", inline=False) %} {# CHANGE: Insert def before function for better highlighting #} def {% filter format_signature(config.line_length) %} {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %} {% include "signature.html" with context %} {% endfilter %} {% endfilter %} {% endif %} {% else %} {% if config.show_root_toc_entry %} {% filter heading(heading_level, role="function", id=html_id, toc_label=function.path if config.show_root_full_path else function.name, hidden=True) %} {% endfilter %} {% endif %} {% set heading_level = heading_level - 1 %} {% endif %} {# CHANGE Relative to Upstream: don't apply the 'first' class since it causes worse CSS formatting for our #} {# generated common API index since we inline bare functions that become root-level rather than modules. #} {#
#}
{% with docstring_sections = function.docstring.parsed %} {% include "docstring.html" with context %} {% endwith %} {% if config.show_source and function.source %} #Source code in {{ function.relative_filepath }} {{ function.source|highlight(language="python", linestart=function.lineno, linenums=True) }} {% endif %}
{% endwith %}