From 73f11dcc584a672af7e17738cba08a50f119176a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Sat, 19 Oct 2024 19:49:04 +0200 Subject: [PATCH 1/2] fix: Always render cross-references outside of signatures Issue-mkdocstrings#700: https://github.com/mkdocstrings/mkdocstrings/issues/700 --- .../material/_base/expression.html.jinja | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 c34c0be5..4aea143d 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html.jinja +++ b/src/mkdocstrings_handlers/python/templates/material/_base/expression.html.jinja @@ -32,15 +32,16 @@ which is a tree-like structure representing a Python expression. {%- set annotation = full -%} {%- endif -%} {%- for title, path in annotation|split_path(full) -%} - {%- if config.signature_crossrefs -%} - {%- if signature -%} - {%- filter stash_crossref(length=title|length) -%} - {{ title }} - {%- endfilter -%} - {%- else -%} + {%- if not signature -%} + {#- Always render cross-references outside of signatures. We don't need to stash them. -#} + {{ title }} + {%- elif config.signature_crossrefs -%} + {#- We're in a signature and cross-references are enabled, we must render one and stash it. -#} + {%- filter stash_crossref(length=title|length) -%} {{ title }} - {%- endif -%} + {%- endfilter -%} {%- else -%} + {#- We're in a signature but cross-references are disabled, we just render the title. -#} {{ title }} {%- endif -%} {%- if not loop.last -%}.{%- endif -%} From 1b064a0f21b32afb2686ac320d89ccde6d5fb294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Sat, 19 Oct 2024 19:54:17 +0200 Subject: [PATCH 2/2] chore: Prepare release 1.12.2 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d9f4c0d..8c03b29f 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.12.2](https://github.com/mkdocstrings/python/releases/tag/1.12.2) - 2024-10-19 + +[Compare with 1.12.1](https://github.com/mkdocstrings/python/compare/1.12.1...1.12.2) + +### Bug Fixes + +- Always render cross-references outside of signatures ([73f11dc](https://github.com/mkdocstrings/python/commit/73f11dcc584a672af7e17738cba08a50f119176a) by Timothée Mazzucotelli). [Issue-mkdocstrings#700](https://github.com/mkdocstrings/mkdocstrings/issues/700) + ## [1.12.1](https://github.com/mkdocstrings/python/releases/tag/1.12.1) - 2024-10-14 [Compare with 1.12.0](https://github.com/mkdocstrings/python/compare/1.12.0...1.12.1)