From da02284f96cb9bcd412ca34864c569672b949f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Wed, 24 Apr 2024 14:56:41 +0200 Subject: [PATCH] style: Improve templates indentation --- .../templates/material/_base/attribute.html | 124 ++++----- .../templates/material/_base/children.html | 56 ++--- .../templates/material/_base/class.html | 236 +++++++++--------- .../material/_base/docstring/attributes.html | 148 +++++------ .../material/_base/docstring/classes.html | 102 ++++---- .../material/_base/docstring/functions.html | 116 ++++----- .../material/_base/docstring/modules.html | 102 ++++---- .../_base/docstring/other_parameters.html | 148 +++++------ .../material/_base/docstring/parameters.html | 194 +++++++------- .../material/_base/docstring/raises.html | 134 +++++----- .../material/_base/docstring/receives.html | 166 ++++++------ .../material/_base/docstring/returns.html | 166 ++++++------ .../material/_base/docstring/warns.html | 134 +++++----- .../material/_base/docstring/yields.html | 166 ++++++------ .../templates/material/_base/function.html | 154 ++++++------ .../templates/material/_base/module.html | 118 ++++----- .../templates/material/_base/signature.html | 81 +++--- .../readthedocs/docstring/returns.html | 42 ++-- 18 files changed, 1193 insertions(+), 1194 deletions(-) diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html index 3f1d887e..80a75fc9 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html @@ -1,80 +1,80 @@ {{ log.debug("Rendering " + attribute.path) }}
-{% with obj = attribute, html_id = attribute.path %} + {% with obj = attribute, html_id = attribute.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 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 %} + + {% set attribute_name = attribute.path if show_full_path else attribute.name %} + + {% if not root or config.show_root_heading %} + {% filter heading( + heading_level, + role="data" if attribute.parent.kind.value == "module" else "attr", + id=html_id, + class="doc doc-heading", + toc_label=(' '|safe if config.show_symbol_type_toc else '') + attribute.name, + ) %} - {% set attribute_name = attribute.path if show_full_path else attribute.name %} + {% block heading scoped %} + {% if config.show_symbol_type_heading %}{% endif %} + {% if config.separate_signature %} + {{ attribute_name }} + {% else %} + {%+ filter highlight(language="python", inline=True) %} + {{ attribute_name }}{% if attribute.annotation %}: {{ attribute.annotation }}{% endif %} + {% if attribute.value %} = {{ attribute.value }}{% endif %} + {% endfilter %} + {% endif %} + {% endblock heading %} - {% if not root or config.show_root_heading %} - {% filter heading( - heading_level, - role="data" if attribute.parent.kind.value == "module" else "attr", - id=html_id, - class="doc doc-heading", - toc_label=(' '|safe if config.show_symbol_type_toc else '') + attribute.name, - ) %} + {% block labels scoped %} + {% with labels = attribute.labels %} + {% include "labels.html" with context %} + {% endwith %} + {% endblock labels %} + + {% endfilter %} - {% block heading scoped %} - {% if config.show_symbol_type_heading %}{% endif %} + {% block signature scoped %} {% if config.separate_signature %} - {{ attribute_name }} - {% else %} - {%+ filter highlight(language="python", inline=True) %} - {{ attribute_name }}{% if attribute.annotation %}: {{ attribute.annotation }}{% endif %} - {% if attribute.value %} = {{ attribute.value }}{% endif %} + {% filter format_attribute(attribute, config.line_length, crossrefs=config.signature_crossrefs) %} + {{ attribute.name }} {% endfilter %} {% endif %} - {% endblock heading %} + {% endblock signature %} - {% block labels scoped %} - {% with labels = attribute.labels %} - {% include "labels.html" with context %} - {% endwith %} - {% endblock labels %} + {% else %} - {% endfilter %} - - {% block signature scoped %} - {% if config.separate_signature %} - {% filter format_attribute(attribute, config.line_length, crossrefs=config.signature_crossrefs) %} - {{ attribute.name }} + {% if config.show_root_toc_entry %} + {% filter heading(heading_level, + role="data" if attribute.parent.kind.value == "module" else "attr", + id=html_id, + toc_label=(' '|safe if config.show_symbol_type_toc else '') + attribute.name, + hidden=True, + ) %} {% endfilter %} {% endif %} - {% endblock signature %} - - {% else %} - - {% if config.show_root_toc_entry %} - {% filter heading(heading_level, - role="data" if attribute.parent.kind.value == "module" else "attr", - id=html_id, - toc_label=(' '|safe if config.show_symbol_type_toc else '') + attribute.name, - hidden=True, - ) %} - {% endfilter %} + {% set heading_level = heading_level - 1 %} {% endif %} - {% set heading_level = heading_level - 1 %} - {% endif %} -
- {% block contents scoped %} - {% block docstring scoped %} - {% with docstring_sections = attribute.docstring.parsed %} - {% include "docstring.html" with context %} - {% endwith %} - {% endblock docstring %} - {% endblock contents %} -
+
+ {% block contents scoped %} + {% block docstring scoped %} + {% with docstring_sections = attribute.docstring.parsed %} + {% include "docstring.html" with context %} + {% endwith %} + {% endblock docstring %} + {% endblock contents %} +
-{% endwith %} + {% endwith %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/children.html b/src/mkdocstrings_handlers/python/templates/material/_base/children.html index 25534f70..cd9a8fac 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/children.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/children.html @@ -20,11 +20,11 @@ {% endif %} {% with attributes = obj.attributes|filter_objects( - filters=config.filters, - members_list=members_list, - inherited_members=config.inherited_members, - keep_no_docstrings=config.show_if_no_docstring, - ) %} + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring, + ) %} {% if attributes %} {% if config.show_category_heading %} {% filter heading(heading_level, id=html_id ~ "-attributes") %}Attributes{% endfilter %} @@ -40,11 +40,11 @@ {% endwith %} {% with classes = obj.classes|filter_objects( - filters=config.filters, - members_list=members_list, - inherited_members=config.inherited_members, - keep_no_docstrings=config.show_if_no_docstring, - ) %} + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring, + ) %} {% if classes %} {% if config.show_category_heading %} {% filter heading(heading_level, id=html_id ~ "-classes") %}Classes{% endfilter %} @@ -60,11 +60,11 @@ {% endwith %} {% with functions = obj.functions|filter_objects( - filters=config.filters, - members_list=members_list, - inherited_members=config.inherited_members, - keep_no_docstrings=config.show_if_no_docstring, - ) %} + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring, + ) %} {% if functions %} {% if config.show_category_heading %} {% filter heading(heading_level, id=html_id ~ "-functions") %}Functions{% endfilter %} @@ -83,11 +83,11 @@ {% if config.show_submodules %} {% with modules = obj.modules|filter_objects( - filters=config.filters, - members_list=members_list, - inherited_members=config.inherited_members, - keep_no_docstrings=config.show_if_no_docstring, - ) %} + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring, + ) %} {% if modules %} {% if config.show_category_heading %} {% filter heading(heading_level, id=html_id ~ "-modules") %}Modules{% endfilter %} @@ -108,14 +108,14 @@ {% else %} {% for child in obj.all_members - |filter_objects( - filters=config.filters, - members_list=members_list, - inherited_members=config.inherited_members, - keep_no_docstrings=config.show_if_no_docstring, - ) - |order_members(config.members_order, members_list) - %} + |filter_objects( + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring, + ) + |order_members(config.members_order, members_list) + %} {% if not (obj.is_class and child.name == "__init__" and config.merge_init_into_class) %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html b/src/mkdocstrings_handlers/python/templates/material/_base/class.html index fb7ca764..2934c7c0 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html @@ -1,142 +1,142 @@ {{ log.debug("Rendering " + class.path) }}
-{% with obj = class, html_id = class.path %} + {% with obj = class, html_id = class.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 %} - - {% set class_name = class.path if show_full_path else class.name %} + {% 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="class", - id=html_id, - class="doc doc-heading", - toc_label=(' '|safe if config.show_symbol_type_toc else '') + class.name, - ) %} + {% set class_name = class.path if show_full_path else class.name %} - {% block heading scoped %} - {% if config.show_symbol_type_heading %}{% endif %} - {% if config.separate_signature %} - {{ class_name }} - {% elif config.merge_init_into_class and "__init__" in class.all_members %} - {% with function = class.all_members["__init__"] %} - {%+ filter highlight(language="python", inline=True) %} - {{ class_name }}{% include "signature.html" with context %} - {% endfilter %} - {% endwith %} - {% else %} - {{ class_name }} - {% endif %} - {% endblock heading %} - - {% block labels scoped %} - {% with labels = class.labels %} - {% include "labels.html" with context %} - {% endwith %} - {% endblock labels %} + {% if not root or config.show_root_heading %} + {% filter heading( + heading_level, + role="class", + id=html_id, + class="doc doc-heading", + toc_label=(' '|safe if config.show_symbol_type_toc else '') + class.name, + ) %} - {% endfilter %} + {% block heading scoped %} + {% if config.show_symbol_type_heading %}{% endif %} + {% if config.separate_signature %} + {{ class_name }} + {% elif config.merge_init_into_class and "__init__" in class.all_members %} + {% with function = class.all_members["__init__"] %} + {%+ filter highlight(language="python", inline=True) %} + {{ class_name }}{% include "signature.html" with context %} + {% endfilter %} + {% endwith %} + {% else %} + {{ class_name }} + {% endif %} + {% endblock heading %} - {% block signature scoped %} - {% if config.separate_signature and config.merge_init_into_class %} - {% if "__init__" in class.all_members %} - {% with function = class.all_members["__init__"] %} - {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %} - {{ class.name }} - {% endfilter %} + {% block labels scoped %} + {% with labels = class.labels %} + {% include "labels.html" with context %} {% endwith %} - {% endif %} - {% endif %} - {% endblock signature %} + {% endblock labels %} - {% else %} - {% if config.show_root_toc_entry %} - {% filter heading(heading_level, - role="class", - id=html_id, - toc_label=(' '|safe if config.show_symbol_type_toc else '') + class.name, - hidden=True, - ) %} {% endfilter %} - {% endif %} - {% set heading_level = heading_level - 1 %} - {% endif %} - -
- {% block contents scoped %} - {% block bases scoped %} - {% if config.show_bases and class.bases %} -

