diff --git a/.copier-answers.yml b/.copier-answers.yml index 39641f11..d2a2b345 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier. -_commit: 1.6.0 +_commit: 1.6.1 _src_path: gh:mkdocstrings/handler-template author_email: dev@pawamoy.fr author_fullname: Timothée Mazzucotelli diff --git a/CHANGELOG.md b/CHANGELOG.md index 179b9a26..5120a58a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,43 @@ 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). +## [2.0.3](https://github.com/mkdocstrings/python/releases/tag/2.0.3) - 2026-02-20 + +[Compare with 2.0.2](https://github.com/mkdocstrings/python/compare/2.0.2...2.0.3) + +### Build + +- Depend on griffelib instead of griffe ([770a5f6](https://github.com/mkdocstrings/python/commit/770a5f69d801f24f0b36d1e671a540196e06f710) by Timothée Mazzucotelli). + +## [2.0.2](https://github.com/mkdocstrings/python/releases/tag/2.0.2) - 2026-02-09 + +[Compare with 2.0.1](https://github.com/mkdocstrings/python/compare/2.0.1...2.0.2) + +### Bug Fixes + +- Fix aliases for parameters ([0ae77a3](https://github.com/mkdocstrings/python/commit/0ae77a3454d47e873be38637ea30d043004ee981) by Timothée Mazzucotelli). [Issue-mkdocstrings-813](https://github.com/mkdocstrings/mkdocstrings/issues/813) + +## [2.0.1](https://github.com/mkdocstrings/python/releases/tag/2.0.1) - 2025-12-03 + +[Compare with 2.0.0](https://github.com/mkdocstrings/python/compare/2.0.0...2.0.1) + +### Bug Fixes + +- Don't ignore filters when category grouping is disabled ([63aa1b0](https://github.com/mkdocstrings/python/commit/63aa1b0af0d14912ebf83a4e3c2cd0c7f2a19dae) by Timothée Mazzucotelli). [Issue-324](https://github.com/mkdocstrings/python/issues/324) + +### Code Refactoring + +- Localize more contents in templates ([854b6a6](https://github.com/mkdocstrings/python/commit/854b6a601bd334fe544285aa9eae11482388a583) by Zhikang Yan). [PR-321](https://github.com/mkdocstrings/python/pull/321) +- Improve ja/zh translations ([b83107c](https://github.com/mkdocstrings/python/commit/b83107c8e86d9650fe4544e569f6da16a46b8472) by Zhikang Yan). [PR-322](https://github.com/mkdocstrings/python/pull/322) + +## [2.0.0](https://github.com/mkdocstrings/python/releases/tag/2.0.0) - 2025-11-27 + +[Compare with 1.19.0](https://github.com/mkdocstrings/python/compare/1.19.0...2.0.0) + +### Code Refactoring + +- Remove deprecated code for v2 ([c10afdb](https://github.com/mkdocstrings/python/commit/c10afdb98d590a23c8840c7c0cdd6c358094dc2c) by Timothée Mazzucotelli). + ## [1.19.0](https://github.com/mkdocstrings/python/releases/tag/1.19.0) - 2025-11-10 [Compare with 1.18.2](https://github.com/mkdocstrings/python/compare/1.18.2...1.19.0) diff --git a/README.md b/README.md index 485a1c0d..2d559588 100644 --- a/README.md +++ b/README.md @@ -81,4 +81,56 @@ dependencies = [ ## Sponsors + +
+ +--- + + + + +*And 7 more private sponsor(s).* + diff --git a/docs/.overrides/main.html b/docs/.overrides/main.html deleted file mode 100644 index c702362f..00000000 --- a/docs/.overrides/main.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "base.html" %} - -{% block announce %} - Fund this project through - sponsorship - - {% include ".icons/octicons/heart-fill-16.svg" %} - — - Follow - @pawamoy on - - - {% include ".icons/fontawesome/brands/mastodon.svg" %} - - Fosstodon - - for updates -{% endblock %} diff --git a/duties.py b/duties.py index a48e743f..3aa9b662 100644 --- a/duties.py +++ b/duties.py @@ -5,16 +5,12 @@ import os import re import sys -from contextlib import contextmanager -from importlib.metadata import version as pkgversion from pathlib import Path from typing import TYPE_CHECKING from duty import duty, tools if TYPE_CHECKING: - from collections.abc import Iterator - from duty.context import Context @@ -36,18 +32,6 @@ def pyprefix(title: str) -> str: return title -@contextmanager -def material_insiders() -> Iterator[bool]: - if "+insiders" in pkgversion("mkdocs-material"): - os.environ["MATERIAL_INSIDERS"] = "true" - try: - yield True - finally: - os.environ.pop("MATERIAL_INSIDERS") - else: - yield False - - def _get_changelog_version() -> str: changelog_version_re = re.compile(r"^## \[(\d+\.\d+\.\d+)\].*$") with Path(__file__).parent.joinpath("CHANGELOG.md").open("r", encoding="utf8") as file: @@ -88,11 +72,10 @@ def check_docs(ctx: Context) -> None: """Check if the documentation builds correctly.""" Path("htmlcov").mkdir(parents=True, exist_ok=True) Path("htmlcov/index.html").touch(exist_ok=True) - with material_insiders(): - ctx.run( - tools.mkdocs.build(strict=True, verbose=True), - title=pyprefix("Building documentation"), - ) + ctx.run( + tools.mkdocs.build(strict=True, verbose=True), + title=pyprefix("Building documentation"), + ) @duty(nofail=PY_VERSION == PY_DEV) @@ -126,22 +109,18 @@ def docs(ctx: Context, *cli_args: str, host: str = "127.0.0.1", port: int = 8000 host: The host to serve the docs from. port: The port to serve the docs on. """ - with material_insiders(): - ctx.run( - tools.mkdocs.serve(dev_addr=f"{host}:{port}").add_args(*cli_args), - title="Serving documentation", - capture=False, - ) + ctx.run( + tools.mkdocs.serve(dev_addr=f"{host}:{port}").add_args(*cli_args), + title="Serving documentation", + capture=False, + ) @duty(skip_if=sys.version_info < (3, 13), skip_reason=pyprefix("Skipped: docs require modern generics syntax")) def docs_deploy(ctx: Context) -> None: """Deploy the documentation to GitHub pages.""" os.environ["DEPLOY"] = "true" - with material_insiders() as insiders: - if not insiders: - ctx.run(lambda: False, title="Not deploying docs without Material for MkDocs Insiders!") - ctx.run(tools.mkdocs.gh_deploy(force=True), title="Deploying documentation") + ctx.run(tools.mkdocs.gh_deploy(force=True), title="Deploying documentation") @duty diff --git a/mkdocs.yml b/mkdocs.yml index 30a806d1..64d0de3a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -197,11 +197,7 @@ plugins: reference/mkdocstrings_handlers/python/debug.md: reference/api.md#mkdocstrings_handlers.python.debug reference/mkdocstrings_handlers/python/handler.md: reference/api.md#mkdocstrings_handlers.python.handler reference/mkdocstrings_handlers/python/rendering.md: reference/api.md#mkdocstrings_handlers.python.rendering - -- group: - enabled: !ENV [MATERIAL_INSIDERS, false] - plugins: - - typeset +- typeset extra: social: diff --git a/pyproject.toml b/pyproject.toml index 2d6c7188..96d3c713 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ classifiers = [ dependencies = [ "mkdocstrings>=0.30", "mkdocs-autorefs>=1.4", - "griffe>=1.13", + "griffelib>=2.0", "typing-extensions>=4.0; python_version < '3.11'", ] diff --git a/scripts/gen_credits.py b/scripts/gen_credits.py index 6a81e239..0eab7685 100644 --- a/scripts/gen_credits.py +++ b/scripts/gen_credits.py @@ -55,7 +55,7 @@ def _extra_marker(req: Requirement) -> str | None: if not req.marker: return None try: - return next(marker[2].value for marker in req.marker._markers if getattr(marker[0], "value", None) == "extra") + return next(marker[2].value for marker in req.marker._markers if getattr(marker[0], "value", None) == "extra") # type: ignore[union-attr] except StopIteration: return None diff --git a/scripts/griffe_extensions.py b/scripts/griffe_extensions.py index eb50f5f2..5a4447ca 100644 --- a/scripts/griffe_extensions.py +++ b/scripts/griffe_extensions.py @@ -24,7 +24,7 @@ def on_attribute_instance( if attr.docstring: return try: - field: griffe.ExprCall = attr.annotation.slice.elements[1] # type: ignore[union-attr] + field: griffe.ExprCall = attr.annotation.slice.elements[1] except AttributeError: return 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/config.py b/src/mkdocstrings_handlers/python/_internal/config.py index 79ba87f9..f9f8963b 100644 --- a/src/mkdocstrings_handlers/python/_internal/config.py +++ b/src/mkdocstrings_handlers/python/_internal/config.py @@ -498,7 +498,7 @@ class PythonInputOptions: those added to `__all__` or not starting with an underscore (except for special methods/attributes). """, ), - ] = field(default_factory=lambda: _DEFAULT_FILTERS.copy()) + ] = field(default_factory=_DEFAULT_FILTERS.copy) find_stubs_package: Annotated[ bool, diff --git a/src/mkdocstrings_handlers/python/_internal/handler.py b/src/mkdocstrings_handlers/python/_internal/handler.py index 5945455d..b84cd8ba 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(): @@ -160,7 +139,7 @@ def load_inventory( ) -> Iterator[tuple[str, str]]: """Yield items and their URLs from an inventory file streamed from `in_file`. - This implements mkdocstrings' `load_inventory` "protocol" (see [`mkdocstrings.plugin`][]). + This implements mkdocstrings' `load_inventory` "protocol" (see [`mkdocstrings.BaseHandler.load_inventory`][]). Arguments: in_file: The binary file-like object to read the inventory from. @@ -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. @@ -236,7 +203,7 @@ def collect(self, identifier: str, options: PythonOptions) -> CollectorItem: extensions=load_extensions(*extensions), search_paths=self._paths, docstring_parser=parser, - docstring_options=parser_options, # type: ignore[arg-type] + docstring_options=parser_options, modules_collection=self._modules_collection, lines_collection=self._lines_collection, allow_inspection=options.allow_inspection, @@ -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 @@ -366,7 +330,7 @@ def get_aliases(self, identifier: str) -> tuple[str, ...]: """ if "(" in identifier: identifier, parameter = identifier.split("(", 1) - parameter.removesuffix(")") + parameter = parameter.removesuffix(")") else: parameter = "" try: @@ -434,10 +398,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 - 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", []) + base_dir = Path(getattr(tool_config, "config_file_path", None) or "./mkdocs.yml").parent 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..a906b465 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("{text}"
- return Markup(text).format(**variables) # noqa: S704
-
-
_split_path_re = re.compile(r"([.(]?)([\w]+)(\))?")
_splitable_re = re.compile(r"[().]")
@@ -492,15 +414,15 @@ def _keep_object(name: str, filters: Sequence[tuple[Pattern, bool]]) -> bool:
def _parents(obj: Alias) -> set[str]:
- parent: Object | Alias = obj.parent # type: ignore[assignment]
+ parent: Object | Alias = obj.parent
parents = {obj.path, parent.path}
if parent.is_alias:
- parents.add(parent.final_target.path) # type: ignore[union-attr]
+ parents.add(parent.final_target.path)
while parent.parent:
parent = parent.parent
parents.add(parent.path)
if parent.is_alias:
- parents.add(parent.final_target.path) # type: ignore[union-attr]
+ parents.add(parent.final_target.path)
return parents
@@ -509,7 +431,7 @@ def _remove_cycles(objects: list[Object | Alias]) -> Iterator[Object | Alias]:
for obj in objects:
if obj.is_alias:
with suppress_errors:
- if obj.final_target.path in _parents(obj): # type: ignore[arg-type,union-attr]
+ if obj.final_target.path in _parents(obj):
continue
yield obj
@@ -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
@@ -875,7 +778,7 @@ def expand_identifier(self, identifier: str) -> str:
obj = self.current_object
while identifier and identifier[0] == ".":
identifier = identifier[1:]
- obj = obj.parent # type: ignore[assignment]
+ obj = obj.parent
identifier = f"{obj.path}.{identifier}" if identifier else obj.path
# We resolve the identifier to its full path.
@@ -906,8 +809,8 @@ def get_context(self) -> AutorefsHookInterface.Context:
}.get(self.current_object.kind.value.lower(), "obj")
origin = self.current_object.path
try:
- filepath = self.current_object.docstring.parent.filepath # type: ignore[union-attr]
- lineno = self.current_object.docstring.lineno or 0 # type: ignore[union-attr]
+ filepath = self.current_object.docstring.parent.filepath
+ lineno = self.current_object.docstring.lineno or 0
except AttributeError:
filepath = self.current_object.filepath
lineno = 0
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/children.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja
index 3be0a33a..63f3b1a6 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja
@@ -19,6 +19,9 @@ Context:
{{ log.debug("Rendering children of " + obj.path) }}
{% endblock logs %}
+ {% import "language.html.jinja" as lang with context %}
+ {#- Language module providing the `t` translation method. -#}
+
{%- 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 +210,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 +219,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 +236,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 %}
@@ -253,7 +249,7 @@ Context:
{% if "__init__" in all_members and all_members["__init__"].source %}
{% with init = all_members["__init__"] %}
+ {{ lang.t("Source code in") }}
{%- if init.relative_filepath.is_absolute() -%}
{{ init.relative_package_filepath }}
{%- else -%}
@@ -266,7 +262,7 @@ Context:
{% endif %}
{% elif class.source %}
- Source code in
+ {{ lang.t("Source code in") }}
{%- if class.relative_filepath.is_absolute() -%}
{{ class.relative_package_filepath }}
{%- else -%}
@@ -286,8 +282,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 %}
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
{{ 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 %}
–
@@ -96,10 +93,9 @@ Context:
{% if attribute.annotation %}
- TYPE:
+ {{ lang.t("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:{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
{{ 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:
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
{% 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:
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
–
{% endif %}
@@ -88,8 +85,7 @@ Context:
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
{% 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:
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
{% 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:
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
{% 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:
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
–
{% endif %}
@@ -88,8 +85,7 @@ Context:
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% include "expression"|get_template with context %}
+ {% include "expression.html.jinja" with context %}
{% endwith %}
{% endif %}
{% 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. -#}
{% endif %}
@@ -52,7 +52,7 @@ Context:
{% 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 %}
+ {{ class_name }}{% include "signature.html.jinja" with context %}
{% endfilter %}
{% endwith %}
{% else %}
@@ -62,11 +62,11 @@ Context:
{% block labels scoped %}
{#- Labels block.
-
+
This block renders the labels for the class.
-#}
{% with labels = class.labels %}
- {% include "labels"|get_template with context %}
+ {% include "labels.html.jinja" with context %}
{% endwith %}
{% endblock labels %}
@@ -74,7 +74,7 @@ Context:
{% block signature scoped %}
{#- Signature block.
-
+
This block renders the signature for the class.
-#}
{% if config.separate_signature and config.merge_init_into_class %}
@@ -104,20 +104,20 @@ Context:
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 -%}