diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html index 80a75fc9..7effc590 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html @@ -1,80 +1,11 @@ -{{ log.debug("Rendering " + 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 %} - - {% 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, - ) %} - - {% 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 %} - - {% block labels scoped %} - {% with labels = attribute.labels %} - {% include "labels.html" with context %} - {% endwith %} - {% endblock labels %} - - {% endfilter %} - - {% block signature scoped %} - {% if config.separate_signature %} - {% filter format_attribute(attribute, config.line_length, crossrefs=config.signature_crossrefs) %} - {{ attribute.name }} - {% 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 %} - {% 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 %} -
- - {% endwith %} -
+{% extends "_base/attribute.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/attribute.html' is deprecated, extend '_base/attribute.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/children.html b/src/mkdocstrings_handlers/python/templates/material/_base/children.html index cd9a8fac..15fada5a 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/children.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/children.html @@ -1,154 +1,11 @@ -{% if obj.members %} - {{ log.debug("Rendering children of " + obj.path) }} - -
- - {% if root_members %} - {% set members_list = config.members %} - {% else %} - {% set members_list = none %} - {% endif %} - - {% if config.group_by_category %} - - {% with %} - - {% if config.show_category_heading %} - {% set extra_level = 1 %} - {% else %} - {% set extra_level = 0 %} - {% 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, - ) %} - {% if attributes %} - {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-attributes") %}Attributes{% endfilter %} - {% endif %} - {% with heading_level = heading_level + extra_level %} - {% for attribute in attributes|order_members(config.members_order, members_list) %} - {% if members_list is not none or attribute.is_public(check_name=False) %} - {% include attribute|get_template with context %} - {% endif %} - {% endfor %} - {% endwith %} - {% endif %} - {% 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, - ) %} - {% if classes %} - {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-classes") %}Classes{% endfilter %} - {% endif %} - {% with heading_level = heading_level + extra_level %} - {% for class in classes|order_members(config.members_order, members_list) %} - {% if members_list is not none or class.is_public(check_name=False) %} - {% include class|get_template with context %} - {% endif %} - {% endfor %} - {% endwith %} - {% endif %} - {% 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, - ) %} - {% if functions %} - {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-functions") %}Functions{% endfilter %} - {% endif %} - {% with heading_level = heading_level + extra_level %} - {% for function in functions|order_members(config.members_order, members_list) %} - {% if not (obj.kind.value == "class" and function.name == "__init__" and config.merge_init_into_class) %} - {% if members_list is not none or function.is_public(check_name=False) %} - {% include function|get_template with context %} - {% endif %} - {% endif %} - {% endfor %} - {% endwith %} - {% endif %} - {% endwith %} - - {% 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, - ) %} - {% if modules %} - {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-modules") %}Modules{% endfilter %} - {% endif %} - {% with heading_level = heading_level + extra_level %} - {% for module in modules|order_members(config.members_order.alphabetical, members_list) %} - {% if members_list is not none or module.is_public(check_name=False) %} - {% include module|get_template with context %} - {% endif %} - {% endfor %} - {% endwith %} - {% endif %} - {% endwith %} - {% endif %} - - {% endwith %} - - {% 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) - %} - - {% if not (obj.is_class and child.name == "__init__" and config.merge_init_into_class) %} - - {% if members_list is not none or child.is_public(check_name=False) %} - {% if child.is_attribute %} - {% with attribute = child %} - {% include attribute|get_template with context %} - {% endwith %} - - {% elif child.is_class %} - {% with class = child %} - {% include class|get_template with context %} - {% endwith %} - - {% elif child.is_function %} - {% with function = child %} - {% include function|get_template with context %} - {% endwith %} - - {% elif child.is_module and config.show_submodules %} - {% with module = child %} - {% include module|get_template with context %} - {% endwith %} - - {% endif %} - {% endif %} - - {% endif %} - - {% endfor %} - - {% endif %} - -
- -{% endif %} +{% extends "_base/children.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/children.html' is deprecated, extend '_base/children.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html b/src/mkdocstrings_handlers/python/templates/material/_base/class.html index 2934c7c0..ac3e421e 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html @@ -1,142 +1,11 @@ -{{ log.debug("Rendering " + 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 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, - ) %} - - {% 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 %} - - {% endfilter %} - - {% 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 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 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 %} - {% endwith %} - {% endif %} - {% endif %} - {% 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 %} -
- - {% endwith %} - -
+{% extends "_base/class.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/class.html' is deprecated, extend '_base/class.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html index a80d5c76..5ef9da3e 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html @@ -1,34 +1,11 @@ -{% if docstring_sections %} - {{ log.debug("Rendering docstring") }} - {% for section in docstring_sections %} - {% if config.show_docstring_description and section.kind.value == "text" %} - {{ section.value|convert_markdown(heading_level, html_id) }} - {% elif config.show_docstring_attributes and section.kind.value == "attributes" %} - {% include "docstring/attributes.html" with context %} - {% elif config.show_docstring_functions and section.kind.value == "functions" %} - {% include "docstring/functions.html" with context %} - {% elif config.show_docstring_classes and section.kind.value == "classes" %} - {% include "docstring/classes.html" with context %} - {% elif config.show_docstring_modules and section.kind.value == "modules" %} - {% include "docstring/modules.html" with context %} - {% elif config.show_docstring_parameters and section.kind.value == "parameters" %} - {% include "docstring/parameters.html" with context %} - {% elif config.show_docstring_other_parameters and section.kind.value == "other parameters" %} - {% include "docstring/other_parameters.html" with context %} - {% elif config.show_docstring_raises and section.kind.value == "raises" %} - {% include "docstring/raises.html" with context %} - {% elif config.show_docstring_warns and section.kind.value == "warns" %} - {% include "docstring/warns.html" with context %} - {% elif config.show_docstring_yields and section.kind.value == "yields" %} - {% include "docstring/yields.html" with context %} - {% elif config.show_docstring_receives and section.kind.value == "receives" %} - {% include "docstring/receives.html" with context %} - {% elif config.show_docstring_returns and section.kind.value == "returns" %} - {% include "docstring/returns.html" with context %} - {% elif config.show_docstring_examples and section.kind.value == "examples" %} - {% include "docstring/examples.html" with context %} - {% elif config.show_docstring_description and section.kind.value == "admonition" %} - {% include "docstring/admonition.html" with context %} - {% endif %} - {% endfor %} -{% endif %} +{% extends "_base/docstring.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring.html' is deprecated, extend '_base/docstring.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html index 7d056df8..a8a75542 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html @@ -1,5 +1,11 @@ -{{ log.debug("Rendering admonition") }} -
- {{ section.title|convert_markdown(heading_level, html_id, strip_paragraph=True) }} - {{ section.value.contents|convert_markdown(heading_level, html_id) }} -
\ No newline at end of file +{% extends "_base/docstring/admonition.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/admonition.html' is deprecated, extend '_base/docstring/admonition.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 99824653..cd4b05be 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html @@ -1,90 +1,11 @@ -{{ log.debug("Rendering attributes section") }} +{% extends "_base/docstring/attributes.html.jinja" %} -{% import "language.html" as lang with context %} - -{% if config.docstring_section_style == "table" %} - {% block table_style scoped %} -

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

- - - - - - - - - - {% for attribute in section.value %} - - - - - - {% endfor %} - -
{{ 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) }} -
-
- {% endblock table_style %} -{% elif config.docstring_section_style == "list" %} - {% block list_style scoped %} -

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

- - {% endblock list_style %} -{% elif config.docstring_section_style == "spacy" %} - {% block spacy_style scoped %} - - - - - - - - - {% for attribute in section.value %} - - - - - {% endfor %} - -
{{ (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 %} -

-
- {% endblock spacy_style %} -{% endif %} \ No newline at end of file +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/attributes.html' is deprecated, extend '_base/docstring/attributes.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 c0acac8a..78b47e2d 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html @@ -1,67 +1,11 @@ -{{ log.debug("Rendering classes section") }} +{% extends "_base/docstring/classes.html.jinja" %} -{% import "language.html" as lang with context %} - -{% if config.docstring_section_style == "table" %} - {% block table_style scoped %} -

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

- - - - - - - - - {% for class in section.value %} - - - - - {% endfor %} - -
{{ lang.t("Name") }}{{ lang.t("Description") }}
{{ class.name }} -
- {{ class.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("Classes:") }}

- - {% endblock list_style %} -{% elif config.docstring_section_style == "spacy" %} - {% block spacy_style scoped %} - - - - - - - - - {% for class in section.value %} - - - - - {% endfor %} - -
{{ (section.title or lang.t("CLASS")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
{{ class.name }} -
- {{ class.description|convert_markdown(heading_level, html_id) }} -
-
- {% endblock spacy_style %} -{% endif %} \ No newline at end of file +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/classes.html' is deprecated, extend '_base/docstring/classes.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html index 5305efa9..37674811 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html @@ -1,12 +1,11 @@ -{{ log.debug("Rendering examples section") }} +{% extends "_base/docstring/examples.html.jinja" %} -{% import "language.html" as lang with context %} - -

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

-{% for section_type, sub_section in section.value %} - {% if section_type.value == "text" %} - {{ sub_section|convert_markdown(heading_level, html_id) }} - {% elif section_type.value == "examples" %} - {{ sub_section|highlight(language="pycon", linenums=False) }} - {% endif %} -{% endfor %} +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/examples.html' is deprecated, extend '_base/docstring/examples.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 696826f0..a61c48fb 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html @@ -1,73 +1,11 @@ -{{ log.debug("Rendering functions section") }} +{% extends "_base/docstring/functions.html.jinja" %} -{% import "language.html" as lang with context %} - -{% 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) }} -
-
- {% 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 %} - - - - - - - - - {% 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 +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/functions.html' is deprecated, extend '_base/docstring/functions.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 d5ea77e6..d0b303b4 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html @@ -1,67 +1,11 @@ -{{ log.debug("Rendering modules section") }} +{% extends "_base/docstring/modules.html.jinja" %} -{% import "language.html" as lang with context %} - -{% if config.docstring_section_style == "table" %} - {% block table_style scoped %} -

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

- - - - - - - - - {% for module in section.value %} - - - - - {% endfor %} - -
{{ lang.t("Name") }}{{ lang.t("Description") }}
{{ module.name }} -
- {{ module.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("Modules:") }}

- - {% endblock list_style %} -{% elif config.docstring_section_style == "spacy" %} - {% block spacy_style scoped %} - - - - - - - - - {% for module in section.value %} - - - - - {% endfor %} - -
{{ (section.title or lang.t("MODULE")).rstrip(":").upper() }}{{ lang.t("DESCRIPTION") }}
{{ module.name }} -
- {{ module.description|convert_markdown(heading_level, html_id) }} -
-
- {% endblock spacy_style %} -{% endif %} \ No newline at end of file +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/modules.html' is deprecated, extend '_base/docstring/modules.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 17d6d355..eae60aa7 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 @@ -1,90 +1,11 @@ -{{ log.debug("Rendering other parameters section") }} +{% extends "_base/docstring/other_parameters.html.jinja" %} -{% import "language.html" as lang with context %} - -{% if config.docstring_section_style == "table" %} - {% block table_style scoped %} -

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

- - - - - - - - - - {% for parameter in section.value %} - - - - - - {% endfor %} - -
{{ 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) }} -
-
- {% endblock table_style %} -{% elif config.docstring_section_style == "list" %} - {% block list_style scoped %} -

{{ 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 %} - - - - - {% endfor %} - -
{{ (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 %} -

-
- {% endblock spacy_style %} -{% endif %} \ No newline at end of file +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/other_parameters.html' is deprecated, extend '_base/docstring/other_parameters.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 7980096d..f5745464 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html @@ -1,113 +1,11 @@ -{{ log.debug("Rendering parameters section") }} +{% extends "_base/docstring/parameters.html.jinja" %} -{% import "language.html" as lang with context %} - -{% if config.docstring_section_style == "table" %} - {% block table_style scoped %} -

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

- - - - - - - - - - - {% for parameter in section.value %} - - - - - - - {% endfor %} - -
{{ 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 %} -
- {% endblock table_style %} -{% elif config.docstring_section_style == "list" %} - {% block list_style scoped %} -

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

- - {% endblock list_style %} -{% elif config.docstring_section_style == "spacy" %} - {% block spacy_style scoped %} - - - - - - - - - {% for parameter in section.value %} - - - - - {% endfor %} - -
{{ (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 %} -

-
- {% endblock spacy_style %} -{% endif %} +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/parameters.html' is deprecated, extend '_base/docstring/parameters.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 8240dc09..361b9732 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html @@ -1,83 +1,11 @@ -{{ log.debug("Rendering raises section") }} +{% extends "_base/docstring/raises.html.jinja" %} -{% import "language.html" as lang with context %} - -{% if config.docstring_section_style == "table" %} - {% block table_style scoped %} -

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

- - - - - - - - - {% for raises in section.value %} - - - - - {% endfor %} - -
{{ 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) }} -
-
- {% endblock table_style %} -{% elif config.docstring_section_style == "list" %} - {% block list_style scoped %} -

{{ 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 %} - - - - - {% endfor %} - -
{{ (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) }} -
-
- {% endblock spacy_style %} -{% endif %} \ No newline at end of file +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/raises.html' is deprecated, extend '_base/docstring/raises.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 1eff98ae..e5a115c1 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html @@ -1,103 +1,11 @@ -{{ log.debug("Rendering receives section") }} +{% extends "_base/docstring/receives.html.jinja" %} -{% import "language.html" as lang with context %} - -{% 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 %} - - - - {% endfor %} - -
{{ 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) }} -
-
- {% endblock table_style %} -{% elif config.docstring_section_style == "list" %} - {% block list_style scoped %} -

{{ 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 %} -

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

- {% endif %} -
- {% endblock spacy_style %} -{% endif %} \ No newline at end of file +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/receives.html' is deprecated, extend '_base/docstring/receives.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 bf3bdb4b..0e7807ac 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html @@ -1,103 +1,11 @@ -{{ log.debug("Rendering returns section") }} +{% extends "_base/docstring/returns.html.jinja" %} -{% import "language.html" as lang with context %} - -{% 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 %} - - - - {% endfor %} - -
{{ 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) }} -
-
- {% endblock table_style %} -{% elif config.docstring_section_style == "list" %} - {% block list_style scoped %} -

{{ 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 %} -

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

- {% endif %} -
- {% endblock spacy_style %} -{% endif %} \ No newline at end of file +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/returns.html' is deprecated, extend '_base/docstring/returns.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 f7883a7a..b7b937a9 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html @@ -1,83 +1,11 @@ -{{ log.debug("Rendering warns section") }} +{% extends "_base/docstring/warns.html.jinja" %} -{% import "language.html" as lang with context %} - -{% if config.docstring_section_style == "table" %} - {% block table_style scoped %} -

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

- - - - - - - - - {% for warns in section.value %} - - - - - {% endfor %} - -
{{ 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) }} -
-
- {% endblock table_style %} -{% elif config.docstring_section_style == "list" %} - {% block list_style scoped %} -

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

- - {% endblock list_style %} -{% elif config.docstring_section_style == "spacy" %} - {% block spacy_style scoped %} - - - - - - - - - {% for warns in section.value %} - - - - - {% endfor %} - -
{{ (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) }} -
-
- {% endblock spacy_style %} -{% endif %} \ No newline at end of file +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/warns.html' is deprecated, extend '_base/docstring/warns.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} 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 2a4bb734..ecd6f513 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html @@ -1,103 +1,11 @@ -{{ log.debug("Rendering yields section") }} +{% extends "_base/docstring/yields.html.jinja" %} -{% import "language.html" as lang with context %} - -{% 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 %} - - - - {% endfor %} - -
{{ 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) }} -
-
- {% endblock table_style %} -{% elif config.docstring_section_style == "list" %} - {% block list_style scoped %} -

{{ 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 %} -

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

- {% endif %} -
- {% endblock spacy_style %} -{% endif %} \ No newline at end of file +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/yields.html' is deprecated, extend '_base/docstring/yields.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html b/src/mkdocstrings_handlers/python/templates/material/_base/expression.html index 00e1c761..556b3e2b 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/expression.html @@ -1,56 +1,11 @@ -{%- macro crossref(name, annotation_path) -%} - {%- with full = name.canonical_path -%} - {%- if annotation_path == "brief" -%} - {%- set annotation = name.canonical_name -%} - {%- elif annotation_path == "source" -%} - {%- set annotation = name.name -%} - {%- elif annotation_path == "full" -%} - {%- set annotation = full -%} - {%- endif -%} - {%- for title, path in annotation|split_path(full) -%} - {%- if not signature or config.signature_crossrefs -%} - {%- filter stash_crossref(length=title|length) -%} - {{ title }} - {%- endfilter -%} - {%- else -%} - {{ title }} - {%- endif -%} - {%- if not loop.last -%}.{%- endif -%} - {%- endfor -%} - {%- endwith -%} -{%- endmacro -%} +{% extends "_base/expression.html.jinja" %} -{%- macro render(expression, annotations_path) -%} - {%- if expression is string -%} - {%- if signature -%}{{ expression|safe }}{%- else -%}{{ expression }}{%- endif -%} - {%- elif expression.classname == "ExprName" -%} - {{ crossref(expression, annotations_path) }} - {%- elif config.unwrap_annotated and expression.classname == "ExprSubscript" and expression.canonical_path in ("typing.Annotated", "typing_extensions.Annotated") -%} - {{ render(expression.slice.elements[0], annotations_path) }} - {%- elif expression.classname == "ExprAttribute" -%} - {%- if annotations_path == "brief" -%} - {%- if expression.last.is_enum_value -%} - {{ crossref(expression.last.parent, "brief") }}.value - {%- else -%} - {{ render(expression.last, "brief") }} - {%- endif -%} - {%- elif annotations_path == "full" -%} - {{ render(expression.first, "full") }} - {%- for element in expression -%} - {%- if not loop.first -%} - {{ render(element, "brief") }} - {%- endif -%} - {%- endfor -%} - {%- else -%} - {%- for element in expression -%} - {{ render(element, annotations_path) }} - {%- endfor -%} - {%- endif -%} - {%- else -%} - {%- for element in expression -%} - {{ render(element, annotations_path) }} - {%- endfor -%} - {%- endif -%} -{%- endmacro -%} - -{{ render(expression, config.annotations_path) }} +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/expression.html' is deprecated, extend '_base/expression.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/function.html b/src/mkdocstrings_handlers/python/templates/material/_base/function.html index c4a20a12..07be5abb 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/function.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/function.html @@ -1,98 +1,11 @@ -{{ log.debug("Rendering " + function.path) }} - -{% import "language.html" as lang with context %} - -
- {% 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 %} - - {% 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, - ) %} - - {% 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 %} - - {% block labels scoped %} - {% with labels = function.labels %} - {% include "labels.html" with context %} - {% endwith %} - {% endblock labels %} - - {% endfilter %} - - {% block signature scoped %} - {% if config.separate_signature %} - {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %} - {{ function.name }} - {% 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 %} - {% 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 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 %} -
+{% extends "_base/function.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/function.html' is deprecated, extend '_base/function.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/labels.html b/src/mkdocstrings_handlers/python/templates/material/_base/labels.html index a35bffbb..784150c4 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/labels.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/labels.html @@ -1,8 +1,11 @@ -{% if config.show_labels and labels %} - {{ log.debug("Rendering labels") }} - - {% for label in labels|sort %} - {{ label }} - {% endfor %} - -{% endif %} +{% extends "_base/labels.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/labels.html' is deprecated, extend '_base/labels.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/language.html b/src/mkdocstrings_handlers/python/templates/material/_base/language.html new file mode 100644 index 00000000..c97d0c31 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/material/_base/language.html @@ -0,0 +1,11 @@ +{% extends "_base/language.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/language.html' is deprecated, extend '_base/language.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html b/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html index 1f76e059..eab87415 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html @@ -1,37 +1,11 @@ - -{% macro t(key) %}{{ { - "ATTRIBUTE": "ATTRIBUTE", - "Attributes:": "Attributes:", - "Classes:": "Classes:", - "CLASS": "CLASS", - "DEFAULT:": "DEFAULT:", - "Default": "Default", - "default:": "default:", - "DESCRIPTION": "DESCRIPTION", - "Description": "Description", - "Examples:": "Examples:", - "Functions:": "Functions:", - "FUNCTION": "FUNCTION", - "Methods:": "Methods:", - "METHOD": "METHOD", - "Modules:": "Modules:", - "MODULE": "MODULE", - "Name": "Name", - "Other Parameters:": "Other Parameters:", - "PARAMETER": "PARAMETER", - "Parameters:": "Parameters:", - "RAISES": "RAISES", - "Raises:" : "Raises:", - "RECEIVES": "RECEIVES", - "Receives:": "Receives:", - "required": "required", - "RETURNS": "RETURNS", - "Returns:": "Returns:", - "Source code in": "Source code in", - "TYPE:": "TYPE:", - "Type": "Type", - "WARNS": "WARNS", - "Warns:": "Warns:", - "YIELDS": "YIELDS", - "Yields:": "Yields:", -}[key] }}{% endmacro %} \ No newline at end of file +{% extends "_base/languages/en.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/languages/en.html' is deprecated, extend '_base/languages/en.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html b/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html index 456e1170..14319499 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html @@ -1,37 +1,11 @@ - -{% macro t(key) %}{{ { - "ATTRIBUTE": "属性", - "Attributes:": "属性:", - "Classes:": "", - "CLASS": "", - "DEFAULT:": "デフォルト:", - "Default": "デフォルト", - "default:": "デフォルト:", - "DESCRIPTION": "デスクリプション", - "Description": "デスクリプション", - "Examples:": "例:", - "Functions:": "", - "FUNCTION": "", - "Methods:": "", - "METHOD": "", - "Modules:": "", - "MODULE": "", - "Name": "名前", - "Other Parameters:": "他の引数:", - "PARAMETER": "引数", - "Parameters:": "引数:", - "RAISES": "発生", - "Raises:" : "発生:", - "RECEIVES": "取得", - "Receives:": "取得:", - "required": "必須", - "RETURNS": "戻り値", - "Returns:": "戻り値:", - "Source code in": "ソースコード位置:", - "TYPE:": "タイプ:", - "Type": "タイプ", - "WARNS": "警告", - "Warns:": "警告:", - "YIELDS": "返す", - "Yields:": "返す:", -}[key] }}{% endmacro %} \ No newline at end of file +{% extends "_base/languages/ja.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/languages/ja.html' is deprecated, extend '_base/languages/ja.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html b/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html index 9c018f27..0b281195 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html @@ -1,37 +1,11 @@ - -{% macro t(key) %}{{ { - "ATTRIBUTE": "属性", - "Attributes:": "属性:", - "Classes:": "", - "CLASS": "", - "DEFAULT:": "默认:", - "Default": "默认", - "default:": "默认:", - "DESCRIPTION": "描述", - "Description": "描述", - "Examples:": "示例:", - "Functions:": "", - "FUNCTION": "", - "Methods:": "", - "METHOD": "", - "Modules:": "", - "MODULE": "", - "Name": "名称", - "Other Parameters:": "其他参数:", - "PARAMETER": "参数", - "Parameters:": "参数:", - "RAISES": "引发", - "Raises:" : "引发:", - "Receives:": "接收:", - "RECEIVES": "接收", - "required": "必需", - "RETURNS": "返回", - "Returns:": "返回:", - "Source code in": "源代码位于:", - "TYPE:": "类型:", - "Type": "类型", - "Warns:": "警告:", - "WARNS": "警告", - "YIELDS": "产生", - "Yields:": "产生:", -}[key] }}{% endmacro %} \ No newline at end of file +{% extends "_base/languages/zh.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/languages/zh.html' is deprecated, extend '_base/languages/zh.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/module.html b/src/mkdocstrings_handlers/python/templates/material/_base/module.html index 5c3080c6..918ab6d0 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/module.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/module.html @@ -1,74 +1,11 @@ -{{ log.debug("Rendering " + 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 %} - - {% 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 %} - -
- {% 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 %} -
- - {% endwith %} -
+{% extends "_base/module.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/module.html' is deprecated, extend '_base/module.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/signature.html b/src/mkdocstrings_handlers/python/templates/material/_base/signature.html index 6d3d2973..623879db 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/signature.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/signature.html @@ -1,68 +1,11 @@ -{%- if config.show_signature -%} - {{ log.debug("Rendering signature") }} - {%- with -%} - - {%- set ns = namespace( - 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) -%} - - {%- 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 -%} - {%- 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.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 -%} - - {%- 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 -%} - {%- with expression = function.annotation %}{% include "expression.html" with context %}{%- endwith -%} - {%- else -%} - {{ function.annotation|safe }} - {%- endif -%} - {%- endif -%} - - {%- endwith -%} -{%- endif -%} \ No newline at end of file +{% extends "_base/signature.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/signature.html' is deprecated, extend '_base/signature.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary.html index e69de29b..aa33dc9c 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/summary.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/summary.html @@ -0,0 +1,11 @@ +{% extends "_base/summary.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/summary.html' is deprecated, extend '_base/summary.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary/attributes.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary/attributes.html index e69de29b..f2643791 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/summary/attributes.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/summary/attributes.html @@ -0,0 +1,11 @@ +{% extends "_base/summary/attributes.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/summary/attributes.html' is deprecated, extend '_base/summary/attributes.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary/classes.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary/classes.html index e69de29b..5c6275b4 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/summary/classes.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/summary/classes.html @@ -0,0 +1,11 @@ +{% extends "_base/summary/classes.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/summary/classes.html' is deprecated, extend '_base/summary/classes.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary/functions.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary/functions.html index e69de29b..31887e0a 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/summary/functions.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/summary/functions.html @@ -0,0 +1,11 @@ +{% extends "_base/summary/functions.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/summary/functions.html' is deprecated, extend '_base/summary/functions.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary/modules.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary/modules.html index e69de29b..31dcb5f0 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/summary/modules.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/summary/modules.html @@ -0,0 +1,11 @@ +{% extends "_base/summary/modules.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/summary/modules.html' is deprecated, extend '_base/summary/modules.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html new file mode 100644 index 00000000..cd4b05be --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html @@ -0,0 +1,11 @@ +{% extends "_base/docstring/attributes.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/attributes.html' is deprecated, extend '_base/docstring/attributes.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/other_parameters.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/other_parameters.html new file mode 100644 index 00000000..eae60aa7 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/other_parameters.html @@ -0,0 +1,11 @@ +{% extends "_base/docstring/other_parameters.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/other_parameters.html' is deprecated, extend '_base/docstring/other_parameters.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html new file mode 100644 index 00000000..f5745464 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html @@ -0,0 +1,11 @@ +{% extends "_base/docstring/parameters.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/parameters.html' is deprecated, extend '_base/docstring/parameters.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html new file mode 100644 index 00000000..361b9732 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html @@ -0,0 +1,11 @@ +{% extends "_base/docstring/raises.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/raises.html' is deprecated, extend '_base/docstring/raises.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html new file mode 100644 index 00000000..e5a115c1 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html @@ -0,0 +1,11 @@ +{% extends "_base/docstring/receives.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/receives.html' is deprecated, extend '_base/docstring/receives.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html new file mode 100644 index 00000000..0e7807ac --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html @@ -0,0 +1,11 @@ +{% extends "_base/docstring/returns.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/returns.html' is deprecated, extend '_base/docstring/returns.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html new file mode 100644 index 00000000..b7b937a9 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html @@ -0,0 +1,11 @@ +{% extends "_base/docstring/warns.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/warns.html' is deprecated, extend '_base/docstring/warns.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html new file mode 100644 index 00000000..ecd6f513 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html @@ -0,0 +1,11 @@ +{% extends "_base/docstring/yields.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/docstring/yields.html' is deprecated, extend '_base/docstring/yields.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/language.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/language.html new file mode 100644 index 00000000..c97d0c31 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/language.html @@ -0,0 +1,11 @@ +{% extends "_base/language.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/language.html' is deprecated, extend '_base/language.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/en.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/en.html new file mode 100644 index 00000000..eab87415 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/en.html @@ -0,0 +1,11 @@ +{% extends "_base/languages/en.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/languages/en.html' is deprecated, extend '_base/languages/en.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/ja.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/ja.html new file mode 100644 index 00000000..14319499 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/ja.html @@ -0,0 +1,11 @@ +{% extends "_base/languages/ja.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/languages/ja.html' is deprecated, extend '_base/languages/ja.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %} diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/zh.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/zh.html new file mode 100644 index 00000000..0b281195 --- /dev/null +++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/zh.html @@ -0,0 +1,11 @@ +{% extends "_base/languages/zh.html.jinja" %} + +{% block logs scoped %} + {{ super() }} + {# TODO: Switch to a warning after some time. #} + {{ log.info( + "DeprecationWarning: Extending '_base/languages/zh.html' is deprecated, extend '_base/languages/zh.html.jinja' instead. " ~ + "After some time, this message will be logged as a warning, causing strict builds to fail.", + once=True, + ) }} +{% endblock logs %}