- Bases: {% for expression in class.bases -%} - {% include "expression.html" with context %}{% if not loop.last %}, {% endif %} - {% endfor -%} -

- {% endif %} - {% endblock bases %} - {% block docstring scoped %} - {% with docstring_sections = class.docstring.parsed %} - {% include "docstring.html" with context %} - {% endwith %} - {% if config.merge_init_into_class %} - {% if "__init__" in class.all_members and class.all_members["__init__"].has_docstring %} - {% with docstring_sections = class.all_members["__init__"].docstring.parsed %} - {% include "docstring.html" with context %} + {% block signature scoped %} + {% if config.separate_signature and config.merge_init_into_class %} + {% if "__init__" in class.all_members %} + {% with function = class.all_members["__init__"] %} + {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %} + {{ class.name }} + {% endfilter %} {% endwith %} {% endif %} {% endif %} - {% endblock docstring %} + {% endblock signature %} + + {% else %} + {% if config.show_root_toc_entry %} + {% filter heading(heading_level, + role="class", + id=html_id, + toc_label=(' '|safe if config.show_symbol_type_toc else '') + class.name, + hidden=True, + ) %} + {% endfilter %} + {% endif %} + {% set heading_level = heading_level - 1 %} + {% endif %} - {% block source scoped %} - {% if config.show_source %} +
+ {% block contents scoped %} + {% block bases scoped %} + {% if config.show_bases and class.bases %} +

+ Bases: {% for expression in class.bases -%} + {% include "expression.html" with context %}{% if not loop.last %}, {% endif %} + {% endfor -%} +

