+////
+///
+
[](){#option-separate_signature}
## `separate_signature`
diff --git a/docs/usage/customization.md b/docs/usage/customization.md
index 8239c2e9..d1e66b31 100644
--- a/docs/usage/customization.md
+++ b/docs/usage/customization.md
@@ -34,9 +34,10 @@ The following CSS classes are used in the generated HTML:
- `doc-class`: on `div`s containing a class
- `doc-function`: on `div`s containing a function
- `doc-module`: on `div`s containing a module
+ - `doc-type_alias`: on `div`s containing a type alias
- `doc-heading`: on objects headings
- `doc-object-name`: on `span`s wrapping objects names/paths in the heading
- - `doc-KIND-name`: as above, specific to the kind of object (module, class, function, attribute)
+ - `doc-KIND-name`: as above, specific to the kind of object (module, class, function, attribute, type_alias)
- `doc-contents`: on `div`s wrapping the docstring then the children (if any)
- `first`: same, but only on the root object's contents `div`
- `doc-labels`: on `span`s wrapping the object's labels
@@ -48,7 +49,7 @@ The following CSS classes are used in the generated HTML:
- `doc-symbol`: on `code` tags of symbol types
- `doc-symbol-heading`: on symbol types in headings
- `doc-symbol-toc`: on symbol types in the ToC
- - `doc-symbol-KIND`: specific to the kind of object (`module`, `class`, `function`, `method`, `attribute`)
+ - `doc-symbol-KIND`: specific to the kind of object (`module`, `class`, `function`, `method`, `attribute`, `type_alias`)
/// admonition | Example with colorful labels
type: example
@@ -90,33 +91,41 @@ by overriding the values of our CSS variables, for example:
```css title="docs/css/mkdocstrings.css"
[data-md-color-scheme="default"] {
--doc-symbol-parameter-fg-color: #df50af;
+ --doc-symbol-type_parameter-fg-color: #df50af;
--doc-symbol-attribute-fg-color: #0079ff;
--doc-symbol-function-fg-color: #00dfa2;
--doc-symbol-method-fg-color: #00dfa2;
--doc-symbol-class-fg-color: #d1b619;
+ --doc-symbol-type_alias-fg-color: #d1b619;
--doc-symbol-module-fg-color: #ff0060;
--doc-symbol-parameter-bg-color: #df50af1a;
+ --doc-symbol-type_parameter-bg-color: #df50af1a;
--doc-symbol-attribute-bg-color: #0079ff1a;
--doc-symbol-function-bg-color: #00dfa21a;
--doc-symbol-method-bg-color: #00dfa21a;
--doc-symbol-class-bg-color: #d1b6191a;
+ --doc-symbol-type_alias-bg-color: #d1b6191a;
--doc-symbol-module-bg-color: #ff00601a;
}
[data-md-color-scheme="slate"] {
--doc-symbol-parameter-fg-color: #ffa8cc;
+ --doc-symbol-type_parameter-fg-color: #ffa8cc;
--doc-symbol-attribute-fg-color: #963fb8;
--doc-symbol-function-fg-color: #6d67e4;
--doc-symbol-method-fg-color: #6d67e4;
--doc-symbol-class-fg-color: #46c2cb;
+ --doc-symbol-type_alias-fg-color: #46c2cb;
--doc-symbol-module-fg-color: #f2f7a1;
--doc-symbol-parameter-bg-color: #ffa8cc1a;
+ --doc-symbol-type_parameter-bg-color: #ffa8cc1a;
--doc-symbol-attribute-bg-color: #963fb81a;
--doc-symbol-function-bg-color: #6d67e41a;
--doc-symbol-method-bg-color: #6d67e41a;
--doc-symbol-class-bg-color: #46c2cb1a;
+ --doc-symbol-type_alias-bg-color: #46c2cb1a;
--doc-symbol-module-bg-color: #f2f7a11a;
}
```
@@ -129,17 +138,21 @@ otherwise just override the variables at root level:
```css title="docs/css/mkdocstrings.css"
:root {
--doc-symbol-parameter-fg-color: #df50af;
+ --doc-symbol-type_parameter-fg-color: #df50af;
--doc-symbol-attribute-fg-color: #0079ff;
--doc-symbol-function-fg-color: #00dfa2;
--doc-symbol-method-fg-color: #00dfa2;
--doc-symbol-class-fg-color: #d1b619;
+ --doc-symbol-type_alias-fg-color: #d1b619;
--doc-symbol-module-fg-color: #ff0060;
--doc-symbol-parameter-bg-color: #df50af1a;
+ --doc-symbol-type_parameter-bg-color: #df50af1a;
--doc-symbol-attribute-bg-color: #0079ff1a;
--doc-symbol-function-bg-color: #00dfa21a;
--doc-symbol-method-bg-color: #00dfa21a;
--doc-symbol-class-bg-color: #d1b6191a;
+ --doc-symbol-type_alias-bg-color: #d1b6191a;
--doc-symbol-module-bg-color: #ff00601a;
}
```
@@ -151,33 +164,41 @@ otherwise just override the variables at root level:
@@ -204,6 +225,10 @@ For example, to use single letters instead of truncated types:
content: "P";
}
+.doc-symbol-type_parameter::after {
+ content: "P";
+}
+
.doc-symbol-attribute::after {
content: "A";
}
@@ -220,6 +245,10 @@ For example, to use single letters instead of truncated types:
content: "C";
}
+.doc-symbol-type_alias::after {
+ content: "T";
+}
+
.doc-symbol-module::after {
content: "M";
}
@@ -234,6 +263,10 @@ For example, to use single letters instead of truncated types:
content: "P";
}
+ #preview-symbol-names .doc-symbol-type_parameter::after {
+ content: "P";
+ }
+
#preview-symbol-names .doc-symbol-attribute::after {
content: "A";
}
@@ -250,16 +283,22 @@ For example, to use single letters instead of truncated types:
content: "C";
}
+ #preview-symbol-names .doc-symbol-type_alias::after {
+ content: "T";
+ }
+
#preview-symbol-names .doc-symbol-module::after {
content: "M";
}
Parameter:
+
Type Parameter:
Attribute:
Function:
Method:
Class:
+
Type Alias:
Module:
@@ -324,6 +363,19 @@ Available context:
- `config`: The handler configuration (dictionary).
- `module`: The [Module][griffe.Module] instance.
+#### `type_alias.html`
+
+- `heading`: The class heading.
+- `labels`: The class labels.
+- `signature`: The class signature.
+- `contents`: The class contents: bases, docstring, source and children blocks.
+- `docstring`: The class docstring.
+
+Available context:
+
+- `config`: The handler configuration (dictionary).
+- `type_alias`: The [TypeAlias][griffe.TypeAlias] instance.
+
#### `class.html`
- `heading`: The class heading.
@@ -379,6 +431,8 @@ In `docstring/attributes.html`,
`docstring/raises.html`,
`docstring/receives.html`,
`docstring/returns.html`,
+`docstring/type_aliases.html`,
+`docstring/type_parameters.html`,
`docstring/warns.html`,
and `docstring/yields.html`:
diff --git a/duties.py b/duties.py
index 2f09340f..0fa73ea0 100644
--- a/duties.py
+++ b/duties.py
@@ -93,7 +93,7 @@ def check_quality(ctx: Context) -> None:
)
-@duty
+@duty(skip_if=sys.version_info < (3, 13), skip_reason=pyprefix("Skipped: docs require modern generics syntax"))
def check_docs(ctx: Context) -> None:
"""Check if the documentation builds correctly."""
Path("htmlcov").mkdir(parents=True, exist_ok=True)
@@ -128,7 +128,7 @@ def check_api(ctx: Context, *cli_args: str) -> None:
)
-@duty
+@duty(skip_if=sys.version_info < (3, 13), skip_reason=pyprefix("Skipped: docs require modern generics syntax"))
def docs(ctx: Context, *cli_args: str, host: str = "127.0.0.1", port: int = 8000) -> None:
"""Serve the documentation (localhost:8000).
@@ -144,7 +144,7 @@ def docs(ctx: Context, *cli_args: str, host: str = "127.0.0.1", port: int = 8000
)
-@duty
+@duty(skip_if=sys.version_info < (3, 13), skip_reason=pyprefix("Skipped: docs require modern generics syntax"))
def docs_deploy(ctx: Context, *, force: bool = False) -> None:
"""Deploy the documentation to GitHub pages.
diff --git a/mkdocs.yml b/mkdocs.yml
index 0199ea9a..0796e003 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -166,6 +166,7 @@ plugins:
line_length: 88
merge_init_into_class: true
parameter_headings: true
+ type_parameter_headings: true
preload_modules: [mkdocstrings]
relative_crossrefs: true
scoped_crossrefs: true
@@ -175,6 +176,7 @@ plugins:
show_root_heading: true
show_root_full_path: false
show_signature_annotations: true
+ show_signature_type_parameters: true
show_source: false
show_symbol_type_heading: true
show_symbol_type_toc: true
diff --git a/pyproject.toml b/pyproject.toml
index 45430d46..ad0c852c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -33,7 +33,7 @@ classifiers = [
dependencies = [
"mkdocstrings>=0.30",
"mkdocs-autorefs>=1.4",
- "griffe>=1.12.1",
+ "griffe>=1.13",
"typing-extensions>=4.0; python_version < '3.11'",
]
diff --git a/src/mkdocstrings_handlers/python/__init__.py b/src/mkdocstrings_handlers/python/__init__.py
index faa9b9f4..7e12fa73 100644
--- a/src/mkdocstrings_handlers/python/__init__.py
+++ b/src/mkdocstrings_handlers/python/__init__.py
@@ -22,12 +22,14 @@
do_as_classes_section,
do_as_functions_section,
do_as_modules_section,
+ do_as_type_aliases_section,
do_backlink_tree,
do_crossref,
do_filter_objects,
do_format_attribute,
do_format_code,
do_format_signature,
+ do_format_type_alias,
do_get_template,
do_multi_crossref,
do_order_members,
@@ -55,12 +57,14 @@
"do_as_classes_section",
"do_as_functions_section",
"do_as_modules_section",
+ "do_as_type_aliases_section",
"do_backlink_tree",
"do_crossref",
"do_filter_objects",
"do_format_attribute",
"do_format_code",
"do_format_signature",
+ "do_format_type_alias",
"do_get_template",
"do_multi_crossref",
"do_order_members",
diff --git a/src/mkdocstrings_handlers/python/_internal/config.py b/src/mkdocstrings_handlers/python/_internal/config.py
index 952fc159..62c124ba 100644
--- a/src/mkdocstrings_handlers/python/_internal/config.py
+++ b/src/mkdocstrings_handlers/python/_internal/config.py
@@ -423,6 +423,15 @@ class SummaryOption:
),
] = False
+ type_aliases: Annotated[
+ bool,
+ _Field(
+ group="members",
+ parent="summary",
+ description="Whether to render summaries of type aliases.",
+ ),
+ ] = False
+
# YORE: EOL 3.9: Replace `**_dataclass_options` with `frozen=True, kw_only=True` within line.
@dataclass(**_dataclass_options) # type: ignore[call-overload]
@@ -797,6 +806,22 @@ class PythonInputOptions:
),
] = True
+ show_docstring_type_aliases: Annotated[
+ bool,
+ _Field(
+ group="docstrings",
+ description="Whether to display the 'Type Aliases' section in the object's docstring.",
+ ),
+ ] = True
+
+ show_docstring_type_parameters: Annotated[
+ bool,
+ _Field(
+ group="docstrings",
+ description="Whether to display the 'Type Parameters' section in the object's docstring.",
+ ),
+ ] = True
+
show_docstring_warns: Annotated[
bool,
_Field(
@@ -888,6 +913,14 @@ class PythonInputOptions:
),
] = False
+ show_signature_type_parameters: Annotated[
+ bool,
+ _Field(
+ group="signatures",
+ description="Show the type parameters in generic classes, methods, functions and type aliases signatures.",
+ ),
+ ] = False
+
show_signature: Annotated[
bool,
_Field(
@@ -960,6 +993,14 @@ class PythonInputOptions:
),
] = ""
+ type_parameter_headings: Annotated[
+ bool,
+ _Field(
+ group="headings",
+ description="Whether to render headings for type parameters (therefore showing type parameters in the ToC).",
+ ),
+ ] = False
+
unwrap_annotated: Annotated[
bool,
_Field(
@@ -1001,9 +1042,15 @@ def coerce(cls, **data: Any) -> MutableMapping[str, Any]:
if "summary" in data:
summary = data["summary"]
if summary is True:
- summary = SummaryOption(attributes=True, functions=True, classes=True, modules=True)
+ summary = SummaryOption(attributes=True, functions=True, classes=True, modules=True, type_aliases=True)
elif summary is False:
- summary = SummaryOption(attributes=False, functions=False, classes=False, modules=False)
+ summary = SummaryOption(
+ attributes=False,
+ functions=False,
+ classes=False,
+ modules=False,
+ type_aliases=False,
+ )
else:
summary = SummaryOption(**summary)
data["summary"] = summary
@@ -1028,7 +1075,7 @@ class PythonOptions(PythonInputOptions): # type: ignore[override,unused-ignore]
"""A list of filters, or `"public"`."""
summary: SummaryOption = field(default_factory=SummaryOption)
- """Whether to render summaries of modules, classes, functions (methods) and attributes."""
+ """Whether to render summaries of modules, classes, functions (methods), attributes and type aliases."""
@classmethod
def coerce(cls, **data: Any) -> MutableMapping[str, Any]:
diff --git a/src/mkdocstrings_handlers/python/_internal/handler.py b/src/mkdocstrings_handlers/python/_internal/handler.py
index 66bee9f3..c62088b3 100644
--- a/src/mkdocstrings_handlers/python/_internal/handler.py
+++ b/src/mkdocstrings_handlers/python/_internal/handler.py
@@ -322,12 +322,14 @@ def update_env(self, config: Any) -> None: # noqa: ARG002
self.env.filters["format_code"] = rendering.do_format_code
self.env.filters["format_signature"] = rendering.do_format_signature
self.env.filters["format_attribute"] = rendering.do_format_attribute
+ self.env.filters["format_type_alias"] = rendering.do_format_type_alias
self.env.filters["filter_objects"] = rendering.do_filter_objects
self.env.filters["stash_crossref"] = rendering.do_stash_crossref
self.env.filters["get_template"] = rendering.do_get_template
self.env.filters["as_attributes_section"] = rendering.do_as_attributes_section
self.env.filters["as_functions_section"] = rendering.do_as_functions_section
self.env.filters["as_classes_section"] = rendering.do_as_classes_section
+ self.env.filters["as_type_aliases_section"] = rendering.do_as_type_aliases_section
self.env.filters["as_modules_section"] = rendering.do_as_modules_section
self.env.filters["backlink_tree"] = rendering.do_backlink_tree
self.env.globals["AutorefsHook"] = rendering.AutorefsHook
diff --git a/src/mkdocstrings_handlers/python/_internal/rendering.py b/src/mkdocstrings_handlers/python/_internal/rendering.py
index 0e5f3d39..99aeb014 100644
--- a/src/mkdocstrings_handlers/python/_internal/rendering.py
+++ b/src/mkdocstrings_handlers/python/_internal/rendering.py
@@ -28,7 +28,10 @@
DocstringSectionClasses,
DocstringSectionFunctions,
DocstringSectionModules,
+ DocstringSectionTypeAliases,
+ DocstringTypeAlias,
Object,
+ TypeAlias,
)
from jinja2 import TemplateNotFound, pass_context, pass_environment
from markupsafe import Markup
@@ -160,8 +163,10 @@ def do_format_signature(
The same code, formatted.
"""
env = context.environment
+ # YORE: Bump 2: Replace `do_get_template(env, "type_parameters")` with `"type_parameters.html.jinja"` within line.
+ type_params_template = env.get_template(do_get_template(env, "type_parameters"))
# YORE: Bump 2: Replace `do_get_template(env, "signature")` with `"signature.html.jinja"` within line.
- template = env.get_template(do_get_template(env, "signature"))
+ signature_template = env.get_template(do_get_template(env, "signature"))
if annotations is None:
new_context = context.parent
@@ -169,7 +174,9 @@ def do_format_signature(
new_context = dict(context.parent)
new_context["config"] = replace(new_context["config"], show_signature_annotations=annotations)
- signature = template.render(new_context, function=function, signature=True)
+ signature = type_params_template.render(context.parent, obj=function, signature=True)
+ signature += signature_template.render(new_context, function=function, signature=True)
+
signature = _format_signature(callable_path, signature, line_length)
signature = str(
env.filters["highlight"](
@@ -259,6 +266,67 @@ def do_format_attribute(
return signature
+@pass_context
+def do_format_type_alias(
+ context: Context,
+ type_alias_path: Markup,
+ type_alias: TypeAlias,
+ line_length: int,
+ *,
+ crossrefs: bool = False, # noqa: ARG001
+) -> str:
+ """Format a type alias.
+
+ Parameters:
+ context: Jinja context, passed automatically.
+ type_alias_path: The path of the type alias we render the signature of.
+ type_alias: The type alias we render the signature of.
+ line_length: The line length.
+ crossrefs: Whether to cross-reference types in the signature.
+
+ Returns:
+ The same code, formatted.
+ """
+ env = context.environment
+ # YORE: Bump 2: Replace `do_get_template(env, "type_parameters")` with `"type_parameters.html.jinja"` within line.
+ type_params_template = env.get_template(do_get_template(env, "type_parameters"))
+ # YORE: Bump 2: Replace `do_get_template(env, "expression")` with `"expression.html.jinja"` within line.
+ expr_template = env.get_template(do_get_template(env, "expression"))
+
+ signature = str(type_alias_path).strip()
+ signature += type_params_template.render(context.parent, obj=type_alias, signature=True)
+ value = expr_template.render(context.parent, expression=type_alias.value, signature=True)
+ signature += f" = {value}"
+
+ signature = do_format_code(signature, line_length)
+ signature = str(
+ env.filters["highlight"](
+ Markup.escape(signature),
+ language="python",
+ inline=False,
+ classes=["doc-signature"],
+ linenums=False,
+ ),
+ )
+
+ # Since we highlight the signature without `type`,
+ # Pygments sees only an assignment, not a type alias definition
+ # (at the moment it does not understand type alias definitions anyway).
+ # The result is that the type alias name is not parsed as such,
+ # but instead as a regular name: `n` CSS class instead of `nc`.
+ # To fix it, we replace the first occurrence of an `n` CSS class
+ # with an `nc` one, unless we found `nc` already.
+ if not re.search(r'', signature):
+ signature = re.sub(r'', '', signature, count=1)
+
+ if stash := env.filters["stash_crossref"].stash:
+ for key, value in stash.items():
+ signature = re.sub(rf"\b{key}\b", value, signature)
+ stash.clear()
+
+ return signature
+
+
def do_order_members(
members: Sequence[Object | Alias],
order: Order | list[Order],
@@ -592,7 +660,7 @@ def do_get_template(env: Environment, obj: str | Object) -> str:
extra_data = getattr(obj, "extra", {}).get("mkdocstrings", {})
if name := extra_data.get("template", ""):
return name
- name = obj.kind.value
+ name = obj.kind.value.replace(" ", "_")
# YORE: Bump 2: Replace block with `return f"{name}.html.jinja"`.
try:
template = env.get_template(f"{name}.html")
@@ -732,6 +800,34 @@ def do_as_modules_section(
)
+@pass_context
+def do_as_type_aliases_section(
+ context: Context, # noqa: ARG001
+ type_aliases: Sequence[TypeAlias],
+ *,
+ check_public: bool = True,
+) -> DocstringSectionTypeAliases:
+ """Build a type aliases section from a list of type aliases.
+
+ Parameters:
+ type_aliases: The type aliases to build the section from.
+ check_public: Whether to check if the type_alias is public.
+
+ Returns:
+ A type aliases docstring section.
+ """
+ return DocstringSectionTypeAliases(
+ [
+ DocstringTypeAlias(
+ name=type_alias.name,
+ description=type_alias.docstring.value.split("\n", 1)[0] if type_alias.docstring else "",
+ )
+ for type_alias in type_aliases
+ if not check_public or type_alias.is_public
+ ],
+ )
+
+
class AutorefsHook(AutorefsHookInterface):
"""Autorefs hook.
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja
index 0538aa9a..3be0a33a 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja
@@ -57,6 +57,26 @@ Context:
{% endif %}
{% endwith %}
+ {% with type_aliases = obj.type_aliases|filter_objects(
+ filters=config.filters,
+ members_list=members_list,
+ inherited_members=config.inherited_members,
+ keep_no_docstrings=config.show_if_no_docstring,
+ ) %}
+ {% if type_aliases %}
+ {% if config.show_category_heading %}
+ {% filter heading(heading_level, id=html_id ~ "-type_aliases") %}Type Aliases{% endfilter %}
+ {% endif %}
+ {% with heading_level = heading_level + extra_level %}
+ {% for type_alias in type_aliases|order_members(config.members_order, members_list) %}
+ {% if config.filters == "public" or members_list is not none or (not type_alias.is_imported or type_alias.is_public) %}
+ {% include type_alias|get_template with context %}
+ {% endif %}
+ {% endfor %}
+ {% endwith %}
+ {% endif %}
+ {% endwith %}
+
{% with classes = obj.classes|filter_objects(
filters=config.filters,
members_list=members_list,
@@ -143,6 +163,11 @@ Context:
{% include attribute|get_template with context %}
{% endwith %}
+ {% elif child.is_type_alias %}
+ {% with type_alias = child %}
+ {% include type_alias|get_template with context %}
+ {% endwith %}
+
{% elif child.is_class %}
{% with class = child %}
{% include class|get_template with context %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
index f366f497..50385f41 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
@@ -54,12 +54,18 @@ Context:
{{ class_name }}
{% elif config.merge_init_into_class and "__init__" in all_members %}
{% with function = all_members["__init__"] %}
- {%+ filter highlight(language="python", inline=True) -%}
+ {%+ filter highlight(language="python", inline=True) %}
+ {{ class_name -}}
+ {%- with obj = function -%}
+ {#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
+ {%- include "type_parameters"|get_template with context -%}
+ {%- endwith -%}
{#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
- {{ class_name }}{% include "signature"|get_template with context %}
- {%- endfilter %}
+ {%- include "signature"|get_template with context -%}
+ {% endfilter %}
{% endwith %}
{% else %}
+ {# TODO: Maybe render type parameters here. #}
{{ class_name }}
{% endif %}
{% endblock heading %}
@@ -83,26 +89,30 @@ Context:
This block renders the signature for the class.
Overloads of the `__init__` method are rendered if `merge_init_into_class` is enabled.
The actual `__init__` method signature is only rendered if `separate_signature` is also enabled.
+
+ If the class is generic, but the `__init__` method isn't or `merge_init_into_class` is disabled,
+ the class signature is rendered if `separate_signature` and `show_signature_type_parameters` are enabled.
+
+ If the `__init__` method or any overloads are generic, they are rendered as methods if
+ `merge_init_into_class`, `separate_signature` and `show_signature_type_parameters` are enabled.
-#}
- {% if config.merge_init_into_class %}
- {% if "__init__" in all_members %}
- {% with function = all_members["__init__"] %}
- {% if function.overloads and config.show_overloads %}
-
+ {% if type_parameter.constraints %}
+
+ {{ lang.t("CONSTRAINTS:") }}
+ {% for constraint in type_parameter.constraints -%}
+ {%- with expression = constraint -%}
+ {% include "expression"|get_template with context %}
+ {%- endwith -%}
+ {%- if not loop.last %}, {% endif -%}
+ {% endfor %}
+
+ {% elif type_parameter.bound %}
+
+ {{ lang.t("BOUND:") }}
+ {% with expression = type_parameter.bound %}
+ {% include "expression"|get_template with context %}
+ {% endwith %}
+
+ {% endif %}
+ {% if type_parameter.default %}
+
+ {{ lang.t("DEFAULT:") }}
+ {% with expression = type_parameter.default %}
+ {% include "expression"|get_template with context %}
+ {% endwith %}
+
+ {% endif %}
+
+
+
+ {% endfor %}
+
+
+ {% endblock spacy_style %}
+{% endif %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/expression.html.jinja
index d49e43be..54781739 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/expression.html.jinja
@@ -2,6 +2,10 @@
This template renders a Griffe expression,
which is a tree-like structure representing a Python expression.
+
+Context:
+ expression (griffe.Expr): The expression to render.
+ config (dict): The configuration options.
-#}
{% block logs scoped %}
@@ -16,6 +20,25 @@ which is a tree-like structure representing a Python expression.
This macro outputs a cross-reference to the given name.
+ Parameters:
+ name (griffe.ExprName): The name to cross-reference.
+ annotation_path (str): Either "brief", "source", or "full".
+
+ Returns:
+ Either a cross-reference (using an autoref element) or the name itself.
+ -#}
+ {%- if name.classname == "ExprName" and name.is_type_parameter -%}
+ {{ type_param_crossref(name) }}
+ {%- else -%}
+ {{ object_crossref(name, annotation_path) }}
+ {%- endif -%}
+{%- endmacro -%}
+
+{%- macro object_crossref(name, annotation_path) -%}
+ {#- Output a cross-reference to a Griffe object.
+
+ This macro outputs a cross-reference to the given name.
+
Parameters:
name (griffe.ExprName): The name to cross-reference.
annotation_path (str): Either "brief", "source", or "full".
@@ -50,6 +73,26 @@ which is a tree-like structure representing a Python expression.
{%- endwith -%}
{%- endmacro -%}
+{%- macro type_param_crossref(name) -%}
+ {#- Render a cross-reference to a type parameter heading.
+
+ Parameters:
+ name (griffe.ExprName): The name to cross-reference.
+
+ Returns:
+ The autorefs cross-reference, or the type parameter name.
+ -#}
+ {%- if not signature -%}
+ {{ name.name }}
+ {%- elif config.signature_crossrefs -%}
+ {%- filter stash_crossref(length=name.name|length) -%}
+ {{ name.name }}
+ {%- endfilter -%}
+ {%- else -%}
+ {{ name.name }}
+ {%- endif -%}
+{%- endmacro -%}
+
{%- macro param_crossref(expression) -%}
{#- Render a cross-reference to a parameter heading.
@@ -89,7 +132,14 @@ which is a tree-like structure representing a Python expression.
{%- 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.first.is_type_parameter -%}
+ {{ type_param_crossref(expression.first) }}
+ {%- for element in expression -%}
+ {%- if not loop.first -%}
+ {{ render(element, "brief") }}
+ {%- endif -%}
+ {%- endfor -%}
+ {%- elif annotations_path == "brief" -%}
{%- if expression.last.is_enum_value -%}
{{ crossref(expression.last.parent, "brief", backlink_type) }}.value
{%- else -%}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja
index 4c84006e..708fde68 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja
@@ -61,8 +61,10 @@ Context:
{{ function_name }}
{% else %}
{%+ filter highlight(language="python", inline=True) -%}
- {#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
- {{ function_name }}{% include "signature"|get_template with context %}
+ {{ function_name }}
+ {#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within block. -#}
+ {%- include "type_parameters"|get_template with context -%}
+ {%- include "signature"|get_template with context -%}
{%- endfilter %}
{% endif %}
{% endblock heading %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html.jinja
index bcdcce2d..a2e38b7c 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html.jinja
@@ -10,8 +10,13 @@
{% macro t(key) %}{{ {
"ATTRIBUTE": "ATTRIBUTE",
"Attributes:": "Attributes:",
+ "BOUND:": "BOUND:",
+ "Bound or Constraints": "Bound or Constraints",
"Classes:": "Classes:",
+ "Class Type Parameters:": "Class Type Parameters:",
+ "CLASS TYPE PARAMETER": "CLASS TYPE PARAMETER",
"CLASS": "CLASS",
+ "CONSTRAINTS:": "CONSTRAINTS:",
"DEFAULT:": "DEFAULT:",
"Default": "Default",
"default:": "default:",
@@ -20,6 +25,8 @@
"Examples:": "Examples:",
"Functions:": "Functions:",
"FUNCTION": "FUNCTION",
+ "Init Type Parameters:": "Init Type Parameters:",
+ "INIT TYPE PARAMETER": "INIT TYPE PARAMETER",
"Methods:": "Methods:",
"METHOD": "METHOD",
"Modules:": "Modules:",
@@ -38,6 +45,10 @@
"Source code in": "Source code in",
"TYPE:": "TYPE:",
"Type": "Type",
+ "Type Aliases:": "Type Aliases:",
+ "TYPE ALIAS": "TYPE ALIAS",
+ "Type Parameters:": "Type Parameters:",
+ "TYPE PARAMETER": "TYPE PARAMETER",
"WARNS": "WARNS",
"Warns:": "Warns:",
"YIELDS": "YIELDS",
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html.jinja
index 0393ca03..be0dd62b 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html.jinja
@@ -10,8 +10,13 @@
{% macro t(key) %}{{ {
"ATTRIBUTE": "属性",
"Attributes:": "属性:",
+ "BOUND:": "BOUND:",
+ "Bound or Constraints": "Bound or Constraints",
"Classes:": "クラス:",
- "CLASS": "クラス",
+ "Class Type Parameters:": "Class Type Parameters:",
+ "CLASS TYPE PARAMETER": "CLASS TYPE PARAMETER",
+ "CLASS": "CLASS",
+ "CONSTRAINTS:": "CONSTRAINTS:",
"DEFAULT:": "デフォルト:",
"Default": "デフォルト",
"default:": "デフォルト:",
@@ -20,6 +25,8 @@
"Examples:": "例:",
"Functions:": "関数:",
"FUNCTION": "関数",
+ "Init Type Parameters:": "Init Type Parameters:",
+ "INIT TYPE PARAMETER": "INIT TYPE PARAMETER",
"Methods:": "メソッド:",
"METHOD": "メソッド",
"Modules:": "モジュール:",
@@ -38,6 +45,10 @@
"Source code in": "ソースコード位置:",
"TYPE:": "タイプ:",
"Type": "タイプ",
+ "Type Aliases:": "Type Aliases:",
+ "TYPE ALIAS": "TYPE ALIAS",
+ "Type Parameters:": "Type Parameters:",
+ "TYPE PARAMETER": "TYPE PARAMETER",
"WARNS": "警告",
"Warns:": "警告:",
"YIELDS": "返す",
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html.jinja
index e57169ad..3f1e3481 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html.jinja
@@ -10,8 +10,13 @@
{% macro t(key) %}{{ {
"ATTRIBUTE": "属性",
"Attributes:": "属性:",
+ "BOUND:": "BOUND:",
+ "Bound or Constraints": "Bound or Constraints",
"Classes:": "类:",
- "CLASS": "类",
+ "Class Type Parameters:": "Class Type Parameters:",
+ "CLASS TYPE PARAMETER": "CLASS TYPE PARAMETER",
+ "CLASS": "CLASS",
+ "CONSTRAINTS:": "CONSTRAINTS:",
"DEFAULT:": "默认:",
"Default": "默认",
"default:": "默认:",
@@ -20,6 +25,8 @@
"Examples:": "示例:",
"Functions:": "函数:",
"FUNCTION": "函数",
+ "Init Type Parameters:": "Init Type Parameters:",
+ "INIT TYPE PARAMETER": "INIT TYPE PARAMETER",
"Methods:": "方法:",
"METHOD": "方法",
"Modules:": "模块:",
@@ -38,6 +45,10 @@
"Source code in": "源代码位于:",
"TYPE:": "类型:",
"Type": "类型",
+ "Type Aliases:": "Type Aliases:",
+ "TYPE ALIAS": "TYPE ALIAS",
+ "Type Parameters:": "Type Parameters:",
+ "TYPE PARAMETER": "TYPE PARAMETER",
"Warns:": "警告:",
"WARNS": "警告",
"YIELDS": "产生",
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/summary.html.jinja
index 78b0b9d7..477d0b0d 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/summary.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/summary.html.jinja
@@ -13,6 +13,11 @@
{% include "summary/modules"|get_template with context %}
{% endif %}
+ {% if config.summary.type_aliases %}
+ {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
+ {% include "summary/type_aliases"|get_template with context %}
+ {% endif %}
+
{% if config.summary.classes %}
{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
{% include "summary/classes"|get_template with context %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary/type_aliases.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary/type_aliases.html
new file mode 100644
index 00000000..68554b8c
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/summary/type_aliases.html
@@ -0,0 +1,10 @@
+{# YORE: Bump 2: Remove file. #}
+{% extends "_base/summary/type_aliases.html.jinja" %}
+
+{% block logs scoped %}
+ {{ super() }}
+ {{ log.warning(
+ "DeprecationWarning: Extending '_base/type_aliases/classes.html' is deprecated, extend '_base/type_aliases/classes.html.jinja' instead.",
+ once=True,
+ ) }}
+{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary/type_aliases.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/summary/type_aliases.html.jinja
new file mode 100644
index 00000000..9ebc2b23
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/summary/type_aliases.html.jinja
@@ -0,0 +1,24 @@
+{#- Summary of type aliases. -#}
+
+{% block logs scoped %}
+ {#- Logging block.
+
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
+ -#}
+{% endblock logs %}
+
+{% if not obj.docstring.parsed | selectattr("kind.value", "eq", "type aliases") | list %}
+ {% with section = obj.type_aliases
+ |filter_objects(
+ filters=config.filters,
+ members_list=members_list,
+ inherited_members=config.inherited_members,
+ keep_no_docstrings=config.show_if_no_docstring,
+ )
+ |order_members("alphabetical", members_list)
+ |as_type_aliases_section(check_public=not members_list)
+ %}
+ {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
+ {% if section %}{% include "docstring/type_aliases"|get_template with context %}{% endif %}
+ {% endwith %}
+{% endif %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/type_alias.html b/src/mkdocstrings_handlers/python/templates/material/_base/type_alias.html
new file mode 100644
index 00000000..d811f7f3
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/type_alias.html
@@ -0,0 +1,10 @@
+{# YORE: Bump 2: Remove file. #}
+{% extends "_base/type_alias.html.jinja" %}
+
+{% block logs scoped %}
+ {{ super() }}
+ {{ log.warning(
+ "DeprecationWarning: Extending '_base/type_alias.html' is deprecated, extend '_base/type_alias.html.jinja' instead. ",
+ once=True,
+ ) }}
+{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/type_alias.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/type_alias.html.jinja
new file mode 100644
index 00000000..bb7d4d71
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/type_alias.html.jinja
@@ -0,0 +1,120 @@
+{#- Template for Python type aliases.
+
+This template renders a Python type alias.
+
+Context:
+ type_alias (griffe.TypeAlias): The type alias to render.
+ root (bool): Whether this is the root object, injected with `:::` in a Markdown page.
+ heading_level (int): The HTML heading level to use.
+ config (dict): The configuration options.
+-#}
+
+{% block logs scoped %}
+ {#- Logging block.
+
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
+ -#}
+ {{ log.debug("Rendering " + type_alias.path) }}
+{% endblock logs %}
+
+
+ {% with obj = type_alias, html_id = type_alias.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 type_alias_name = type_alias.path if show_full_path else type_alias.name %}
+
+ {% if not root or config.show_root_heading %}
+ {% filter heading(
+ heading_level,
+ role="typealias",
+ id=html_id,
+ class="doc doc-heading",
+ toc_label=(' '|safe if config.show_symbol_type_toc else '') + type_alias.name,
+ ) %}
+
+ {% block heading scoped %}
+ {#- Heading block.
+
+ This block renders the heading for the type alias.
+ -#}
+ {% if config.show_symbol_type_heading %}{% endif %}
+ {% if config.separate_signature %}
+ {{ type_alias_name }}
+ {% else %}
+ {%+ filter highlight(language="python", inline=True) %}
+ {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
+ {{ type_alias_name }}{% include "type_parameters"|get_template with context %} = {{ type_alias.value }}
+ {% endfilter %}
+ {% endif %}
+ {% endblock heading %}
+
+ {% block labels scoped %}
+ {#- Labels block.
+
+ This block renders the labels for the type alias.
+ -#}
+ {% with labels = type_alias.labels %}
+ {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
+ {% include "labels"|get_template with context %}
+ {% endwith %}
+ {% endblock labels %}
+
+ {% endfilter %}
+
+ {% block signature scoped %}
+ {#- Signature block.
+
+ This block renders the signature for the type alias.
+ -#}
+ {% if config.separate_signature %}
+ {% filter format_type_alias(type_alias, config.line_length, crossrefs=config.signature_crossrefs) %}
+ {{ type_alias.name }}
+ {% endfilter %}
+ {% endif %}
+ {% endblock signature %}
+
+ {% else %}
+ {% if config.show_root_toc_entry %}
+ {% filter heading(heading_level,
+ role="typealias",
+ id=html_id,
+ toc_label=(' '|safe if config.show_symbol_type_toc else '') + type_alias.name,
+ hidden=True,
+ ) %}
+ {% endfilter %}
+ {% endif %}
+ {% set heading_level = heading_level - 1 %}
+ {% endif %}
+
+
+ {% block contents scoped %}
+ {#- Contents block.
+
+ This block renders the contents of the type alias.
+ It contains other blocks that users can override.
+ Overriding the contents block allows to rearrange the order of the blocks.
+ -#}
+ {% block docstring scoped %}
+ {#- Docstring block.
+
+ This block renders the docstring for the type alias.
+ -#}
+ {% with docstring_sections = type_alias.docstring.parsed %}
+ {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
+ {% include "docstring"|get_template with context %}
+ {% endwith %}
+ {% endblock docstring %}
+ {% endblock contents %}
+
+
+ {% endwith %}
+
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/type_parameters.html b/src/mkdocstrings_handlers/python/templates/material/_base/type_parameters.html
new file mode 100644
index 00000000..782b1e8b
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/type_parameters.html
@@ -0,0 +1,10 @@
+{# YORE: Bump 2: Remove file. #}
+{% extends "_base/type_parameters.html.jinja" %}
+
+{% block logs scoped %}
+ {{ super() }}
+ {{ log.warning(
+ "DeprecationWarning: Extending '_base/type_parameters.html' is deprecated, extend '_base/type_parameters.html.jinja' instead.",
+ once=True,
+ ) }}
+{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/type_parameters.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/type_parameters.html.jinja
new file mode 100644
index 00000000..59fad354
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/type_parameters.html.jinja
@@ -0,0 +1,89 @@
+{#- Template for type parameters.
+
+This template renders the type parameters of a generic obj.
+It iterates over the type parameters of the object to rebuild the signature.
+The signature is the list of type parameters of a generic object, including their names, default values, and bound or constraints.
+
+Context:
+ obj (griffe.Object): The object to render.
+ config (dict): The configuration options.
+-#}
+
+{%- if config.show_signature_type_parameters -%}
+ {%- block logs scoped -%}
+ {#- Logging block.
+
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
+ -#}
+ {{ log.debug("Rendering type parameters") }}
+ {%- endblock logs -%}
+
+ {%- with ns = namespace(annotation="", equal="=", default=False) -%}
+ {%- if obj.is_generic -%}
+ [
+ {%- for type_parameter in obj.type_parameters -%}
+ {#- Prepare type bound or constraints. -#}
+ {%- if config.show_signature_annotations and type_parameter.annotation is not none -%}
+ {%- set ns.equal = " = " -%}
+ {%- if config.separate_signature and config.signature_crossrefs -%}
+ {%- with expression = type_parameter.annotation -%}
+ {#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
+ {%- set ns.annotation -%}: {% include "expression"|get_template with context %}{%- endset -%}
+ {%- endwith -%}
+ {%- else -%}
+ {%- set ns.annotation = ": " + type_parameter.annotation|safe -%}
+ {%- endif -%}
+ {%- else -%}
+ {%- set ns.equal = "=" -%}
+ {%- set ns.annotation = "" -%}
+ {%- endif -%}
+
+ {#- Prepare default value. -#}
+ {%- if type_parameter.default is not none -%}
+ {%- set ns.default = True -%}
+ {%- else -%}
+ {%- set ns.default = False -%}
+ {%- endif -%}
+
+ {#- Prepare name. -#}
+ {%- set type_param_prefix -%}
+ {%- if type_parameter.kind == "type-var-tuple" -%}
+ *
+ {%- elif type_parameter.kind == "param-spec" -%}
+ **
+ {%- endif -%}
+ {%- endset -%}
+
+ {#- Render type parameter name with optional cross-reference to its heading. -#}
+ {{ type_param_prefix }}
+ {%- if config.separate_signature and config.type_parameter_headings and config.signature_crossrefs -%}
+ {%- filter stash_crossref(length=type_parameter.name|length) -%}
+ {{ type_parameter.name }}
+ {%- endfilter -%}
+ {%- else -%}
+ {{ type_parameter.name }}
+ {%- endif -%}
+
+ {#- Render type parameter bound or constraints. -#}
+ {{ ns.annotation }}
+
+ {#- Render type parameter default value. -#}
+ {%- if ns.default -%}
+ {{ ns.equal }}
+ {%- if config.signature_crossrefs and config.separate_signature -%}
+ {%- with expression = type_parameter.default -%}
+ {#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
+ {%- include "expression"|get_template with context -%}
+ {%- endwith -%}
+ {%- else -%}
+ {{ type_parameter.default|safe }}
+ {%- endif -%}
+ {%- endif -%}
+
+ {%- if not loop.last %}, {% endif -%}
+ {%- endfor -%}
+ ]
+ {%- endif -%}
+
+ {%- endwith -%}
+{%- endif -%}
diff --git a/src/mkdocstrings_handlers/python/templates/material/docstring/type_aliases.html b/src/mkdocstrings_handlers/python/templates/material/docstring/type_aliases.html
new file mode 100644
index 00000000..78bd497a
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/docstring/type_aliases.html
@@ -0,0 +1 @@
+{% extends "_base/docstring/type_aliases.html.jinja" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/docstring/type_aliases.html.jinja b/src/mkdocstrings_handlers/python/templates/material/docstring/type_aliases.html.jinja
new file mode 100644
index 00000000..78bd497a
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/docstring/type_aliases.html.jinja
@@ -0,0 +1 @@
+{% extends "_base/docstring/type_aliases.html.jinja" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/docstring/type_parameters.html b/src/mkdocstrings_handlers/python/templates/material/docstring/type_parameters.html
new file mode 100644
index 00000000..223fbb04
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/docstring/type_parameters.html
@@ -0,0 +1 @@
+{% extends "_base/docstring/type_parameters.html.jinja" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/docstring/type_parameters.html.jinja b/src/mkdocstrings_handlers/python/templates/material/docstring/type_parameters.html.jinja
new file mode 100644
index 00000000..223fbb04
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/docstring/type_parameters.html.jinja
@@ -0,0 +1 @@
+{% extends "_base/docstring/type_parameters.html.jinja" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/style.css b/src/mkdocstrings_handlers/python/templates/material/style.css
index b8c3e639..7475f5cd 100644
--- a/src/mkdocstrings_handlers/python/templates/material/style.css
+++ b/src/mkdocstrings_handlers/python/templates/material/style.css
@@ -26,12 +26,14 @@
}
/* Defaults in Spacy table style. */
-.doc-param-default {
+.doc-param-default,
+.doc-type_param-default {
float: right;
}
/* Parameter headings must be inline, not blocks. */
-.doc-heading-parameter {
+.doc-heading-parameter,
+.doc-heading-type_parameter {
display: inline;
}
@@ -41,7 +43,8 @@
}
/* Prefer space on the right, not the left of parameter permalinks. */
-.doc-heading-parameter .headerlink {
+.doc-heading-parameter .headerlink,
+.doc-heading-type_parameter .headerlink {
margin-left: 0 !important;
margin-right: 0.2rem;
}
@@ -77,33 +80,41 @@
:root, :host,
[data-md-color-scheme="default"] {
--doc-symbol-parameter-fg-color: #df50af;
+ --doc-symbol-type_parameter-fg-color: #df50af;
--doc-symbol-attribute-fg-color: #953800;
--doc-symbol-function-fg-color: #8250df;
--doc-symbol-method-fg-color: #8250df;
--doc-symbol-class-fg-color: #0550ae;
+ --doc-symbol-type_alias-fg-color: #0550ae;
--doc-symbol-module-fg-color: #5cad0f;
--doc-symbol-parameter-bg-color: #df50af1a;
+ --doc-symbol-type_parameter-bg-color: #df50af1a;
--doc-symbol-attribute-bg-color: #9538001a;
--doc-symbol-function-bg-color: #8250df1a;
--doc-symbol-method-bg-color: #8250df1a;
--doc-symbol-class-bg-color: #0550ae1a;
+ --doc-symbol-type_alias-bg-color: #0550ae1a;
--doc-symbol-module-bg-color: #5cad0f1a;
}
[data-md-color-scheme="slate"] {
--doc-symbol-parameter-fg-color: #ffa8cc;
+ --doc-symbol-type_parameter-fg-color: #ffa8cc;
--doc-symbol-attribute-fg-color: #ffa657;
--doc-symbol-function-fg-color: #d2a8ff;
--doc-symbol-method-fg-color: #d2a8ff;
--doc-symbol-class-fg-color: #79c0ff;
+ --doc-symbol-type_alias-fg-color: #79c0ff;
--doc-symbol-module-fg-color: #baff79;
--doc-symbol-parameter-bg-color: #ffa8cc1a;
+ --doc-symbol-type_parameter-bg-color: #ffa8cc1a;
--doc-symbol-attribute-bg-color: #ffa6571a;
--doc-symbol-function-bg-color: #d2a8ff1a;
--doc-symbol-method-bg-color: #d2a8ff1a;
--doc-symbol-class-bg-color: #79c0ff1a;
+ --doc-symbol-type_alias-bg-color: #79c0ff1a;
--doc-symbol-module-bg-color: #baff791a;
}
@@ -124,6 +135,16 @@ code.doc-symbol-parameter::after {
content: "param";
}
+code.doc-symbol-type_parameter,
+a code.doc-symbol-type_parameter {
+ color: var(--doc-symbol-type_parameter-fg-color);
+ background-color: var(--doc-symbol-type_parameter-bg-color);
+}
+
+code.doc-symbol-type_parameter::after {
+ content: "type-param";
+}
+
code.doc-symbol-attribute,
a code.doc-symbol-attribute {
color: var(--doc-symbol-attribute-fg-color);
@@ -164,6 +185,17 @@ code.doc-symbol-class::after {
content: "class";
}
+
+code.doc-symbol-type_alias,
+a code.doc-symbol-type_alias {
+ color: var(--doc-symbol-type_alias-fg-color);
+ background-color: var(--doc-symbol-type_alias-bg-color);
+}
+
+code.doc-symbol-type_alias::after {
+ content: "type";
+}
+
code.doc-symbol-module,
a code.doc-symbol-module {
color: var(--doc-symbol-module-fg-color);
diff --git a/src/mkdocstrings_handlers/python/templates/material/summary/type_aliases.html b/src/mkdocstrings_handlers/python/templates/material/summary/type_aliases.html
new file mode 100644
index 00000000..ca10bc88
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/summary/type_aliases.html
@@ -0,0 +1 @@
+{% extends "_base/summary/type_aliases.html.jinja" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/summary/type_aliases.html.jinja b/src/mkdocstrings_handlers/python/templates/material/summary/type_aliases.html.jinja
new file mode 100644
index 00000000..ca10bc88
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/summary/type_aliases.html.jinja
@@ -0,0 +1 @@
+{% extends "_base/summary/type_aliases.html.jinja" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/type_alias.html b/src/mkdocstrings_handlers/python/templates/material/type_alias.html
new file mode 100644
index 00000000..5139a2db
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/type_alias.html
@@ -0,0 +1 @@
+{% extends "_base/type_alias.html.jinja" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/type_alias.html.jinja b/src/mkdocstrings_handlers/python/templates/material/type_alias.html.jinja
new file mode 100644
index 00000000..5139a2db
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/type_alias.html.jinja
@@ -0,0 +1 @@
+{% extends "_base/type_alias.html.jinja" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/type_parameters.html b/src/mkdocstrings_handlers/python/templates/material/type_parameters.html
new file mode 100644
index 00000000..c39ca528
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/type_parameters.html
@@ -0,0 +1 @@
+{% extends "_base/type_parameters.html.jinja" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/type_parameters.html.jinja b/src/mkdocstrings_handlers/python/templates/material/type_parameters.html.jinja
new file mode 100644
index 00000000..c39ca528
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/type_parameters.html.jinja
@@ -0,0 +1 @@
+{% extends "_base/type_parameters.html.jinja" %}
From 2d3f75ac4eff8cbc9bd7f747f975af7d70013062 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Tue, 26 Aug 2025 16:02:17 +0200
Subject: [PATCH 16/55] chore: Prepare release 1.18.0
---
CHANGELOG.md | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d7d2a9a9..a639b706 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## [1.18.0](https://github.com/mkdocstrings/python/releases/tag/1.18.0) - 2025-08-26
+
+[Compare with 1.17.0](https://github.com/mkdocstrings/python/compare/1.17.0...1.18.0)
+
+### Features
+
+- Support PEP 695 generics ([dc8c3ad](https://github.com/mkdocstrings/python/commit/dc8c3adb23b37add6601de9e74085f76e5fc9ee5) by Victor Westerhuis). [PR-221](https://github.com/mkdocstrings/python/pull/221), Co-authored-by: Timothée Mazzucotelli
+
+### Bug Fixes
+
+- Increase maximum recursion limit in case of deeply nested ASTs (rare occurrence) ([6004ccf](https://github.com/mkdocstrings/python/commit/6004ccf3576c7a20e21c880bb2235b7b426ba382) by Timothée Mazzucotelli). [Issue-griffe-402](https://github.com/mkdocstrings/griffe/issues/402)
+
## [1.17.0](https://github.com/mkdocstrings/python/releases/tag/1.17.0) - 2025-08-14
[Compare with 1.16.12](https://github.com/mkdocstrings/python/compare/1.16.12...1.17.0)
From 9ef620f2b1ae80b3711a2e84ab12d7d2c4a2dbdd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Thu, 28 Aug 2025 12:44:35 +0200
Subject: [PATCH 17/55] fix: Don't show implementation signature of `__init__`
method when `overloads_only` is true and it is merged into the class
Issue-308: https://github.com/mkdocstrings/python/issues/308
---
.../python/templates/material/_base/class.html.jinja | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
index 50385f41..23b3f458 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
@@ -107,7 +107,7 @@ Context:
{% endfor %}
{% endif %}
- {% if config.separate_signature %}
+ {% if config.separate_signature and not (config.show_overloads and function.overloads and config.overloads_only) %}
{% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %}
{{ class.name }}
{% endfilter %}
From 913358955a90b4faac32b3903a8531a835713e12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Thu, 28 Aug 2025 12:45:55 +0200
Subject: [PATCH 18/55] chore: Prepare release 1.18.1
---
CHANGELOG.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a639b706..4faea5fa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## [1.18.1](https://github.com/mkdocstrings/python/releases/tag/1.18.1) - 2025-08-28
+
+[Compare with 1.18.0](https://github.com/mkdocstrings/python/compare/1.18.0...1.18.1)
+
+### Bug Fixes
+
+- Don't show implementation signature of `__init__` method when `overloads_only` is true and it is merged into the class ([9ef620f](https://github.com/mkdocstrings/python/commit/9ef620f2b1ae80b3711a2e84ab12d7d2c4a2dbdd) by Timothée Mazzucotelli). [Issue-308](https://github.com/mkdocstrings/python/issues/308)
+
## [1.18.0](https://github.com/mkdocstrings/python/releases/tag/1.18.0) - 2025-08-26
[Compare with 1.17.0](https://github.com/mkdocstrings/python/compare/1.17.0...1.18.0)
From 30d4ba23e4402a63ee27a37135c38918bdcbeca5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Thu, 28 Aug 2025 15:48:11 +0200
Subject: [PATCH 19/55] docs: Fix docs for type parameter headings
---
docs/usage/configuration/headings.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/usage/configuration/headings.md b/docs/usage/configuration/headings.md
index ee10e381..8e904e5f 100644
--- a/docs/usage/configuration/headings.md
+++ b/docs/usage/configuration/headings.md
@@ -744,6 +744,7 @@ plugins:
summary: false
separate_signature: true
show_signature_type_parameters: true
+ show_inheritance_diagram: false
type_parameter_headings: true
```
@@ -765,6 +766,7 @@ plugins:
show_docstring_description: false
show_docstring_parameters: false
show_docstring_returns: false
+ show_inheritance_diagram: false
```
////
@@ -781,6 +783,7 @@ plugins:
show_docstring_description: false
show_docstring_parameters: false
show_docstring_returns: false
+ show_inheritance_diagram: false
```
////
@@ -797,6 +800,7 @@ plugins:
show_docstring_description: false
show_docstring_parameters: false
show_docstring_returns: false
+ show_inheritance_diagram: false
```
////
///
From 6f79be0ea83522021e16e5d401209e58576ef93a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Thu, 28 Aug 2025 18:10:49 +0200
Subject: [PATCH 20/55] fix: Normalize spaces to underscores when passing
object to rendering context using its kind as key
Issue-mkdocstrings-791: https://github.com/mkdocstrings/mkdocstrings/issues/791
---
src/mkdocstrings_handlers/python/_internal/handler.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mkdocstrings_handlers/python/_internal/handler.py b/src/mkdocstrings_handlers/python/_internal/handler.py
index c62088b3..fbed2b8e 100644
--- a/src/mkdocstrings_handlers/python/_internal/handler.py
+++ b/src/mkdocstrings_handlers/python/_internal/handler.py
@@ -295,7 +295,7 @@ def render(self, data: CollectorItem, options: PythonOptions, locale: str | None
return template.render(
**{
"config": options,
- data.kind.value: data,
+ data.kind.value.replace(" ", "_"): data,
# Heading level is a "state" variable, that will change at each step
# of the rendering recursion. Therefore, it's easier to use it as a plain value
# than as an item in a dictionary.
From 754b481471ebc032e6dafe7efe4193b73ef2d8bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Thu, 28 Aug 2025 18:11:08 +0200
Subject: [PATCH 21/55] chore: Prepare release 1.18.2
---
CHANGELOG.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4faea5fa..1ac6e8ec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## [1.18.2](https://github.com/mkdocstrings/python/releases/tag/1.18.2) - 2025-08-28
+
+[Compare with 1.18.1](https://github.com/mkdocstrings/python/compare/1.18.1...1.18.2)
+
+### Bug Fixes
+
+- Normalize spaces to underscores when passing object to rendering context using its kind as key ([6f79be0](https://github.com/mkdocstrings/python/commit/6f79be0ea83522021e16e5d401209e58576ef93a) by Timothée Mazzucotelli). [Issue-mkdocstrings-791](https://github.com/mkdocstrings/mkdocstrings/issues/791)
+
## [1.18.1](https://github.com/mkdocstrings/python/releases/tag/1.18.1) - 2025-08-28
[Compare with 1.18.0](https://github.com/mkdocstrings/python/compare/1.18.0...1.18.1)
From f25b2ecf73f30ac0ea836bec1aa60e87a360e23a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Tue, 9 Sep 2025 14:07:57 +0200
Subject: [PATCH 22/55] docs: Add recommended settings section in usage page
Issue-199: https://github.com/mkdocstrings/python/issues/199
---
docs/usage/index.md | 104 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 104 insertions(+)
diff --git a/docs/usage/index.md b/docs/usage/index.md
index e1fa457f..3348a627 100644
--- a/docs/usage/index.md
+++ b/docs/usage/index.md
@@ -380,3 +380,107 @@ poetry install
poetry run mkdocs build
```
///
+
+## Recommended settings
+
+If you're in a hurry, here is the configuration we recommend for the Python handler.
+
+```yaml
+- mkdocstrings:
+ handlers:
+ python:
+
+ # Where to find your sources, see "Finding modules".
+ paths: [src]
+
+ # Load object inventories to enable cross-references to other projects.
+ inventories:
+ - https://docs.python.org/3/objects.inv
+ # Also load inventories of your dependencies, generally served at
+ # https://docs-url-for-your-dependency/objects.inv.
+
+ options:
+
+ # DOCSTRINGS -------------------------------------------------------------
+ docstring_options:
+ # Discard first line of `__init__` method docstrings,
+ # useful when merging such docstrings into their parent class'.
+ ignore_init_summary: true
+
+ # Tables are generally too large, lists will fix this.
+ docstring_section_style: list
+
+ # CROSS-REFERENCES -------------------------------------------------------
+ # Enable relative crossrefs and scoped crossrefs, see Docstrings options.
+ relative_crossrefs: true # Sponsors only!
+ scoped_crossrefs: true # Sponsors only!
+
+ # Enable cross-references in signatures.
+ signature_crossrefs: true
+
+ # Unwrap actual types from `Annotated` type annotations.
+ unwrap_annotated: true
+
+ # MEMBERS ----------------------------------------------------------------
+ # Only render pulic symbols.
+ filters: public # Sponsors only!
+ # Comment the option otherwise to get the default filters.
+
+ # Show class inherited members.
+ inherited_members: true
+
+ # Render auto-generated summaries of attributes, functions, etc.
+ # at the start of each symbol's documentation.
+ summary: true
+
+ # HEADINGS ---------------------------------------------------------------
+ # For auto-generated pages, one module per page,
+ # make the module heading be the H1 heading of the page.
+ heading_level: 1
+
+ # Render headings for parameters, making them linkable.
+ parameter_headings: true
+
+ # Render headings for type parameters too.
+ type_parameter_headings: true
+
+ # Always show the heading for the symbol you render with `::: id`.
+ show_root_heading: true
+
+ # Only show the name of the symbols you inject render `::: id`.
+ show_root_full_path: false
+
+ # Show the type of symbol (class, function, etc.) in the heading.
+ show_symbol_type_heading: true
+
+ # Show the type of symbol (class, function, etc.) in the table of contents.
+ show_symbol_type_toc: true
+
+ # SIGNATURES -------------------------------------------------------------
+ # Format code to 80 + 10% margin (Black and Ruff defaults)
+ # in signatures and attribute value code blocks.
+ # Needs Black/Ruff installed.
+ line_length: 88
+
+ # Merge signature and docstring of `__init__` methods
+ # into their parent class signature and docstring.
+ merge_init_into_class: true
+
+ # Render signatures and attribute values in a separate code block,
+ # below the symbol heading.
+ separate_signature: true
+
+ # Show type annotations in signatures.
+ show_signature_annotations: true
+
+ # Show type parameters in signatures.
+ show_signature_type_parameters: true
+
+ # OTHER ------------------------------------------------------------------
+ # Show backlinks to other documentation sections within each symbol.
+ backlinks: tree # Sponsors only!
+
+ # Show base classes OR inheritance diagram.
+ show_bases: false
+ show_inheritance_diagram: true # Sponsors only!
+```
From be7d65da939b88997935a3ecfdce1e5052817795 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Thu, 9 Oct 2025 13:10:07 +0200
Subject: [PATCH 23/55] docs: Show default value for `show_overloads` and
`overloads_only` options
Issue-312: https://github.com/mkdocstrings/python/issues/312
Issue-313: https://github.com/mkdocstrings/python/issues/313
---
docs/usage/configuration/signatures.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/docs/usage/configuration/signatures.md b/docs/usage/configuration/signatures.md
index 0dabf74f..16ac218b 100644
--- a/docs/usage/configuration/signatures.md
+++ b/docs/usage/configuration/signatures.md
@@ -289,6 +289,8 @@ plugins:
[](){#option-overloads_only}
## `overloads_only`
+- **:octicons-package-24: Type [`bool`][] :material-equal: `False`{ title="default value" }**
+
Whether to hide the implementation signature if the overloads are shown with [`show_overloads`][].
```yaml title="in mkdocs.yml (global configuration)"
@@ -297,7 +299,7 @@ plugins:
handlers:
python:
options:
- overloads_only: true
+ overloads_only: false
```
```md title="or in docs/some_page.md (local configuration)"
@@ -584,6 +586,8 @@ class SomeClass:
[](){#option-show_overloads}
## `show_overloads`
+- **:octicons-package-24: Type [`bool`][] :material-equal: `True`{ title="default value" }**
+
Whether to render function / method overloads.
```yaml title="in mkdocs.yml (global configuration)"
From 6d600238c631bca29d95df711b6c788d978fbe98 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Thu, 9 Oct 2025 13:34:58 +0200
Subject: [PATCH 24/55] chore: Template upgrade
---
.copier-answers.yml | 2 +-
.github/pull_request_template.md | 15 +++++
.github/workflows/ci.yml | 30 ++++++++-
Makefile | 7 +++
README.md | 2 +-
config/pytest.ini | 2 +
config/pytest_39.ini | 17 ++++++
docs/js/insiders.js | 13 ++--
duties.py | 24 +++++---
scripts/get_version.py | 7 ++-
scripts/make.py | 61 +++++++++++++++----
.../python/_internal/debug.py | 2 +-
tests/test_api.py | 6 +-
13 files changed, 153 insertions(+), 35 deletions(-)
create mode 100644 .github/pull_request_template.md
create mode 100644 config/pytest_39.ini
diff --git a/.copier-answers.yml b/.copier-answers.yml
index 76531124..0d9a98c3 100644
--- a/.copier-answers.yml
+++ b/.copier-answers.yml
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier.
-_commit: 1.4.5
+_commit: 1.5.1
_src_path: gh:mkdocstrings/handler-template
author_email: dev@pawamoy.fr
author_fullname: Timothée Mazzucotelli
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 00000000..6f0f2faf
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,15 @@
+### For reviewers
+
+
+- [ ] I did not use AI
+- [ ] I used AI and thoroughly reviewed every code/docs change
+
+### Description of the change
+
+
+### Relevant resources
+
+
+-
+-
+-
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cf37ef60..2399abb9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,10 +2,17 @@ name: ci
on:
push:
+ branches:
+ - main
+ - test-me-*
pull_request:
branches:
- main
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
defaults:
run:
shell: bash
@@ -14,13 +21,30 @@ env:
LANG: en_US.utf-8
LC_ALL: en_US.utf-8
PYTHONIOENCODING: UTF-8
+ PYTHONWARNDEFAULTENCODING: "1"
PYTHON_VERSIONS: ""
jobs:
quality:
+ strategy:
+ matrix:
+ os:
+ - ubuntu-latest
+ - macos-latest
+ - windows-latest
+ python-version:
+ - "3.9"
+ - "3.13"
+ include:
+ - os: ubuntu-latest
+ python-version: "3.10"
+ - os: ubuntu-latest
+ python-version: "3.11"
+ - os: ubuntu-latest
+ python-version: "3.12"
- runs-on: ubuntu-latest
+ runs-on: ${{ matrix.os }}
steps:
- name: Checkout
@@ -32,7 +56,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
- python-version: "3.13"
+ python-version: ${{ matrix.python-version }}
- name: Setup uv
uses: astral-sh/setup-uv@v5
@@ -109,7 +133,7 @@ jobs:
- lowest-direct
exclude: ${{ fromJSON(needs.exclude-test-jobs.outputs.jobs) }}
runs-on: ${{ matrix.os }}
- continue-on-error: ${{ matrix.python-version == '3.14' }}
+ continue-on-error: true
steps:
- name: Checkout
diff --git a/Makefile b/Makefile
index 5e88121d..1b3391da 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,13 @@
# the `make` command will point at the `scripts/make` shell script.
# This Makefile is just here to allow auto-completion in the terminal.
+default: help
+ @echo
+ @echo 'Enable direnv in your shell to use the `make` command: `direnv allow`'
+ @echo 'Or use `python scripts/make ARGS` to run the commands/tasks directly.'
+
+.DEFAULT_GOAL: default
+
actions = \
allrun \
changelog \
diff --git a/README.md b/README.md
index 937a3a84..44507e72 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
[](https://github.com/mkdocstrings/python/actions?query=workflow%3Aci)
[](https://mkdocstrings.github.io/python/)
[](https://pypi.org/project/mkdocstrings-python/)
-[](https://app.gitter.im/#/room/#python:gitter.im)
+[](https://app.gitter.im/#/room/#mkdocstrings_python:gitter.im)
---
diff --git a/config/pytest.ini b/config/pytest.ini
index 4f43c18e..39ee3a3c 100644
--- a/config/pytest.ini
+++ b/config/pytest.ini
@@ -10,6 +10,8 @@ testpaths =
# action:message_regex:warning_class:module_regex:line
filterwarnings =
error
+ default::EncodingWarning
+ error::EncodingWarning:python
# TODO: Remove once pytest-xdist 4 is released.
ignore:.*rsyncdir:DeprecationWarning:xdist
# TODO: Remove once mkdocstrings stops setting fallback function.
diff --git a/config/pytest_39.ini b/config/pytest_39.ini
new file mode 100644
index 00000000..a876e994
--- /dev/null
+++ b/config/pytest_39.ini
@@ -0,0 +1,17 @@
+# YORE: EOL 3.9: Remove file.
+# This file is used on 3.9 due to forward compatibility issue with filterwarnings.
+# See https://github.com/pytest-dev/pytest/issues/11101.
+[pytest]
+python_files =
+ test_*.py
+addopts =
+ --cov
+ --cov-config config/coverage.ini
+testpaths =
+ tests
+
+# action:message_regex:warning_class:module_regex:line
+filterwarnings =
+ error
+ # TODO: remove once pytest-xdist 4 is released
+ ignore:.*rsyncdir:DeprecationWarning:xdist
diff --git a/docs/js/insiders.js b/docs/js/insiders.js
index 8bb68485..a86a0918 100644
--- a/docs/js/insiders.js
+++ b/docs/js/insiders.js
@@ -29,11 +29,14 @@ function updatePremiumSponsors(dataURL, rank) {
let html = '';
html += `${capRank} sponsors
+
+ {% endif %}
+ {% endblock inheritance_diagram %}
+
{% block docstring scoped %}
{#- Docstring block.
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/class.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/class.html
new file mode 100644
index 00000000..ac3e421e
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/class.html
@@ -0,0 +1,11 @@
+{% 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/readthedocs/_base/class.html.jinja b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/class.html.jinja
new file mode 100644
index 00000000..554485d7
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/class.html.jinja
@@ -0,0 +1,251 @@
+{#- Template for Python classes.
+
+This template renders a Python class.
+
+Context:
+ class (griffe.Class): The class to render.
+ root (bool): Whether this is the root object, injected with `:::` in a Markdown page.
+ heading_level (int): The HTML heading level to use.
+ config (dict): The configuration options.
+-#}
+
+{% block logs scoped %}
+ {#- Logging block.
+
+ This block can be used to log debug messages, deprecation messages, warnings, etc.
+ -#}
+ {{ log.debug("Rendering " + class.path) }}
+{% endblock logs %}
+
+
+ {% 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 %}
+ {#- Heading block.
+
+ This block renders the heading for the class.
+ -#}
+ {% 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"|get_template with context %}
+ {% endfilter %}
+ {% endwith %}
+ {% else %}
+ {{ class_name }}
+ {% endif %}
+ {% endblock heading %}
+
+ {% block labels scoped %}
+ {#- Labels block.
+
+ This block renders the labels for the class.
+ -#}
+ {% with labels = class.labels %}
+ {% include "labels"|get_template with context %}
+ {% endwith %}
+ {% endblock labels %}
+
+ {% endfilter %}
+
+ {% block signature scoped %}
+ {#- Signature block.
+
+ This block renders the signature for the class.
+ -#}
+ {% 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 %}
+ {#- Contents block.
+
+ This block renders the contents of the class.
+ It contains other blocks that users can override.
+ Overriding the contents block allows to rearrange the order of the blocks.
+ -#}
+ {% block bases scoped %}
+ {#- Class bases block.
+
+ This block renders the bases for the class.
+ -#}
+ {% if config.show_bases and class.bases %}
+
+ Bases: {% for expression in class.bases -%}
+ {% include "expression"|get_template with context %}{% if not loop.last %}, {% endif %}
+ {% endfor -%}
+
+ {% endif %}
+ {% endblock bases %}
+
+ {% block inheritance_diagram scoped %}
+ {#- Inheritance diagram block.
+
+ This block renders the inheritance diagram for the class,
+ using Mermaid syntax and a bit of JavaScript to make the nodes clickable,
+ linking to the corresponding class documentation.
+ -#}
+ {% if config.show_inheritance_diagram and class.bases %}
+ {% macro edges(class) %}
+ {% for base in class.resolved_bases %}
+ {{ base.path }} --> {{ class.path }}
+ {{ edges(base) }}
+ {% endfor %}
+ {% endmacro %}
+
+
+ {% for base in class.mro() %}
+
+ {% endfor %}
+
+
+
+*And 8 more private sponsor(s).*
+
From 440cc45b11d0cea618203d6a80796a836c322330 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Wed, 19 Nov 2025 20:02:50 +0100
Subject: [PATCH 39/55] refactor: Don't expect a `config_file_path` attribute
on passed tool config
This makes us compatible with Zensical when running as a Markdown extension directly.
---
src/mkdocstrings_handlers/python/_internal/handler.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mkdocstrings_handlers/python/_internal/handler.py b/src/mkdocstrings_handlers/python/_internal/handler.py
index 5945455d..41ff1a00 100644
--- a/src/mkdocstrings_handlers/python/_internal/handler.py
+++ b/src/mkdocstrings_handlers/python/_internal/handler.py
@@ -434,7 +434,7 @@ def get_handler(
# We therefore increase the limit here, once, before Griffe is used to collect or render stuff.
sys.setrecursionlimit(max(sys.getrecursionlimit(), 2000))
- base_dir = Path(tool_config.config_file_path or "./mkdocs.yml").parent
+ base_dir = Path(getattr(tool_config, "config_file_path", None) or "./mkdocs.yml").parent
if "inventories" not in handler_config and "import" in handler_config:
warn("The 'import' key is renamed 'inventories' for the Python handler", FutureWarning, stacklevel=1)
handler_config["inventories"] = handler_config.pop("import", [])
From c10afdb98d590a23c8840c7c0cdd6c358094dc2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?=
Date: Thu, 27 Nov 2025 17:06:51 +0100
Subject: [PATCH 40/55] refactor: Remove deprecated code for v2
---
src/mkdocstrings_handlers/python/__init__.py | 4 -
.../python/_internal/handler.py | 47 +------
.../python/_internal/rendering.py | 125 ++----------------
src/mkdocstrings_handlers/python/config.py | 17 ---
src/mkdocstrings_handlers/python/handler.py | 17 ---
src/mkdocstrings_handlers/python/rendering.py | 17 ---
.../templates/material/_base/attribute.html | 10 --
.../material/_base/attribute.html.jinja | 6 +-
.../templates/material/_base/children.html | 10 --
.../templates/material/_base/class.html | 10 --
.../templates/material/_base/class.html.jinja | 24 ++--
.../templates/material/_base/docstring.html | 10 --
.../material/_base/docstring.html.jinja | 45 +++----
.../material/_base/docstring/admonition.html | 10 --
.../material/_base/docstring/attributes.html | 10 --
.../_base/docstring/attributes.html.jinja | 12 +-
.../material/_base/docstring/classes.html | 10 --
.../_base/docstring/classes.html.jinja | 3 +-
.../material/_base/docstring/examples.html | 10 --
.../_base/docstring/examples.html.jinja | 3 +-
.../material/_base/docstring/functions.html | 10 --
.../_base/docstring/functions.html.jinja | 3 +-
.../material/_base/docstring/modules.html | 10 --
.../_base/docstring/modules.html.jinja | 3 +-
.../_base/docstring/other_parameters.html | 10 --
.../docstring/other_parameters.html.jinja | 12 +-
.../material/_base/docstring/parameters.html | 10 --
.../_base/docstring/parameters.html.jinja | 21 +--
.../material/_base/docstring/raises.html | 10 --
.../_base/docstring/raises.html.jinja | 12 +-
.../material/_base/docstring/receives.html | 10 --
.../_base/docstring/receives.html.jinja | 15 +--
.../material/_base/docstring/returns.html | 10 --
.../_base/docstring/returns.html.jinja | 15 +--
.../_base/docstring/type_aliases.html | 10 --
.../_base/docstring/type_aliases.html.jinja | 2 +-
.../_base/docstring/type_parameters.html | 10 --
.../docstring/type_parameters.html.jinja | 18 +--
.../material/_base/docstring/warns.html | 10 --
.../material/_base/docstring/warns.html.jinja | 12 +-
.../material/_base/docstring/yields.html | 10 --
.../_base/docstring/yields.html.jinja | 15 +--
.../templates/material/_base/expression.html | 10 --
.../templates/material/_base/function.html | 10 --
.../material/_base/function.html.jinja | 14 +-
.../templates/material/_base/labels.html | 10 --
.../templates/material/_base/language.html | 10 --
.../material/_base/language.html.jinja | 9 +-
.../material/_base/languages/en.html | 10 --
.../material/_base/languages/ja.html | 10 --
.../material/_base/languages/zh.html | 10 --
.../templates/material/_base/module.html | 10 --
.../material/_base/module.html.jinja | 12 +-
.../templates/material/_base/signature.html | 10 --
.../material/_base/signature.html.jinja | 9 +-
.../templates/material/_base/summary.html | 10 --
.../material/_base/summary.html.jinja | 15 +--
.../material/_base/summary/attributes.html | 10 --
.../_base/summary/attributes.html.jinja | 3 +-
.../material/_base/summary/classes.html | 10 --
.../material/_base/summary/classes.html.jinja | 3 +-
.../material/_base/summary/functions.html | 10 --
.../_base/summary/functions.html.jinja | 3 +-
.../material/_base/summary/modules.html | 10 --
.../material/_base/summary/modules.html.jinja | 3 +-
.../material/_base/summary/type_aliases.html | 10 --
.../_base/summary/type_aliases.html.jinja | 3 +-
.../templates/material/_base/type_alias.html | 10 --
.../material/_base/type_alias.html.jinja | 9 +-
.../material/_base/type_parameters.html | 10 --
.../material/_base/type_parameters.html.jinja | 6 +-
.../python/templates/material/attribute.html | 2 -
.../python/templates/material/children.html | 2 -
.../python/templates/material/class.html | 2 -
.../python/templates/material/docstring.html | 2 -
.../material/docstring/admonition.html | 2 -
.../material/docstring/attributes.html | 2 -
.../templates/material/docstring/classes.html | 2 -
.../material/docstring/examples.html | 2 -
.../material/docstring/functions.html | 2 -
.../templates/material/docstring/modules.html | 2 -
.../material/docstring/other_parameters.html | 2 -
.../material/docstring/parameters.html | 2 -
.../templates/material/docstring/raises.html | 2 -
.../material/docstring/receives.html | 2 -
.../templates/material/docstring/returns.html | 2 -
.../templates/material/docstring/warns.html | 2 -
.../templates/material/docstring/yields.html | 2 -
.../python/templates/material/expression.html | 2 -
.../python/templates/material/function.html | 2 -
.../python/templates/material/labels.html | 2 -
.../python/templates/material/language.html | 2 -
.../templates/material/languages/en.html | 2 -
.../templates/material/languages/ja.html | 2 -
.../templates/material/languages/zh.html | 2 -
.../python/templates/material/module.html | 2 -
.../python/templates/material/signature.html | 2 -
.../python/templates/material/summary.html | 2 -
.../material/summary/attributes.html | 2 -
.../templates/material/summary/classes.html | 2 -
.../templates/material/summary/functions.html | 2 -
.../templates/material/summary/modules.html | 2 -
.../readthedocs/_base/class.html.jinja | 36 ++---
.../_base/docstring/attributes.html | 10 --
.../_base/docstring/attributes.html.jinja | 6 +-
.../_base/docstring/other_parameters.html | 10 --
.../docstring/other_parameters.html.jinja | 6 +-
.../_base/docstring/parameters.html | 10 --
.../_base/docstring/parameters.html.jinja | 9 +-
.../readthedocs/_base/docstring/raises.html | 10 --
.../_base/docstring/raises.html.jinja | 6 +-
.../readthedocs/_base/docstring/receives.html | 10 --
.../_base/docstring/receives.html.jinja | 6 +-
.../readthedocs/_base/docstring/returns.html | 10 --
.../_base/docstring/returns.html.jinja | 6 +-
.../readthedocs/_base/docstring/warns.html | 10 --
.../_base/docstring/warns.html.jinja | 6 +-
.../readthedocs/_base/docstring/yields.html | 10 --
.../_base/docstring/yields.html.jinja | 6 +-
.../templates/readthedocs/_base/language.html | 10 --
.../readthedocs/_base/language.html.jinja | 9 +-
.../readthedocs/_base/languages/en.html | 10 --
.../readthedocs/_base/languages/ja.html | 10 --
.../readthedocs/_base/languages/zh.html | 10 --
.../readthedocs/docstring/attributes.html | 2 -
.../docstring/other_parameters.html | 2 -
.../readthedocs/docstring/parameters.html | 2 -
.../readthedocs/docstring/raises.html | 2 -
.../readthedocs/docstring/receives.html | 2 -
.../readthedocs/docstring/returns.html | 2 -
.../readthedocs/docstring/warns.html | 2 -
.../readthedocs/docstring/yields.html | 2 -
.../templates/readthedocs/language.html | 2 -
.../templates/readthedocs/languages/en.html | 2 -
.../templates/readthedocs/languages/ja.html | 2 -
.../templates/readthedocs/languages/zh.html | 2 -
tests/test_api.py | 4 -
tests/test_handler.py | 2 +
tests/test_themes.py | 10 +-
139 files changed, 168 insertions(+), 1047 deletions(-)
delete mode 100644 src/mkdocstrings_handlers/python/config.py
delete mode 100644 src/mkdocstrings_handlers/python/handler.py
delete mode 100644 src/mkdocstrings_handlers/python/rendering.py
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/attribute.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/children.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/class.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_aliases.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_parameters.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/expression.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/function.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/labels.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/language.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/module.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/signature.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/summary.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/summary/attributes.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/summary/classes.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/summary/functions.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/summary/modules.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/summary/type_aliases.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/type_alias.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/_base/type_parameters.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/attribute.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/children.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/class.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/admonition.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/attributes.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/classes.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/examples.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/functions.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/modules.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/other_parameters.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/parameters.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/raises.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/receives.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/returns.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/warns.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/docstring/yields.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/expression.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/function.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/labels.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/language.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/languages/en.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/languages/ja.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/languages/zh.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/module.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/signature.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/summary.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/summary/attributes.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/summary/classes.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/summary/functions.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/material/summary/modules.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/other_parameters.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/language.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/en.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/ja.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/_base/languages/zh.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/docstring/attributes.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/docstring/other_parameters.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/docstring/parameters.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/docstring/raises.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/docstring/receives.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/docstring/returns.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/docstring/warns.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/docstring/yields.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/language.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/languages/en.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/languages/ja.html
delete mode 100644 src/mkdocstrings_handlers/python/templates/readthedocs/languages/zh.html
diff --git a/src/mkdocstrings_handlers/python/__init__.py b/src/mkdocstrings_handlers/python/__init__.py
index 7e12fa73..dbad0355 100644
--- a/src/mkdocstrings_handlers/python/__init__.py
+++ b/src/mkdocstrings_handlers/python/__init__.py
@@ -24,14 +24,12 @@
do_as_modules_section,
do_as_type_aliases_section,
do_backlink_tree,
- do_crossref,
do_filter_objects,
do_format_attribute,
do_format_code,
do_format_signature,
do_format_type_alias,
do_get_template,
- do_multi_crossref,
do_order_members,
do_split_path,
do_stash_crossref,
@@ -59,14 +57,12 @@
"do_as_modules_section",
"do_as_type_aliases_section",
"do_backlink_tree",
- "do_crossref",
"do_filter_objects",
"do_format_attribute",
"do_format_code",
"do_format_signature",
"do_format_type_alias",
"do_get_template",
- "do_multi_crossref",
"do_order_members",
"do_split_path",
"do_stash_crossref",
diff --git a/src/mkdocstrings_handlers/python/_internal/handler.py b/src/mkdocstrings_handlers/python/_internal/handler.py
index 41ff1a00..abab532c 100644
--- a/src/mkdocstrings_handlers/python/_internal/handler.py
+++ b/src/mkdocstrings_handlers/python/_internal/handler.py
@@ -10,7 +10,6 @@
from dataclasses import asdict
from pathlib import Path
from typing import TYPE_CHECKING, Any, BinaryIO, ClassVar
-from warnings import warn
from griffe import (
AliasResolutionError,
@@ -56,17 +55,6 @@ def chdir(path: str) -> Iterator[None]:
patch_loggers(get_logger)
-# YORE: Bump 2: Remove block.
-def _warn_extra_options(names: Sequence[str]) -> None:
- warn(
- "Passing extra options directly under `options` is deprecated. "
- "Instead, pass them under `options.extra`, and update your templates. "
- f"Current extra (unrecognized) options: {', '.join(sorted(names))}",
- DeprecationWarning,
- stacklevel=3,
- )
-
-
class PythonHandler(BaseHandler):
"""The Python handler class."""
@@ -97,18 +85,9 @@ def __init__(self, config: PythonConfig, base_dir: Path, **kwargs: Any) -> None:
self.base_dir = base_dir
"""The base directory of the project."""
- # YORE: Bump 2: Remove block.
- global_extra, global_options = PythonOptions._extract_extra(config.options)
- if global_extra:
- _warn_extra_options(global_extra.keys()) # type: ignore[arg-type]
- self._global_extra = global_extra
- self.global_options = global_options
+ self.global_options = config.options
"""The global configuration options (in `mkdocs.yml`)."""
- # YORE: Bump 2: Replace `# ` with `` within block.
- # self.global_options = config.options
- # """The global configuration options (in `mkdocs.yml`)."""
-
# Warn if user overrides base templates.
if self.custom_templates:
for theme_dir in base_dir.joinpath(self.custom_templates, "python").iterdir():
@@ -188,25 +167,13 @@ def get_options(self, local_options: Mapping[str, Any]) -> HandlerOptions:
Returns:
The combined options.
"""
- # YORE: Bump 2: Remove block.
- local_extra, local_options = PythonOptions._extract_extra(local_options) # type: ignore[arg-type]
- if local_extra:
- _warn_extra_options(local_extra.keys()) # type: ignore[arg-type]
- unknown_extra = self._global_extra | local_extra
-
extra = {**self.global_options.get("extra", {}), **local_options.get("extra", {})}
options = {**self.global_options, **local_options, "extra": extra}
try:
- # YORE: Bump 2: Replace `opts =` with `return` within line.
- opts = PythonOptions.from_data(**options)
+ return PythonOptions.from_data(**options)
except Exception as error:
raise PluginError(f"Invalid options: {error}") from error
- # YORE: Bump 2: Remove block.
- for key, value in unknown_extra.items():
- object.__setattr__(opts, key, value)
- return opts
-
def collect(self, identifier: str, options: PythonOptions) -> CollectorItem:
"""Collect the documentation for the given identifier.
@@ -291,7 +258,7 @@ def render(self, data: CollectorItem, options: PythonOptions, locale: str | None
Returns:
The rendered data (HTML).
"""
- template_name = rendering.do_get_template(self.env, data)
+ template_name = rendering.do_get_template(data)
template = self.env.get_template(template_name)
return template.render(
@@ -303,8 +270,7 @@ def render(self, data: CollectorItem, options: PythonOptions, locale: str | None
# than as an item in a dictionary.
"heading_level": options.heading_level,
"root": True,
- # YORE: Bump 2: Regex-replace ` or .+` with ` or "en",` within line.
- "locale": locale or self.config.locale,
+ "locale": locale or "en",
},
)
@@ -336,8 +302,6 @@ def update_env(self, config: Any) -> None: # noqa: ARG002
self.env.lstrip_blocks = True
self.env.keep_trailing_newline = False
self.env.filters["split_path"] = rendering.do_split_path
- self.env.filters["crossref"] = rendering.do_crossref
- self.env.filters["multi_crossref"] = rendering.do_multi_crossref
self.env.filters["order_members"] = rendering.do_order_members
self.env.filters["format_code"] = rendering.do_format_code
self.env.filters["format_signature"] = rendering.do_format_signature
@@ -435,9 +399,6 @@ def get_handler(
sys.setrecursionlimit(max(sys.getrecursionlimit(), 2000))
base_dir = Path(getattr(tool_config, "config_file_path", None) or "./mkdocs.yml").parent
- if "inventories" not in handler_config and "import" in handler_config:
- warn("The 'import' key is renamed 'inventories' for the Python handler", FutureWarning, stacklevel=1)
- handler_config["inventories"] = handler_config.pop("import", [])
return PythonHandler(
config=PythonConfig.from_data(**handler_config),
base_dir=base_dir,
diff --git a/src/mkdocstrings_handlers/python/_internal/rendering.py b/src/mkdocstrings_handlers/python/_internal/rendering.py
index ba51fcac..20ae7c54 100644
--- a/src/mkdocstrings_handlers/python/_internal/rendering.py
+++ b/src/mkdocstrings_handlers/python/_internal/rendering.py
@@ -7,13 +7,11 @@
import string
import subprocess
import sys
-import warnings
from collections import defaultdict
from contextlib import suppress
from dataclasses import replace
from functools import lru_cache
-from pathlib import Path
-from re import Match, Pattern
+from re import Pattern
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Literal, TypeVar
from griffe import (
@@ -33,7 +31,7 @@
Object,
TypeAlias,
)
-from jinja2 import TemplateNotFound, pass_context, pass_environment
+from jinja2 import pass_context
from markupsafe import Markup
from mkdocs_autorefs import AutorefsHookInterface, Backlink, BacklinkCrumb
from mkdocstrings import get_logger
@@ -42,7 +40,6 @@
from collections.abc import Iterable, Iterator, Sequence
from griffe import Attribute, Class, Function, Module
- from jinja2 import Environment
from jinja2.runtime import Context
from mkdocstrings import CollectorItem
@@ -170,10 +167,8 @@ def do_format_signature(
The same code, formatted.
"""
env = context.environment
- # YORE: Bump 2: Replace `do_get_template(env, "type_parameters")` with `"type_parameters.html.jinja"` within line.
- type_params_template = env.get_template(do_get_template(env, "type_parameters"))
- # YORE: Bump 2: Replace `do_get_template(env, "signature")` with `"signature.html.jinja"` within line.
- signature_template = env.get_template(do_get_template(env, "signature"))
+ type_params_template = env.get_template("type_parameters.html.jinja")
+ signature_template = env.get_template("signature.html.jinja")
if annotations is None:
new_context = context.parent
@@ -237,8 +232,7 @@ def do_format_attribute(
The same code, formatted.
"""
env = context.environment
- # YORE: Bump 2: Replace `do_get_template(env, "expression")` with `"expression.html.jinja"` within line.
- template = env.get_template(do_get_template(env, "expression"))
+ template = env.get_template("expression.html.jinja")
annotations = context.parent["config"].show_signature_annotations
signature = str(attribute_path).strip()
@@ -295,10 +289,8 @@ def do_format_type_alias(
The same code, formatted.
"""
env = context.environment
- # YORE: Bump 2: Replace `do_get_template(env, "type_parameters")` with `"type_parameters.html.jinja"` within line.
- type_params_template = env.get_template(do_get_template(env, "type_parameters"))
- # YORE: Bump 2: Replace `do_get_template(env, "expression")` with `"expression.html.jinja"` within line.
- expr_template = env.get_template(do_get_template(env, "expression"))
+ type_params_template = env.get_template("type_parameters.html.jinja")
+ expr_template = env.get_template("expression.html.jinja")
signature = str(type_alias_path).strip()
signature += type_params_template.render(context.parent, obj=type_alias, signature=True)
@@ -364,76 +356,6 @@ def do_order_members(
return members
-# YORE: Bump 2: Remove block.
-@lru_cache
-def _warn_crossref() -> None:
- warnings.warn(
- "The `crossref` filter is deprecated and will be removed in a future version",
- DeprecationWarning,
- stacklevel=1,
- )
-
-
-# YORE: Bump 2: Remove block.
-def do_crossref(path: str, *, brief: bool = True) -> Markup:
- """Deprecated. Filter to create cross-references.
-
- Parameters:
- path: The path to link to.
- brief: Show only the last part of the path, add full path as hover.
-
- Returns:
- Markup text.
- """
- _warn_crossref()
- full_path = path
- if brief:
- path = full_path.split(".")[-1]
- return Markup("{path}").format(
- full_path=full_path,
- path=path,
- )
-
-
-# YORE: Bump 2: Remove block.
-@lru_cache
-def _warn_multi_crossref() -> None:
- warnings.warn(
- "The `multi_crossref` filter is deprecated and will be removed in a future version",
- DeprecationWarning,
- stacklevel=1,
- )
-
-
-# YORE: Bump 2: Remove block.
-def do_multi_crossref(text: str, *, code: bool = True) -> Markup:
- """Deprecated. Filter to create cross-references.
-
- Parameters:
- text: The text to scan.
- code: Whether to wrap the result in a code tag.
-
- Returns:
- Markup text.
- """
- _warn_multi_crossref()
- group_number = 0
- variables = {}
-
- def repl(match: Match) -> str:
- nonlocal group_number
- group_number += 1
- path = match.group()
- path_var = f"path{group_number}"
- variables[path_var] = path
- return f"{{{path_var}}}"
-
- text = re.sub(r"([\w.]+)", repl, text)
- if code:
- text = f"{text}"
- return Markup(text).format(**variables) # noqa: S704
-
-
_split_path_re = re.compile(r"([.(]?)([\w]+)(\))?")
_splitable_re = re.compile(r"[().]")
@@ -648,39 +570,20 @@ def formatter(code: str, line_length: int) -> str:
return formatter
-# YORE: Bump 2: Remove line.
-@pass_environment
-# YORE: Bump 2: Replace `env: Environment, ` with `` within line.
-# YORE: Bump 2: Replace `str | ` with `` within line.
-def do_get_template(env: Environment, obj: str | Object) -> str:
+def do_get_template(obj: Object | Alias) -> str:
"""Get the template name used to render an object.
Parameters:
- env: The Jinja environment, passed automatically.
- obj: A Griffe object, or a template name.
+ obj: A Griffe object.
Returns:
A template name.
"""
- name = obj
- if isinstance(obj, (Alias, Object)):
- extra_data = getattr(obj, "extra", {}).get("mkdocstrings", {})
- if name := extra_data.get("template", ""):
- return name
- name = obj.kind.value.replace(" ", "_")
- # YORE: Bump 2: Replace block with `return f"{name}.html.jinja"`.
- try:
- template = env.get_template(f"{name}.html")
- except TemplateNotFound:
- return f"{name}.html.jinja"
- our_template = Path(template.filename).is_relative_to(Path(__file__).parent.parent) # type: ignore[arg-type]
- if our_template:
- return f"{name}.html.jinja"
- _logger.warning(
- f"DeprecationWarning: Overriding '{name}.html' is deprecated, override '{name}.html.jinja' instead. ",
- once=True,
- )
- return f"{name}.html"
+ extra_data = getattr(obj, "extra", {}).get("mkdocstrings", {})
+ if name := extra_data.get("template", ""):
+ return name
+ name = obj.kind.value.replace(" ", "_")
+ return f"{name}.html.jinja"
@pass_context
diff --git a/src/mkdocstrings_handlers/python/config.py b/src/mkdocstrings_handlers/python/config.py
deleted file mode 100644
index 5edab089..00000000
--- a/src/mkdocstrings_handlers/python/config.py
+++ /dev/null
@@ -1,17 +0,0 @@
-"""Deprecated. Import from `mkdocstrings_handlers.python` directly."""
-
-# YORE: Bump 2: Remove file.
-
-import warnings
-from typing import Any
-
-from mkdocstrings_handlers.python._internal import config
-
-
-def __getattr__(name: str) -> Any:
- warnings.warn(
- "Importing from `mkdocstrings_handlers.python.config` is deprecated. Import from `mkdocstrings_handlers.python` directly.",
- DeprecationWarning,
- stacklevel=2,
- )
- return getattr(config, name)
diff --git a/src/mkdocstrings_handlers/python/handler.py b/src/mkdocstrings_handlers/python/handler.py
deleted file mode 100644
index 5b334860..00000000
--- a/src/mkdocstrings_handlers/python/handler.py
+++ /dev/null
@@ -1,17 +0,0 @@
-"""Deprecated. Import from `mkdocstrings_handlers.python` directly."""
-
-# YORE: Bump 2: Remove file.
-
-import warnings
-from typing import Any
-
-from mkdocstrings_handlers.python._internal import handler
-
-
-def __getattr__(name: str) -> Any:
- warnings.warn(
- "Importing from `mkdocstrings_handlers.python.handler` is deprecated. Import from `mkdocstrings_handlers.python` directly.",
- DeprecationWarning,
- stacklevel=2,
- )
- return getattr(handler, name)
diff --git a/src/mkdocstrings_handlers/python/rendering.py b/src/mkdocstrings_handlers/python/rendering.py
deleted file mode 100644
index 5cd4d200..00000000
--- a/src/mkdocstrings_handlers/python/rendering.py
+++ /dev/null
@@ -1,17 +0,0 @@
-"""Deprecated. Import from `mkdocstrings_handlers.python` directly."""
-
-# YORE: Bump 2: Remove file.
-
-import warnings
-from typing import Any
-
-from mkdocstrings_handlers.python._internal import rendering
-
-
-def __getattr__(name: str) -> Any:
- warnings.warn(
- "Importing from `mkdocstrings_handlers.python.rendering` is deprecated. Import from `mkdocstrings_handlers.python` directly.",
- DeprecationWarning,
- stacklevel=2,
- )
- return getattr(rendering, name)
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html
deleted file mode 100644
index 37c8702c..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/attribute.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/attribute.html' is deprecated, extend '_base/attribute.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja
index bad9ad54..65054689 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja
@@ -67,8 +67,7 @@ Context:
This block renders the labels for the attribute.
-#}
{% with labels = attribute.labels %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "labels"|get_template with context %}
+ {% include "labels.html.jinja" with context %}
{% endwith %}
{% endblock labels %}
@@ -115,8 +114,7 @@ Context:
This block renders the docstring for the attribute.
-#}
{% with docstring_sections = attribute.docstring.parsed %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring"|get_template with context %}
+ {% include "docstring.html.jinja" with context %}
{% endwith %}
{% endblock docstring %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/children.html b/src/mkdocstrings_handlers/python/templates/material/_base/children.html
deleted file mode 100644
index eada68e8..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/children.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/children.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/children.html' is deprecated, extend '_base/children.html.jinja' instead. ",
- 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
deleted file mode 100644
index 0fb87f5b..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/class.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/class.html' is deprecated, extend '_base/class.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
index 417afe41..43ec5b1a 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
@@ -57,11 +57,9 @@ Context:
{%+ filter highlight(language="python", inline=True) %}
{{ class_name -}}
{%- with obj = function -%}
- {#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
- {%- include "type_parameters"|get_template with context -%}
+ {%- include "type_parameters.html.jinja" with context -%}
{%- endwith -%}
- {#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
- {%- include "signature"|get_template with context -%}
+ {%- include "signature.html.jinja" with context -%}
{% endfilter %}
{% endwith %}
{% else %}
@@ -76,8 +74,7 @@ Context:
This block renders the labels for the class.
-#}
{% with labels = class.labels %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "labels"|get_template with context %}
+ {% include "labels.html.jinja" with context %}
{% endwith %}
{% endblock labels %}
@@ -148,8 +145,7 @@ Context:
Bases: {% for expression in class.bases -%}
{%- with backlink_type = "subclassed-by" -%}
- {#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
- {%- include "expression"|get_template with context -%}
+ {%- include "expression.html.jinja" with context -%}
{%- endwith -%}
{% if not loop.last %}, {% endif %}
{% endfor -%}
@@ -211,8 +207,7 @@ Context:
This block renders the docstring for the class.
-#}
{% with docstring_sections = class.docstring.parsed %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring"|get_template with context %}
+ {% include "docstring.html.jinja" with context %}
{% endwith %}
{% if config.merge_init_into_class %}
{# We don't want to merge the inherited `__init__` method docstring into the class docstring #}
@@ -221,8 +216,7 @@ Context:
{% if "__init__" in check_members and check_members["__init__"].has_docstring %}
{% with function = check_members["__init__"] %}
{% with obj = function, docstring_sections = function.docstring.parsed %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring"|get_template with context %}
+ {% include "docstring.html.jinja" with context %}
{% endwith %}
{% endwith %}
{% endif %}
@@ -239,8 +233,7 @@ Context:
This block renders auto-summaries for classes, methods, and attributes.
-#}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "summary"|get_template with context %}
+ {% include "summary.html.jinja" with context %}
{% endblock summary %}
{% block source scoped %}
@@ -286,8 +279,7 @@ Context:
-#}
{% set root = False %}
{% set heading_level = heading_level + 1 %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "children"|get_template with context %}
+ {% include "children.html.jinja" with context %}
{% endblock children %}
{% endblock contents %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html
deleted file mode 100644
index c487550b..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring.html' is deprecated, extend '_base/docstring.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html.jinja
index cae4f50f..a00a0249 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring.html.jinja
@@ -24,50 +24,35 @@ Context:
{% if config.show_docstring_description and section.kind.value == "text" %}
{{ section.value|convert_markdown(heading_level, html_id, autoref_hook=autoref_hook) }}
{% elif config.show_docstring_attributes and section.kind.value == "attributes" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/attributes"|get_template with context %}
+ {% include "docstring/attributes.html.jinja" with context %}
{% elif config.show_docstring_functions and section.kind.value == "functions" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/functions"|get_template with context %}
+ {% include "docstring/functions.html.jinja" with context %}
{% elif config.show_docstring_classes and section.kind.value == "classes" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/classes"|get_template with context %}
+ {% include "docstring/classes.html.jinja" with context %}
{% elif config.show_docstring_type_aliases and section.kind.value == "type aliases" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/type_aliases"|get_template with context %}
+ {% include "docstring/type_aliases.html.jinja" with context %}
{% elif config.show_docstring_modules and section.kind.value == "modules" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/modules"|get_template with context %}
+ {% include "docstring/modules.html.jinja" with context %}
{% elif config.show_docstring_type_parameters and section.kind.value == "type parameters" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/type_parameters"|get_template with context %}
+ {% include "docstring/type_parameters.html.jinja" with context %}
{% elif config.show_docstring_parameters and section.kind.value == "parameters" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/parameters"|get_template with context %}
+ {% include "docstring/parameters.html.jinja" with context %}
{% elif config.show_docstring_other_parameters and section.kind.value == "other parameters" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/other_parameters"|get_template with context %}
+ {% include "docstring/other_parameters.html.jinja" with context %}
{% elif config.show_docstring_raises and section.kind.value == "raises" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/raises"|get_template with context %}
+ {% include "docstring/raises.html.jinja" with context %}
{% elif config.show_docstring_warns and section.kind.value == "warns" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/warns"|get_template with context %}
+ {% include "docstring/warns.html.jinja" with context %}
{% elif config.show_docstring_yields and section.kind.value == "yields" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/yields"|get_template with context %}
+ {% include "docstring/yields.html.jinja" with context %}
{% elif config.show_docstring_receives and section.kind.value == "receives" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/receives"|get_template with context %}
+ {% include "docstring/receives.html.jinja" with context %}
{% elif config.show_docstring_returns and section.kind.value == "returns" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/returns"|get_template with context %}
+ {% include "docstring/returns.html.jinja" with context %}
{% elif config.show_docstring_examples and section.kind.value == "examples" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/examples"|get_template with context %}
+ {% include "docstring/examples.html.jinja" with context %}
{% elif config.show_docstring_description and section.kind.value == "admonition" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring/admonition"|get_template with context %}
+ {% include "docstring/admonition.html.jinja" with context %}
{% endif %}
{% endfor %}
{% endwith %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html
deleted file mode 100644
index e94d6e61..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/admonition.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/admonition.html' is deprecated, extend '_base/docstring/admonition.html.jinja' instead. ",
- 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
deleted file mode 100644
index 9f2abcd1..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/attributes.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/attributes.html' is deprecated, extend '_base/docstring/attributes.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html.jinja
index 03104333..9e0add3f 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering attributes section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
@@ -38,8 +37,7 @@ Context:
{% if attribute.annotation %}
{% with expression = attribute.annotation %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -63,8 +61,7 @@ Context:
{{ attribute.name }}
{% if attribute.annotation %}
{% with expression = attribute.annotation %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- ({% include "expression"|get_template with context %})
+ ({% include "expression.html.jinja" with context %})
{% endwith %}
{% endif %}
–
@@ -98,8 +95,7 @@ Context:
TYPE:
{% with expression = attribute.annotation %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html
deleted file mode 100644
index 9c04b145..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/classes.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/classes.html' is deprecated, extend '_base/docstring/classes.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html.jinja
index 09a5b758..b139a761 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering classes section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html
deleted file mode 100644
index 4f66600f..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/examples.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/examples.html' is deprecated, extend '_base/docstring/examples.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html.jinja
index 09293cfb..32360f7d 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering examples section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{{ section.title or lang.t("Examples:") }}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html
deleted file mode 100644
index 906658b4..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/functions.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/functions.html' is deprecated, extend '_base/docstring/functions.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html.jinja
index dd33984f..afec8f60 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering functions section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html
deleted file mode 100644
index 7b0dcc51..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/modules.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/modules.html' is deprecated, extend '_base/docstring/modules.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html.jinja
index 106e6bf6..5556cf15 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering modules section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
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
deleted file mode 100644
index 02261331..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/other_parameters.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/other_parameters.html' is deprecated, extend '_base/docstring/other_parameters.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html.jinja
index 66940069..5e0a75f5 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering other parameters section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
@@ -38,8 +37,7 @@ Context:
{% if parameter.annotation %}
{% with expression = parameter.annotation, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -63,8 +61,7 @@ Context:
{{ parameter.name }}
{% if parameter.annotation %}
{% with expression = parameter.annotation, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- ({% include "expression"|get_template with context %})
+ ({% include "expression.html.jinja" with context %})
{% endwith %}
{% endif %}
–
@@ -98,8 +95,7 @@ Context:
{{ lang.t("TYPE:") }}
{% with expression = parameter.annotation, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html
deleted file mode 100644
index f5292150..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/parameters.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/parameters.html' is deprecated, extend '_base/docstring/parameters.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html.jinja
index a3ea5f7f..a67113fa 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering parameters section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
@@ -54,8 +53,7 @@ Context:
{% if parameter.annotation %}
{% with expression = parameter.annotation, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -67,8 +65,7 @@ Context:
{% if parameter.default %}
{% with expression = parameter.default, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% else %}
{{ lang.t("required") }}
@@ -102,12 +99,10 @@ Context:
{% endif %}
{% if parameter.annotation %}
{% with expression = parameter.annotation, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- ({% include "expression"|get_template with context %}
+ ({% include "expression.html.jinja" with context %}
{%- if parameter.default %}, {{ lang.t("default:") }}
{% with expression = parameter.default, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %})
{% endwith %}
@@ -158,8 +153,7 @@ Context:
{{ lang.t("TYPE:") }}
{% with expression = parameter.annotation, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -167,8 +161,7 @@ Context:
{{ lang.t("DEFAULT:") }}
{% with expression = parameter.default, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% 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
deleted file mode 100644
index 38a21e89..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/raises.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/raises.html' is deprecated, extend '_base/docstring/raises.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html.jinja
index cd034c0e..7d548035 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering raises section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
@@ -36,8 +35,7 @@ Context:
{% if raises.annotation %}
{% with expression = raises.annotation, backlink_type = "raised-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -60,8 +58,7 @@ Context:
{% if raises.annotation %}
{% with expression = raises.annotation, backlink_type = "raised-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
–
{% endif %}
@@ -88,8 +85,7 @@ Context:
{% with expression = raises.annotation, backlink_type = "raised-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html
deleted file mode 100644
index d9c404b6..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/receives.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/receives.html' is deprecated, extend '_base/docstring/receives.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html.jinja
index 3ecc5b41..6830d434 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering receives section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
@@ -39,8 +38,7 @@ Context:
{% if receives.annotation %}
{% with expression = receives.annotation, backlink_type = "received-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -65,8 +63,7 @@ Context:
{% if receives.annotation %}
{% with expression = receives.annotation, backlink_type = "received-by" %}
{% if receives.name %} ({% endif %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% if receives.name %}){% endif %}
{% endwith %}
{% endif %}
@@ -97,8 +94,7 @@ Context:
{% elif receives.annotation %}
{% with expression = receives.annotation, backlink_type = "received-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -112,8 +108,7 @@ Context:
{{ lang.t("TYPE:") }}
{% with expression = receives.annotation, backlink_type = "received-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html
deleted file mode 100644
index b608af5f..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/returns.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/returns.html' is deprecated, extend '_base/docstring/returns.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html.jinja
index bc8ee4ff..da693da7 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering returns section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
@@ -39,8 +38,7 @@ Context:
{% if returns.annotation %}
{% with expression = returns.annotation, backlink_type = "returned-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -65,8 +63,7 @@ Context:
{% if returns.annotation %}
{% with expression = returns.annotation, backlink_type = "returned-by" %}
{% if returns.name %} ({% endif %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% if returns.name %}){% endif %}
{% endwith %}
{% endif %}
@@ -97,8 +94,7 @@ Context:
{% elif returns.annotation %}
{% with expression = returns.annotation, backlink_type = "returned-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -112,8 +108,7 @@ Context:
{{ lang.t("TYPE:") }}
{% with expression = returns.annotation, backlink_type = "returned-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_aliases.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_aliases.html
deleted file mode 100644
index e9a99d1b..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_aliases.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/type_aliases.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/type_aliases.html' is deprecated, extend '_base/docstring/type_aliases.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_aliases.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_aliases.html.jinja
index ceaa520c..e1c87754 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_aliases.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_aliases.html.jinja
@@ -15,7 +15,7 @@ Context:
{{ log.debug("Rendering type aliases section") }}
{% endblock logs %}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_parameters.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_parameters.html
deleted file mode 100644
index 90a1af38..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_parameters.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/type_parameters.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/type_parameters.html' is deprecated, extend '_base/docstring/type_parameters.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_parameters.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_parameters.html.jinja
index 8e83e8be..6fe8bb4e 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_parameters.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_parameters.html.jinja
@@ -15,7 +15,7 @@ Context:
{{ log.debug("Rendering type parameters section") }}
{% endblock logs %}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
@@ -56,7 +56,7 @@ Context:
{% if type_parameter.annotation %}
{% with expression = type_parameter.annotation %}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -68,7 +68,7 @@ Context:
{% if type_parameter.default %}
{% with expression = type_parameter.default %}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% else %}
{{ lang.t("required") }}
@@ -108,12 +108,12 @@ Context:
{%- endif -%}
{%- if type_parameter.bound -%}
{%- with expression = type_parameter.bound -%}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{%- endwith -%}
{%- if type_parameter.default %}, {% endif -%}
{%- elif type_parameter.constraints -%}
{%- for expression in type_parameter.constraints -%}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{%- if not loop.last %}, {% endif -%}
{%- endfor -%}
{%- if type_parameter.default %}, {% endif -%}
@@ -121,7 +121,7 @@ Context:
{%- if type_parameter.default -%}
{{ lang.t("default:") }}
{% with expression = type_parameter.default %}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{%- endwith -%}
{%- endif -%}
{%- if type_parameter.constraints or type_parameter.default -%}
@@ -177,7 +177,7 @@ Context:
{{ lang.t("CONSTRAINTS:") }}
{% for constraint in type_parameter.constraints -%}
{%- with expression = constraint -%}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{%- endwith -%}
{%- if not loop.last %}, {% endif -%}
{% endfor %}
@@ -186,7 +186,7 @@ Context:
{{ lang.t("BOUND:") }}
{% with expression = type_parameter.bound %}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -194,7 +194,7 @@ Context:
{{ lang.t("DEFAULT:") }}
{% with expression = type_parameter.default %}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html
deleted file mode 100644
index 9eba72ab..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/warns.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/warns.html' is deprecated, extend '_base/docstring/warns.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html.jinja
index d5a24262..6f7e69de 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering warns section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
@@ -36,8 +35,7 @@ Context:
{% if warns.annotation %}
{% with expression = warns.annotation, backlink_type = "emitted-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -60,8 +58,7 @@ Context:
{% if warns.annotation %}
{% with expression = warns.annotation, backlink_type = "emitted-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
–
{% endif %}
@@ -88,8 +85,7 @@ Context:
{% with expression = warns.annotation, backlink_type = "emitted-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html
deleted file mode 100644
index 6ec31dd0..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/yields.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/yields.html' is deprecated, extend '_base/docstring/yields.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html.jinja
index 154d0202..69e5ea6d 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug("Rendering yields section") }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
{% if config.docstring_section_style == "table" %}
@@ -39,8 +38,7 @@ Context:
{% if yields.annotation %}
{% with expression = yields.annotation, backlink_type = "yielded-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -65,8 +63,7 @@ Context:
{% if yields.annotation %}
{% with expression = yields.annotation, backlink_type = "yielded-by" %}
{% if yields.name %} ({% endif %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% if yields.name %}){% endif %}
{% endwith %}
{% endif %}
@@ -97,8 +94,7 @@ Context:
{% elif yields.annotation %}
{% with expression = yields.annotation, backlink_type = "yielded-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
@@ -112,8 +108,7 @@ Context:
{{ lang.t("TYPE:") }}:
{% with expression = yields.annotation, backlink_type = "yielded-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html b/src/mkdocstrings_handlers/python/templates/material/_base/expression.html
deleted file mode 100644
index 8c84928c..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/expression.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/expression.html' is deprecated, extend '_base/expression.html.jinja' instead. ",
- 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
deleted file mode 100644
index 4afd930b..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/function.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/function.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/function.html' is deprecated, extend '_base/function.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja
index f296c214..3cfc7f30 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja
@@ -17,8 +17,7 @@ Context:
{{ log.debug("Rendering " + function.path) }}
{% endblock logs %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
@@ -62,9 +61,8 @@ Context:
{% else %}
{%+ filter highlight(language="python", inline=True) -%}
{{ function_name }}
- {#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within block. -#}
- {%- include "type_parameters"|get_template with context -%}
- {%- include "signature"|get_template with context -%}
+ {%- include "type_parameters.html.jinja" with context -%}
+ {%- include "signature.html.jinja" with context -%}
{%- endfilter %}
{% endif %}
{% endblock heading %}
@@ -75,8 +73,7 @@ Context:
This block renders the labels for the function.
-#}
{% with labels = function.labels %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "labels"|get_template with context %}
+ {% include "labels.html.jinja" with context %}
{% endwith %}
{% endblock labels %}
@@ -134,8 +131,7 @@ Context:
This block renders the docstring for the function.
-#}
{% with docstring_sections = function.docstring.parsed %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring"|get_template with context %}
+ {% include "docstring.html.jinja" with context %}
{% endwith %}
{% endblock docstring %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/labels.html b/src/mkdocstrings_handlers/python/templates/material/_base/labels.html
deleted file mode 100644
index cda79114..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/labels.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/labels.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/labels.html' is deprecated, extend '_base/labels.html.jinja' instead. ",
- 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
deleted file mode 100644
index a5a86545..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/language.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/language.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/language.html' is deprecated, extend '_base/language.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/language.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/language.html.jinja
index 5a4b773e..31ecfdd6 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/language.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/language.html.jinja
@@ -7,15 +7,12 @@
-#}
{% endblock logs %}
-{# YORE: Bump 2: Replace `| get_template` with `~ ".html.jinja"` within line. #}
-{% set lang_pth = "languages/" ~ locale | get_template %}
+{% set lang_pth = "languages/" ~ locale ~ ".html.jinja" %}
{% if lang_pth is existing_template %}
{% import lang_pth as lang %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% import "languages/en"|get_template as fallback %}
+ {% import "languages/en.html.jinja" as fallback %}
{% macro t(key) %}{{ lang.t(key) or fallback.t(key) }}{% endmacro %}
{% else %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% import "languages/en"|get_template as lang %}
+ {% import "languages/en.html.jinja" as lang %}
{% macro t(key) %}{{ lang.t(key) }}{% endmacro %}
{% endif %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html b/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html
deleted file mode 100644
index 2f050a32..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/languages/en.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/languages/en.html' is deprecated, extend '_base/languages/en.html.jinja' instead. ",
- 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
deleted file mode 100644
index 1f3095f4..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/languages/ja.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/languages/ja.html' is deprecated, extend '_base/languages/ja.html.jinja' instead. ",
- 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
deleted file mode 100644
index b58b0479..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/languages/zh.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/languages/zh.html' is deprecated, extend '_base/languages/zh.html.jinja' instead. ",
- 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
deleted file mode 100644
index dcda15ea..00000000
--- a/src/mkdocstrings_handlers/python/templates/material/_base/module.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/module.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/module.html' is deprecated, extend '_base/module.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/module.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/module.html.jinja
index c5e4a400..c0f4a7cb 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/module.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/module.html.jinja
@@ -63,8 +63,7 @@ Context:
This block renders the labels for the module.
-#}
{% with labels = module.labels %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "labels"|get_template with context %}
+ {% include "labels.html.jinja" with context %}
{% endwith %}
{% endblock labels %}
@@ -98,8 +97,7 @@ Context:
This block renders the docstring for the module.
-#}
{% with docstring_sections = module.docstring.parsed %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "docstring"|get_template with context %}
+ {% include "docstring.html.jinja" with context %}
{% endwith %}
{% endblock docstring %}
@@ -112,8 +110,7 @@ Context:
This block renders auto-summaries for classes, methods, and attributes.
-#}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "summary"|get_template with context %}
+ {% include "summary.html.jinja" with context %}
{% endblock summary %}
{% block children scoped %}
@@ -123,8 +120,7 @@ Context:
-#}
{% set root = False %}
{% set heading_level = heading_level + 1 %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "children"|get_template with context %}
+ {% include "children.html.jinja" with context %}
{% endblock children %}
{% endblock contents %}
{% block contents scoped %}
{#- Contents block.
-
+
This block renders the contents of the class.
It contains other blocks that users can override.
Overriding the contents block allows to rearrange the order of the blocks.
-#}
{% block bases scoped %}
{#- Class bases block.
-
+
This block renders the bases for the class.
-#}
{% if config.show_bases and class.bases %}
Bases: {% for expression in class.bases -%}
- {% include "expression"|get_template with context %}{% if not loop.last %}, {% endif %}
+ {% include "expression.html.jinja" with context %}{% if not loop.last %}, {% endif %}
{% endfor -%}
{% endif %}
@@ -125,7 +125,7 @@ Context:
{% block inheritance_diagram scoped %}
{#- Inheritance diagram block.
-
+
This block renders the inheritance diagram for the class,
using Mermaid syntax and a bit of JavaScript to make the nodes clickable,
linking to the corresponding class documentation.
@@ -173,17 +173,17 @@ Context:
{% block docstring scoped %}
{#- Docstring block.
-
+
This block renders the docstring for the class.
-#}
{% with docstring_sections = class.docstring.parsed %}
- {% include "docstring"|get_template with context %}
+ {% include "docstring.html.jinja" with context %}
{% endwith %}
{% if config.merge_init_into_class %}
{% if "__init__" in class.all_members and class.all_members["__init__"].has_docstring %}
{% with function = class.all_members["__init__"] %}
{% with obj = function, docstring_sections = function.docstring.parsed %}
- {% include "docstring"|get_template with context %}
+ {% include "docstring.html.jinja" with context %}
{% endwith %}
{% endwith %}
{% endif %}
@@ -192,15 +192,15 @@ Context:
{% block summary scoped %}
{#- Summary block.
-
+
This block renders auto-summaries for classes, methods, and attributes.
-#}
- {% include "summary"|get_template with context %}
+ {% include "summary.html.jinja" with context %}
{% endblock summary %}
{% block source scoped %}
{#- Source block.
-
+
This block renders the source code for the class.
-#}
{% if config.show_source %}
@@ -236,12 +236,12 @@ Context:
{% block children scoped %}
{#- Children block.
-
+
This block renders the children (members) of the class.
-#}
{% set root = False %}
{% set heading_level = heading_level + 1 %}
- {% include "children"|get_template with context %}
+ {% include "children.html.jinja" with context %}
{% endblock children %}
{% endblock contents %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html
deleted file mode 100644
index 9f2abcd1..00000000
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/attributes.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/attributes.html' is deprecated, extend '_base/docstring/attributes.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html.jinja b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html.jinja
index e8804310..a3817449 100644
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/attributes.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug() }}
{% endblock %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
@@ -34,8 +33,7 @@ Context:
{{ attribute.name }}
{% if attribute.annotation %}
{% with expression = attribute.annotation %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- ({% include "expression"|get_template with context %})
+ ({% include "expression.html.jinja" with context %})
{% endwith %}
{% endif %}
–
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
deleted file mode 100644
index 02261331..00000000
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/other_parameters.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/other_parameters.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/other_parameters.html' is deprecated, extend '_base/docstring/other_parameters.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/other_parameters.html.jinja b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/other_parameters.html.jinja
index 6605e48d..f7af2121 100644
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/other_parameters.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/other_parameters.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug() }}
{% endblock %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
@@ -34,8 +33,7 @@ Context:
{{ parameter.name }}
{% if parameter.annotation %}
{% with expression = parameter.annotation, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- ({% include "expression"|get_template with context %})
+ ({% include "expression.html.jinja" with context %})
{% endwith %}
{% endif %}
–
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html
deleted file mode 100644
index f5292150..00000000
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/parameters.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/parameters.html' is deprecated, extend '_base/docstring/parameters.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html.jinja b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html.jinja
index de01dcbe..95c480fa 100644
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/parameters.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug() }}
{% endblock %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
@@ -34,12 +33,10 @@ Context:
{{ parameter.name }}
{% if parameter.annotation %}
{% with expression = parameter.annotation, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- ({% include "expression"|get_template with context %}
+ ({% include "expression.html.jinja" with context %}
{%- if parameter.default %}, {{ lang.t("default:") }}
{% with expression = parameter.default, backlink_type = "used-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %})
{% endwith %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html
deleted file mode 100644
index 38a21e89..00000000
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/raises.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/raises.html' is deprecated, extend '_base/docstring/raises.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html.jinja b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html.jinja
index cf7d0b01..71beb34c 100644
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/raises.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug() }}
{% endblock %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
@@ -33,8 +32,7 @@ Context:
{% if raises.annotation %}
{% with expression = raises.annotation, backlink_type = "raised-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
–
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html
deleted file mode 100644
index d9c404b6..00000000
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/receives.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/receives.html' is deprecated, extend '_base/docstring/receives.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html.jinja b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html.jinja
index 84d6c1bc..8ad9cae3 100644
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/receives.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug() }}
{% endblock %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
@@ -35,8 +34,7 @@ Context:
{% if receives.annotation %}
{% with expression = receives.annotation, backlink_type = "received-by" %}
{% if receives.name %}({% endif %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% if receives.name %}){% endif %}
{% endwith %}
{% endif %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html
deleted file mode 100644
index b608af5f..00000000
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/returns.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/returns.html' is deprecated, extend '_base/docstring/returns.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html.jinja b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html.jinja
index c1171c7e..2201f545 100644
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/returns.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug() }}
{% endblock %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
@@ -35,8 +34,7 @@ Context:
{% if returns.annotation %}
{% with expression = returns.annotation, backlink_type = "returned-by" %}
{% if returns.name %}({% endif %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% if returns.name %}){% endif %}
{% endwith %}
{% endif %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html
deleted file mode 100644
index 9eba72ab..00000000
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/warns.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/warns.html' is deprecated, extend '_base/docstring/warns.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html.jinja b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html.jinja
index 5570ca37..97cbc1de 100644
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/warns.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug() }}
{% endblock %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}
@@ -33,8 +32,7 @@ Context:
{% if warns.annotation %}
{% with expression = warns.annotation, backlink_type = "emitted-by" %}
- {# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
- {% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
–
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html
deleted file mode 100644
index 6ec31dd0..00000000
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{# YORE: Bump 2: Remove file. #}
-{% extends "_base/docstring/yields.html.jinja" %}
-
-{% block logs scoped %}
- {{ super() }}
- {{ log.warning(
- "DeprecationWarning: Extending '_base/docstring/yields.html' is deprecated, extend '_base/docstring/yields.html.jinja' instead. ",
- once=True,
- ) }}
-{% endblock logs %}
diff --git a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html.jinja b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html.jinja
index 712776fe..8298421f 100644
--- a/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/readthedocs/_base/docstring/yields.html.jinja
@@ -15,8 +15,7 @@ Context:
{{ log.debug() }}
{% endblock %}
-{# YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. #}
-{% import "language"|get_template as lang with context %}
+{% import "language.html.jinja" as lang with context %}
{#- Language module providing the `t` translation method. -#}