From eed51ee14bd973a08395f95377f9bd4cd38febfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Tue, 5 Sep 2023 13:41:11 +0200 Subject: [PATCH 1/3] fix: Don't render cross-ref spans when they're not enabled --- .../python/templates/material/_base/expression.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html b/src/mkdocstrings_handlers/python/templates/material/_base/expression.html index 52d3a624..6ba78963 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/expression.html @@ -8,9 +8,13 @@ {%- set annotation = full -%} {%- endif -%} {%- for title, path in annotation|split_path(full) -%} - {%- filter stash_crossref(length=title|length) -%} - {{ title }} - {%- endfilter -%} + {%- if not signature or config.signature_crossrefs -%} + {%- filter stash_crossref(length=title|length) -%} + {{ title }} + {%- endfilter -%} + {%- else -%} + {{ title }} + {%- endif -%} {%- if not loop.last -%}.{%- endif -%} {%- endfor -%} {%- endwith -%} From 7f38da334ce5b718117e50e3cf0b061c2add5a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Tue, 5 Sep 2023 13:47:41 +0200 Subject: [PATCH 2/3] chore: Prepare signature filter for overloads --- src/mkdocstrings_handlers/python/rendering.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mkdocstrings_handlers/python/rendering.py b/src/mkdocstrings_handlers/python/rendering.py index b2869bf9..46b34c01 100644 --- a/src/mkdocstrings_handlers/python/rendering.py +++ b/src/mkdocstrings_handlers/python/rendering.py @@ -88,13 +88,17 @@ def do_format_signature( function: Function, line_length: int, *, + annotations: bool | None = None, # noqa: ARG001 crossrefs: bool = False, # noqa: ARG001 ) -> str: """Format a signature using Black. Parameters: + context: Jinja context, passed automatically. callable_path: The path of the callable we render the signature of. + function: The function we render the signature of. line_length: The line length to give to Black. + annotations: Whether to show type annotations. crossrefs: Whether to cross-reference types in the signature. Returns: @@ -126,6 +130,7 @@ def do_format_attribute( """Format an attribute using Black. Parameters: + context: Jinja context, passed automatically. attribute_path: The path of the callable we render the signature of. attribute: The attribute we render the signature of. line_length: The line length to give to Black. From 8cfc7e9593db91856270f8120cea270994a103e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Tue, 5 Sep 2023 13:48:40 +0200 Subject: [PATCH 3/3] chore: Prepare release 1.6.2 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 117e17ba..4ee707a1 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.6.2](https://github.com/mkdocstrings/python/releases/tag/1.6.2) - 2023-09-05 + +[Compare with 1.6.1](https://github.com/mkdocstrings/python/compare/1.6.1...1.6.2) + +### Bug Fixes + +- Don't render cross-ref spans when they're not enabled ([eed51ee](https://github.com/mkdocstrings/python/commit/eed51ee14bd973a08395f95377f9bd4cd38febfc) by Timothée Mazzucotelli). + ## [1.6.1](https://github.com/mkdocstrings/python/releases/tag/1.6.1) - 2023-09-04 [Compare with 1.6.0](https://github.com/mkdocstrings/python/compare/1.6.0...1.6.1)