+ {% endif %} + {% endblock bases %} + + {% block docstring scoped %} + {% with docstring_sections = class.docstring.parsed %} + {% include "docstring.html" with context %} + {% endwith %} {% if config.merge_init_into_class %} - {% if "__init__" in class.all_members and class.all_members["__init__"].source %} - {% with init = class.all_members["__init__"] %} -
- Source code in - {%- if init.relative_filepath.is_absolute() -%} - {{ init.relative_package_filepath }} - {%- else -%} - {{ init.relative_filepath }} - {%- endif -%} - - {{ init.source|highlight(language="python", linestart=init.lineno, linenums=True) }} -
+ {% if "__init__" in class.all_members and class.all_members["__init__"].has_docstring %} + {% with docstring_sections = class.all_members["__init__"].docstring.parsed %} + {% include "docstring.html" with context %} {% endwith %} {% endif %} - {% elif class.source %} -
- Source code in - {%- if class.relative_filepath.is_absolute() -%} - {{ class.relative_package_filepath }} - {%- else -%} - {{ class.relative_filepath }} - {%- endif -%} - - {{ class.source|highlight(language="python", linestart=class.lineno, linenums=True) }} -
{% endif %} - {% endif %} - {% endblock source %} + {% endblock docstring %} + + {% block source scoped %} + {% if config.show_source %} + {% if config.merge_init_into_class %} + {% if "__init__" in class.all_members and class.all_members["__init__"].source %} + {% with init = class.all_members["__init__"] %} +
+ Source code in + {%- if init.relative_filepath.is_absolute() -%} + {{ init.relative_package_filepath }} + {%- else -%} + {{ init.relative_filepath }} + {%- endif -%} + + {{ init.source|highlight(language="python", linestart=init.lineno, linenums=True) }} +
+ {% endwith %} + {% endif %} + {% elif class.source %} +
+ Source code in + {%- if class.relative_filepath.is_absolute() -%} + {{ class.relative_package_filepath }} + {%- else -%} + {{ class.relative_filepath }} + {%- endif -%} + + {{ class.source|highlight(language="python", linestart=class.lineno, linenums=True) }} +
+ {% endif %} + {% endif %} + {% endblock source %} - {% block children scoped %} - {% set root = False %} - {% set heading_level = heading_level + 1 %} - {% include "children.html" with context %} - {% endblock children %} - {% endblock contents %} -
+ {% block children scoped %} + {% set root = False %} + {% set heading_level = heading_level + 1 %} + {% include "children.html" with context %} + {% endblock children %} + {% endblock contents %} +
-{% endwith %} + {% endwith %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html index 771a9eed..99824653 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html @@ -4,87 +4,87 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} -

{{ section.title or lang.t("Attributes:") }}

- - - - - - - - - - {% for attribute in section.value %} - - - - +

{{ section.title or lang.t("Attributes:") }}

+
{{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}
{{ attribute.name }} - {% if attribute.annotation %} - {% with expression = attribute.annotation %} - {% include "expression.html" with context %} - {% endwith %} - {% endif %} - -
- {{ attribute.description|convert_markdown(heading_level, html_id) }} -
-
+ + + + + - {% endfor %} - -
{{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}
+ + + {% for attribute in section.value %} + + {{ attribute.name }} + + {% if attribute.annotation %} + {% with expression = attribute.annotation %} + {% include "expression.html" with context %} + {% endwith %} + {% endif %} + + +
+ {{ attribute.description|convert_markdown(heading_level, html_id) }} +
+ + + {% endfor %} + + {% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

{{ section.title or lang.t("Attributes:") }}

- +

{{ section.title or lang.t("Attributes:") }}

+ {% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} {% block spacy_style scoped %} - - - - - - - - - {% for attribute in section.value %} - - - +
{{ (section.title or lang.t("ATTRIBUTE")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
{{ attribute.name }} -
- {{ attribute.description|convert_markdown(heading_level, html_id) }} -
-

- {% if attribute.annotation %} - - TYPE: - {% with expression = attribute.annotation %} - {% include "expression.html" with context %} - {% endwith %} - - {% endif %} -

-
+ + + + - {% endfor %} - -
{{ (section.title or lang.t("ATTRIBUTE")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
+ + + {% for attribute in section.value %} + + {{ attribute.name }} + +
+ {{ attribute.description|convert_markdown(heading_level, html_id) }} +
+

+ {% if attribute.annotation %} + + TYPE: + {% with expression = attribute.annotation %} + {% include "expression.html" with context %} + {% endwith %} + + {% endif %} +

+ + + {% endfor %} + + {% endblock spacy_style %} {% endif %} \ No newline at end of file diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html index 054cf5af..c0acac8a 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html @@ -4,64 +4,64 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} -

{{ section.title or lang.t("Classes:") }}

- - - - - - - - - {% for class in section.value %} - - - +

{{ section.title or lang.t("Classes:") }}

+
{{ lang.t("Name") }}{{ lang.t("Description") }}
{{ class.name }} -
- {{ class.description|convert_markdown(heading_level, html_id) }} -
-
+ + + + - {% endfor %} - -
{{ lang.t("Name") }}{{ lang.t("Description") }}
+ + + {% for class in section.value %} + + {{ class.name }} + +
+ {{ class.description|convert_markdown(heading_level, html_id) }} +
+ + + {% endfor %} + + {% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

{{ section.title or lang.t("Classes:") }}

- +

{{ section.title or lang.t("Classes:") }}

+ {% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} {% block spacy_style scoped %} - - - - - - - - - {% for class in section.value %} - - - +
{{ (section.title or lang.t("CLASS")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
{{ class.name }} -
- {{ class.description|convert_markdown(heading_level, html_id) }} -
-
+ + + + - {% endfor %} - -
{{ (section.title or lang.t("CLASS")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
+ + + {% for class in section.value %} + + {{ class.name }} + +
+ {{ class.description|convert_markdown(heading_level, html_id) }} +
+ + + {% endfor %} + + {% endblock spacy_style %} {% endif %} \ No newline at end of file diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html index a16917bd..696826f0 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html @@ -4,70 +4,70 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} -

{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}

- - - - - - - - - {% for function in section.value %} - {% if not function.name == "__init__" or not config.merge_init_into_class %} - - - - - {% endif %} - {% endfor %} - -
{{ lang.t("Name") }}{{ lang.t("Description") }}
{{ function.name }} -
- {{ function.description|convert_markdown(heading_level, html_id) }} -
-
+

{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}

+ + + + + + + + + {% for function in section.value %} + {% if not function.name == "__init__" or not config.merge_init_into_class %} + + + + + {% endif %} + {% endfor %} + +
{{ lang.t("Name") }}{{ lang.t("Description") }}
{{ function.name }} +
+ {{ function.description|convert_markdown(heading_level, html_id) }} +
+
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}

- - {% endblock list_style %} -{% elif config.docstring_section_style == "spacy" %} - {% block spacy_style scoped %} - - - - - - - - +

{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}

+ - - - +
  • + {{ function.name }} + – +
    + {{ function.description|convert_markdown(heading_level, html_id) }} +
    +
  • {% endif %} {% endfor %} - -
    {{ (section.title or lang.t("METHOD") if obj.is_class else lang.t("FUNCTION")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    {{ function.name }} -
    - {{ function.description|convert_markdown(heading_level, html_id) }} -
    -
    + + {% endblock list_style %} +{% elif config.docstring_section_style == "spacy" %} + {% block spacy_style scoped %} + + + + + + + + + {% for function in section.value %} + {% if not function.name == "__init__" or not config.merge_init_into_class %} + + + + + {% endif %} + {% endfor %} + +
    {{ (section.title or lang.t("METHOD") if obj.is_class else lang.t("FUNCTION")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    {{ function.name }} +
    + {{ function.description|convert_markdown(heading_level, html_id) }} +
    +
    {% endblock spacy_style %} {% endif %} \ No newline at end of file diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html index 26b38257..d5ea77e6 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html @@ -4,64 +4,64 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} -

    {{ section.title or lang.t("Modules:") }}

    - - - - - - - - - {% for module in section.value %} - - - +

    {{ section.title or lang.t("Modules:") }}

    +
    {{ lang.t("Name") }}{{ lang.t("Description") }}
    {{ module.name }} -
    - {{ module.description|convert_markdown(heading_level, html_id) }} -
    -
    + + + + - {% endfor %} - -
    {{ lang.t("Name") }}{{ lang.t("Description") }}
    + + + {% for module in section.value %} + + {{ module.name }} + +
    + {{ module.description|convert_markdown(heading_level, html_id) }} +
    + + + {% endfor %} + + {% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

    {{ section.title or lang.t("Modules:") }}

    - +

    {{ section.title or lang.t("Modules:") }}

    + {% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} {% block spacy_style scoped %} - - - - - - - - - {% for module in section.value %} - - - +
    {{ (section.title or lang.t("MODULE")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    {{ module.name }} -
    - {{ module.description|convert_markdown(heading_level, html_id) }} -
    -
    + + + + - {% endfor %} - -
    {{ (section.title or lang.t("MODULE")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    + + + {% for module in section.value %} + + {{ module.name }} + +
    + {{ module.description|convert_markdown(heading_level, html_id) }} +
    + + + {% endfor %} + + {% endblock spacy_style %} {% endif %} \ No newline at end of file diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html index f31836a8..17d6d355 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html @@ -4,87 +4,87 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} -

    {{ section.title or lang.t("Other Parameters:") }}

    - - - - - - - - - - {% for parameter in section.value %} - - - - +

    {{ section.title or lang.t("Other Parameters:") }}

    +
    {{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}
    {{ parameter.name }} - {% if parameter.annotation %} - {% with expression = parameter.annotation %} - {% include "expression.html" with context %} - {% endwith %} - {% endif %} - -
    - {{ parameter.description|convert_markdown(heading_level, html_id) }} -
    -
    + + + + + - {% endfor %} - -
    {{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}
    + + + {% for parameter in section.value %} + + {{ parameter.name }} + + {% if parameter.annotation %} + {% with expression = parameter.annotation %} + {% include "expression.html" with context %} + {% endwith %} + {% endif %} + + +
    + {{ parameter.description|convert_markdown(heading_level, html_id) }} +
    + + + {% endfor %} + + {% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

    {{ section.title or lang.t("Other Parameters:") }}

    - +

    {{ section.title or lang.t("Other Parameters:") }}

    + {% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} {% block spacy_style scoped %} - - - - - - - - - {% for parameter in section.value %} - - - +
    {{ (section.title or lang.t("PARAMETER")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    {{ parameter.name }} -
    - {{ parameter.description|convert_markdown(heading_level, html_id) }} -
    -

    - {% if parameter.annotation %} - - {{ lang.t("TYPE:") }} - {% with expression = parameter.annotation %} - {% include "expression.html" with context %} - {% endwith %} - - {% endif %} -

    -
    + + + + - {% endfor %} - -
    {{ (section.title or lang.t("PARAMETER")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    + + + {% for parameter in section.value %} + + {{ parameter.name }} + +
    + {{ parameter.description|convert_markdown(heading_level, html_id) }} +
    +

    + {% if parameter.annotation %} + + {{ lang.t("TYPE:") }} + {% with expression = parameter.annotation %} + {% include "expression.html" with context %} + {% endwith %} + + {% endif %} +

    + + + {% endfor %} + + {% endblock spacy_style %} {% endif %} \ No newline at end of file diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html index 05bdadee..7980096d 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html @@ -4,110 +4,110 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} -

    {{ section.title or lang.t("Parameters:") }}

    - - - - - - - - - - - {% for parameter in section.value %} - - - - - +

    {{ section.title or lang.t("Parameters:") }}

    +
    {{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}{{ lang.t("Default") }}
    {{ parameter.name }} - {% if parameter.annotation %} - {% with expression = parameter.annotation %} - {% include "expression.html" with context %} - {% endwith %} - {% endif %} - -
    - {{ parameter.description|convert_markdown(heading_level, html_id) }} -
    -
    - {% if parameter.default %} - {% with expression = parameter.default %} - {% include "expression.html" with context %} - {% endwith %} - {% else %} - {{ lang.t("required") }} - {% endif %} -
    + + + + + + - {% endfor %} - -
    {{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}{{ lang.t("Default") }}
    + + + {% for parameter in section.value %} + + {{ parameter.name }} + + {% if parameter.annotation %} + {% with expression = parameter.annotation %} + {% include "expression.html" with context %} + {% endwith %} + {% endif %} + + +
    + {{ parameter.description|convert_markdown(heading_level, html_id) }} +
    + + + {% if parameter.default %} + {% with expression = parameter.default %} + {% include "expression.html" with context %} + {% endwith %} + {% else %} + {{ lang.t("required") }} + {% endif %} + + + {% endfor %} + + {% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

    {{ section.title or lang.t("Parameters:") }}

    - +

    {{ section.title or lang.t("Parameters:") }}

    + {% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} {% block spacy_style scoped %} - - - - - - - - - {% for parameter in section.value %} - - - +
    {{ (section.title or lang.t("PARAMETER")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    {{ parameter.name }} -
    - {{ parameter.description|convert_markdown(heading_level, html_id) }} -
    -

    - {% if parameter.annotation %} - - {{ lang.t("TYPE:") }} - {% with expression = parameter.annotation %} - {% include "expression.html" with context %} - {% endwith %} - - {% endif %} - {% if parameter.default %} - - {{ lang.t("DEFAULT:") }} - {% with expression = parameter.default %} - {% include "expression.html" with context %} - {% endwith %} - - {% endif %} -

    -
    + + + + - {% endfor %} - -
    {{ (section.title or lang.t("PARAMETER")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    + + + {% for parameter in section.value %} + + {{ parameter.name }} + +
    + {{ parameter.description|convert_markdown(heading_level, html_id) }} +
    +

    + {% if parameter.annotation %} + + {{ lang.t("TYPE:") }} + {% with expression = parameter.annotation %} + {% include "expression.html" with context %} + {% endwith %} + + {% endif %} + {% if parameter.default %} + + {{ lang.t("DEFAULT:") }} + {% with expression = parameter.default %} + {% include "expression.html" with context %} + {% endwith %} + + {% endif %} +

    + + + {% endfor %} + + {% endblock spacy_style %} {% endif %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html index 5e20b653..8240dc09 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html @@ -4,80 +4,80 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} -

    {{ section.title or lang.t("Raises:") }}

    - - - - - - - - - {% for raises in section.value %} - - - +

    {{ section.title or lang.t("Raises:") }}

    +
    {{ lang.t("Type") }}{{ lang.t("Description") }}
    - {% if raises.annotation %} - {% with expression = raises.annotation %} - {% include "expression.html" with context %} - {% endwith %} - {% endif %} - -
    - {{ raises.description|convert_markdown(heading_level, html_id) }} -
    -
    + + + + - {% endfor %} - -
    {{ lang.t("Type") }}{{ lang.t("Description") }}
    + + + {% for raises in section.value %} + + + {% if raises.annotation %} + {% with expression = raises.annotation %} + {% include "expression.html" with context %} + {% endwith %} + {% endif %} + + +
    + {{ raises.description|convert_markdown(heading_level, html_id) }} +
    + + + {% endfor %} + + {% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

    {{ lang.t(section.title) or lang.t("Raises:") }}

    - +

    {{ lang.t(section.title) or lang.t("Raises:") }}

    + {% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} {% block spacy_style scoped %} - - - - - - - - - {% for raises in section.value %} - - - +
    {{ (section.title or lang.t("RAISES")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    - - {% with expression = raises.annotation %} - {% include "expression.html" with context %} - {% endwith %} - - -
    - {{ raises.description|convert_markdown(heading_level, html_id) }} -
    -
    + + + + - {% endfor %} - -
    {{ (section.title or lang.t("RAISES")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    + + + {% for raises in section.value %} + + + + {% with expression = raises.annotation %} + {% include "expression.html" with context %} + {% endwith %} + + + +
    + {{ raises.description|convert_markdown(heading_level, html_id) }} +
    + + + {% endfor %} + + {% endblock spacy_style %} {% endif %} \ No newline at end of file diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html index e03e8b8e..1eff98ae 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html @@ -4,100 +4,100 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} - {% set name_column = section.value|selectattr("name")|any %} -

    {{ section.title or lang.t("Receives:") }}

    - - - - {% if name_column %}{% endif %} - - - - - - {% for receives in section.value %} - - {% if name_column %}{% endif %} - - + {% set name_column = section.value|selectattr("name")|any %} +

    {{ section.title or lang.t("Receives:") }}

    +
    {{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}
    {% if receives.name %}{{ receives.name }}{% endif %} - {% if receives.annotation %} - {% with expression = receives.annotation %} - {% include "expression.html" with context %} - {% endwith %} - {% endif %} - -
    - {{ receives.description|convert_markdown(heading_level, html_id) }} -
    -
    + + + {% if name_column %}{% endif %} + + - {% endfor %} - -
    {{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}
    + + + {% for receives in section.value %} + + {% if name_column %}{% if receives.name %}{{ receives.name }}{% endif %}{% endif %} + + {% if receives.annotation %} + {% with expression = receives.annotation %} + {% include "expression.html" with context %} + {% endwith %} + {% endif %} + + +
    + {{ receives.description|convert_markdown(heading_level, html_id) }} +
    + + + {% endfor %} + + {% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

    {{ section.title or lang.t("Receives:") }}

    - +

    {{ section.title or lang.t("Receives:") }}

    + {% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} {% block spacy_style scoped %} - - - - - - - - - {% for receives in section.value %} - - - + + + {% endfor %} + +
    {{ (section.title or lang.t("RECEIVES")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    - {% if receives.name %} - {{ receives.name }} - {% elif receives.annotation %} - - {% with expression = receives.annotation %} - {% include "expression.html" with context %} - {% endwith %} - - {% endif %} - -
    - {{ receives.description|convert_markdown(heading_level, html_id) }} -
    - {% if receives.name and receives.annotation %} -

    + + + + + + + + + {% for receives in section.value %} + + - - {% endfor %} - -
    {{ (section.title or lang.t("RECEIVES")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    + {% if receives.name %} + {{ receives.name }} + {% elif receives.annotation %} - {{ lang.t("TYPE:") }} {% with expression = receives.annotation %} {% include "expression.html" with context %} {% endwith %} -

    - {% endif %} -
    + {% endif %} +

    +
    + {{ receives.description|convert_markdown(heading_level, html_id) }} +
    + {% if receives.name and receives.annotation %} +

    + + {{ lang.t("TYPE:") }} + {% with expression = receives.annotation %} + {% include "expression.html" with context %} + {% endwith %} + +

    + {% endif %} +
    {% endblock spacy_style %} {% endif %} \ No newline at end of file diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html index a7a7cb98..bf3bdb4b 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html @@ -4,100 +4,100 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} - {% set name_column = section.value|selectattr("name")|any %} -

    {{ section.title or lang.t("Returns:") }}

    - - - - {% if name_column %}{% endif %} - - - - - - {% for returns in section.value %} - - {% if name_column %}{% endif %} - - + {% set name_column = section.value|selectattr("name")|any %} +

    {{ section.title or lang.t("Returns:") }}

    +
    {{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}
    {% if returns.name %}{{ returns.name }}{% endif %} - {% if returns.annotation %} - {% with expression = returns.annotation %} - {% include "expression.html" with context %} - {% endwith %} - {% endif %} - -
    - {{ returns.description|convert_markdown(heading_level, html_id) }} -
    -
    + + + {% if name_column %}{% endif %} + + - {% endfor %} - -
    {{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}
    + + + {% for returns in section.value %} + + {% if name_column %}{% if returns.name %}{{ returns.name }}{% endif %}{% endif %} + + {% if returns.annotation %} + {% with expression = returns.annotation %} + {% include "expression.html" with context %} + {% endwith %} + {% endif %} + + +
    + {{ returns.description|convert_markdown(heading_level, html_id) }} +
    + + + {% endfor %} + + {% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

    {{ section.title or lang.t("Returns:") }}

    - +

    {{ section.title or lang.t("Returns:") }}

    + {% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} {% block spacy_style scoped %} - - - - - - - - - {% for returns in section.value %} - - - + + + {% endfor %} + +
    {{ (section.title or lang.t("RETURNS")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION").upper() }}
    - {% if returns.name %} - {{ returns.name }} - {% elif returns.annotation %} - - {% with expression = returns.annotation %} - {% include "expression.html" with context %} - {% endwith %} - - {% endif %} - -
    - {{ returns.description|convert_markdown(heading_level, html_id) }} -
    - {% if returns.name and returns.annotation %} -

    + + + + + + + + + {% for returns in section.value %} + + - - {% endfor %} - -
    {{ (section.title or lang.t("RETURNS")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION").upper() }}
    + {% if returns.name %} + {{ returns.name }} + {% elif returns.annotation %} - {{ lang.t("TYPE:") }} {% with expression = returns.annotation %} {% include "expression.html" with context %} {% endwith %} -

    - {% endif %} -
    + {% endif %} +

    +
    + {{ returns.description|convert_markdown(heading_level, html_id) }} +
    + {% if returns.name and returns.annotation %} +

    + + {{ lang.t("TYPE:") }} + {% with expression = returns.annotation %} + {% include "expression.html" with context %} + {% endwith %} + +

    + {% endif %} +
    {% endblock spacy_style %} {% endif %} \ No newline at end of file diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html index a9bdae26..f7883a7a 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html @@ -4,80 +4,80 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} -

    {{ section.title or lang.t("Warns:") }}

    - - - - - - - - - {% for warns in section.value %} - - - +

    {{ section.title or lang.t("Warns:") }}

    +
    {{ lang.t("Type") }}{{ lang.t("Description") }}
    - {% if warns.annotation %} - {% with expression = warns.annotation %} - {% include "expression.html" with context %} - {% endwith %} - {% endif %} - -
    - {{ warns.description|convert_markdown(heading_level, html_id) }} -
    -
    + + + + - {% endfor %} - -
    {{ lang.t("Type") }}{{ lang.t("Description") }}
    + + + {% for warns in section.value %} + + + {% if warns.annotation %} + {% with expression = warns.annotation %} + {% include "expression.html" with context %} + {% endwith %} + {% endif %} + + +
    + {{ warns.description|convert_markdown(heading_level, html_id) }} +
    + + + {% endfor %} + + {% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

    {{ section.title or lang.t("Warns:") }}

    - +

    {{ section.title or lang.t("Warns:") }}

    + {% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} {% block spacy_style scoped %} - - - - - - - - - {% for warns in section.value %} - - - +
    {{ (section.title or lang.t("WARNS")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    - - {% with expression = warns.annotation %} - {% include "expression.html" with context %} - {% endwith %} - - -
    - {{ warns.description|convert_markdown(heading_level, html_id) }} -
    -
    + + + + - {% endfor %} - -
    {{ (section.title or lang.t("WARNS")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    + + + {% for warns in section.value %} + + + + {% with expression = warns.annotation %} + {% include "expression.html" with context %} + {% endwith %} + + + +
    + {{ warns.description|convert_markdown(heading_level, html_id) }} +
    + + + {% endfor %} + + {% endblock spacy_style %} {% endif %} \ No newline at end of file diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html index 6c4cb0b0..2a4bb734 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html @@ -4,100 +4,100 @@ {% if config.docstring_section_style == "table" %} {% block table_style scoped %} - {% set name_column = section.value|selectattr("name")|any %} -

    {{ section.title or lang.t("Yields:") }}

    - - - - {% if name_column %}{% endif %} - - - - - - {% for yields in section.value %} - - {% if name_column %}{% endif %} - - + {% set name_column = section.value|selectattr("name")|any %} +

    {{ section.title or lang.t("Yields:") }}

    +
    {{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}
    {% if yields.name %}{{ yields.name }}{% endif %} - {% if yields.annotation %} - {% with expression = yields.annotation %} - {% include "expression.html" with context %} - {% endwith %} - {% endif %} - -
    - {{ yields.description|convert_markdown(heading_level, html_id) }} -
    -
    + + + {% if name_column %}{% endif %} + + - {% endfor %} - -
    {{ lang.t("Name") }}{{ lang.t("Type") }}{{ lang.t("Description") }}
    + + + {% for yields in section.value %} + + {% if name_column %}{% if yields.name %}{{ yields.name }}{% endif %}{% endif %} + + {% if yields.annotation %} + {% with expression = yields.annotation %} + {% include "expression.html" with context %} + {% endwith %} + {% endif %} + + +
    + {{ yields.description|convert_markdown(heading_level, html_id) }} +
    + + + {% endfor %} + + {% endblock table_style %} {% elif config.docstring_section_style == "list" %} {% block list_style scoped %} -

    {{ section.title or lang.t("Yields:") }}

    - +

    {{ section.title or lang.t("Yields:") }}

    + {% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} {% block spacy_style scoped %} - - - - - - - - - {% for yields in section.value %} - - - + + + {% endfor %} + +
    {{ (section.title or lang.t("YIELDS")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    - {% if yields.name %} - {{ yields.name }} - {% elif yields.annotation %} - - {% with expression = yields.annotation %} - {% include "expression.html" with context %} - {% endwith %} - - {% endif %} - -
    - {{ yields.description|convert_markdown(heading_level, html_id) }} -
    - {% if yields.name and yields.annotation %} -

    + + + + + + + + + {% for yields in section.value %} + + - - {% endfor %} - -
    {{ (section.title or lang.t("YIELDS")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
    + {% if yields.name %} + {{ yields.name }} + {% elif yields.annotation %} - {{ lang.t("TYPE:") }}: {% with expression = yields.annotation %} {% include "expression.html" with context %} {% endwith %} -

    - {% endif %} -
    + {% endif %} +

    +
    + {{ yields.description|convert_markdown(heading_level, html_id) }} +
    + {% if yields.name and yields.annotation %} +

    + + {{ lang.t("TYPE:") }}: + {% with expression = yields.annotation %} + {% include "expression.html" with context %} + {% endwith %} + +

    + {% endif %} +
    {% endblock spacy_style %} {% endif %} \ No newline at end of file diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/function.html b/src/mkdocstrings_handlers/python/templates/material/_base/function.html index 5c2ac29e..c4a20a12 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/function.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/function.html @@ -3,96 +3,96 @@ {% import "language.html" as lang with context %}
    -{% with obj = function, html_id = function.path %} + {% with obj = function, 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 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 %} + + {% set function_name = function.path if show_full_path else function.name %} + {% set symbol_type = "method" if function.parent.is_class else "function" %} + + {% if not root or config.show_root_heading %} + {% filter heading( + heading_level, + role="function", + id=html_id, + class="doc doc-heading", + toc_label=((' ')|safe if config.show_symbol_type_toc else '') + function.name, + ) %} - {% set function_name = function.path if show_full_path else function.name %} - {% set symbol_type = "method" if function.parent.is_class else "function" %} + {% block heading scoped %} + {% if config.show_symbol_type_heading %}{% endif %} + {% if config.separate_signature %} + {{ function_name }} + {% else %} + {%+ filter highlight(language="python", inline=True) %} + {{ function_name }}{% include "signature.html" with context %} + {% endfilter %} + {% endif %} + {% endblock heading %} - {% if not root or config.show_root_heading %} - {% filter heading( - heading_level, - role="function", - id=html_id, - class="doc doc-heading", - toc_label=((' ')|safe if config.show_symbol_type_toc else '') + function.name, - ) %} + {% block labels scoped %} + {% with labels = function.labels %} + {% include "labels.html" with context %} + {% endwith %} + {% endblock labels %} + + {% endfilter %} - {% block heading scoped %} - {% if config.show_symbol_type_heading %}{% endif %} + {% block signature scoped %} {% if config.separate_signature %} - {{ function_name }} - {% else %} - {%+ filter highlight(language="python", inline=True) %} - {{ function_name }}{% include "signature.html" with context %} + {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %} + {{ function.name }} {% endfilter %} {% endif %} - {% endblock heading %} + {% endblock signature %} - {% block labels scoped %} - {% with labels = function.labels %} - {% include "labels.html" with context %} - {% endwith %} - {% endblock labels %} + {% else %} - {% endfilter %} - - {% block signature scoped %} - {% if config.separate_signature %} - {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %} - {{ function.name }} + {% if config.show_root_toc_entry %} + {% filter heading( + heading_level, + role="function", + id=html_id, + toc_label=((' ')|safe if config.show_symbol_type_toc else '') + function.name, + hidden=True, + ) %} {% endfilter %} {% endif %} - {% endblock signature %} - - {% else %} - - {% if config.show_root_toc_entry %} - {% filter heading( - heading_level, - role="function", - id=html_id, - toc_label=((' ')|safe if config.show_symbol_type_toc else '') + function.name, - hidden=True, - ) %} - {% endfilter %} + {% set heading_level = heading_level - 1 %} {% endif %} - {% set heading_level = heading_level - 1 %} - {% endif %} -
    - {% block contents scoped %} - {% block docstring scoped %} - {% with docstring_sections = function.docstring.parsed %} - {% include "docstring.html" with context %} - {% endwith %} - {% endblock docstring %} +
    + {% block contents scoped %} + {% block docstring scoped %} + {% with docstring_sections = function.docstring.parsed %} + {% include "docstring.html" with context %} + {% endwith %} + {% endblock docstring %} - {% block source scoped %} - {% if config.show_source and function.source %} -
    - {{ lang.t("Source code in") }} - {%- if function.relative_filepath.is_absolute() -%} - {{ function.relative_package_filepath }} - {%- else -%} - {{ function.relative_filepath }} - {%- endif -%} - - {{ function.source|highlight(language="python", linestart=function.lineno, linenums=True) }} -
    - {% endif %} - {% endblock source %} - {% endblock contents %} -
    + {% block source scoped %} + {% if config.show_source and function.source %} +
    + {{ lang.t("Source code in") }} + {%- if function.relative_filepath.is_absolute() -%} + {{ function.relative_package_filepath }} + {%- else -%} + {{ function.relative_filepath }} + {%- endif -%} + + {{ function.source|highlight(language="python", linestart=function.lineno, linenums=True) }} +
    + {% endif %} + {% endblock source %} + {% endblock contents %} +
    -{% endwith %} + {% endwith %}
    diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/module.html b/src/mkdocstrings_handlers/python/templates/material/_base/module.html index 7d45e321..5c3080c6 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/module.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/module.html @@ -1,74 +1,74 @@ {{ log.debug("Rendering " + module.path) }}
    -{% with obj = module, html_id = module.path %} + {% with obj = module, html_id = module.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 %} - - {% set module_name = module.path if show_full_path else module.name %} - - {% if not root or config.show_root_heading %} - {% filter heading( - heading_level, - role="module", - id=html_id, - class="doc doc-heading", - toc_label=(' '|safe if config.show_symbol_type_toc else '') + module.name, - ) %} - - {% block heading scoped %} - {% if config.show_symbol_type_heading %}{% endif %} - {% if config.separate_signature %} - {{ module_name }} - {% else %} - {{ module_name }} - {% endif %} - {% endblock heading %} - - {% block labels scoped %} - {% with labels = module.labels %} - {% include "labels.html" with context %} - {% endwith %} - {% endblock labels %} + {% 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 %} - {% endfilter %} + {% set module_name = module.path if show_full_path else module.name %} - {% else %} - {% if config.show_root_toc_entry %} - {% filter heading(heading_level, + {% if not root or config.show_root_heading %} + {% filter heading( + heading_level, role="module", id=html_id, + class="doc doc-heading", toc_label=(' '|safe if config.show_symbol_type_toc else '') + module.name, - hidden=True, - ) %} + ) %} + + {% block heading scoped %} + {% if config.show_symbol_type_heading %}{% endif %} + {% if config.separate_signature %} + {{ module_name }} + {% else %} + {{ module_name }} + {% endif %} + {% endblock heading %} + + {% block labels scoped %} + {% with labels = module.labels %} + {% include "labels.html" with context %} + {% endwith %} + {% endblock labels %} + {% endfilter %} + + {% else %} + {% if config.show_root_toc_entry %} + {% filter heading(heading_level, + role="module", + id=html_id, + toc_label=(' '|safe if config.show_symbol_type_toc else '') + module.name, + hidden=True, + ) %} + {% endfilter %} + {% endif %} + {% set heading_level = heading_level - 1 %} {% endif %} - {% set heading_level = heading_level - 1 %} - {% endif %} -
    - {% block contents scoped %} - {% block docstring scoped %} - {% with docstring_sections = module.docstring.parsed %} - {% include "docstring.html" with context %} - {% endwith %} - {% endblock docstring %} +
    + {% block contents scoped %} + {% block docstring scoped %} + {% with docstring_sections = module.docstring.parsed %} + {% include "docstring.html" with context %} + {% endwith %} + {% endblock docstring %} - {% block children scoped %} - {% set root = False %} - {% set heading_level = heading_level + 1 %} - {% include "children.html" with context %} - {% endblock children %} - {% endblock contents %} -
    + {% block children scoped %} + {% set root = False %} + {% set heading_level = heading_level + 1 %} + {% include "children.html" with context %} + {% endblock children %} + {% endblock contents %} +
    -{% endwith %} + {% endwith %}
    diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/signature.html b/src/mkdocstrings_handlers/python/templates/material/_base/signature.html index 74563385..6d3d2973 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/signature.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/signature.html @@ -3,62 +3,61 @@ {%- with -%} {%- set ns = namespace( - has_pos_only=False, - render_pos_only_separator=True, - render_kw_only_separator=True, - annotation="", - equal="=", - ) - -%} + has_pos_only=False, + render_pos_only_separator=True, + render_kw_only_separator=True, + annotation="", + equal="=", + ) -%} ( - {%- for parameter in function.parameters -%} - {%- if parameter.name not in ("self", "cls") or loop.index0 > 0 or not (function.parent and function.parent.is_class) -%} + {%- for parameter in function.parameters -%} + {%- if parameter.name not in ("self", "cls") or loop.index0 > 0 or not (function.parent and function.parent.is_class) -%} - {%- if parameter.kind.value == "positional-only" -%} - {%- set ns.has_pos_only = True -%} - {%- else -%} - {%- if ns.has_pos_only and ns.render_pos_only_separator -%} - {%- set ns.render_pos_only_separator = False %}/, {% endif -%} - {%- if parameter.kind.value == "keyword-only" -%} - {%- if ns.render_kw_only_separator -%} - {%- set ns.render_kw_only_separator = False %}*, {% endif -%} - {%- endif -%} + {%- if parameter.kind.value == "positional-only" -%} + {%- set ns.has_pos_only = True -%} + {%- else -%} + {%- if ns.has_pos_only and ns.render_pos_only_separator -%} + {%- set ns.render_pos_only_separator = False %}/, {% endif -%} + {%- if parameter.kind.value == "keyword-only" -%} + {%- if ns.render_kw_only_separator -%} + {%- set ns.render_kw_only_separator = False %}*, {% endif -%} {%- endif -%} + {%- endif -%} - {%- if config.show_signature_annotations and parameter.annotation is not none -%} - {%- set ns.equal = " = " -%} - {%- if config.separate_signature and config.signature_crossrefs -%} - {%- with expression = parameter.annotation -%} - {%- set ns.annotation -%}: {% include "expression.html" with context %}{%- endset -%} - {%- endwith -%} - {%- else -%} - {%- set ns.annotation = ": " + parameter.annotation|safe -%} - {%- endif -%} + {%- if config.show_signature_annotations and parameter.annotation is not none -%} + {%- set ns.equal = " = " -%} + {%- if config.separate_signature and config.signature_crossrefs -%} + {%- with expression = parameter.annotation -%} + {%- set ns.annotation -%}: {% include "expression.html" with context %}{%- endset -%} + {%- endwith -%} {%- else -%} - {%- set ns.equal = "=" -%} - {%- set ns.annotation = "" -%} + {%- set ns.annotation = ": " + parameter.annotation|safe -%} {%- endif -%} + {%- else -%} + {%- set ns.equal = "=" -%} + {%- set ns.annotation = "" -%} + {%- endif -%} - {%- if parameter.default is not none and parameter.kind.value != "variadic positional" and parameter.kind.value != "variadic keyword" -%} - {%- set default = ns.equal + parameter.default|safe -%} - {%- endif -%} + {%- if parameter.default is not none and parameter.kind.value != "variadic positional" and parameter.kind.value != "variadic keyword" -%} + {%- set default = ns.equal + parameter.default|safe -%} + {%- endif -%} - {%- if parameter.kind.value == "variadic positional" -%} - {%- set ns.render_kw_only_separator = False -%} - {%- endif -%} + {%- if parameter.kind.value == "variadic positional" -%} + {%- set ns.render_kw_only_separator = False -%} + {%- endif -%} - {% if parameter.kind.value == "variadic positional" %}*{% elif parameter.kind.value == "variadic keyword" %}**{% endif -%} - {{ parameter.name }}{{ ns.annotation }}{{ default }} - {%- if not loop.last %}, {% endif -%} + {% if parameter.kind.value == "variadic positional" %}*{% elif parameter.kind.value == "variadic keyword" %}**{% endif -%} + {{ parameter.name }}{{ ns.annotation }}{{ default }} + {%- if not loop.last %}, {% endif -%} - {%- endif -%} - {%- endfor -%} + {%- endif -%} + {%- endfor -%} ) {%- if config.show_signature_annotations and function.annotation and not (config.merge_init_into_class and function.name == "__init__" ) - %} -> {% if config.separate_signature and config.signature_crossrefs -%} + %} -> {% if config.separate_signature and config.signature_crossrefs -%} {%- with expression = function.annotation %}{% include "expression.html" with context %}{%- endwith -%} {%- else -%} {{ function.annotation|safe }} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/returns.html b/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/returns.html index c2300318..355eedcc 100644 --- a/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/returns.html +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/docstring/returns.html @@ -9,27 +9,27 @@ - {{ section.title or lang.t("Returns:") }} - - - + {{ section.title or lang.t("Returns:") }} + + +