From 15f2cd48b79a1f062086a47ea0c6bc52d89786d8 Mon Sep 17 00:00:00 2001 From: Uchechukwu Orji Date: Wed, 5 Feb 2025 16:00:57 +0100 Subject: [PATCH 1/2] fix: Remove type from property docstring summary in summary sections PR-242: https://github.com/mkdocstrings/python/pull/242 --- src/mkdocstrings_handlers/python/rendering.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mkdocstrings_handlers/python/rendering.py b/src/mkdocstrings_handlers/python/rendering.py index 836e4164..e298997a 100644 --- a/src/mkdocstrings_handlers/python/rendering.py +++ b/src/mkdocstrings_handlers/python/rendering.py @@ -539,11 +539,20 @@ def do_as_attributes_section( Returns: An attributes docstring section. """ + + def _parse_docstring_summary(attribute: Attribute) -> str: + if attribute.docstring is None: + return "" + line = attribute.docstring.value.split("\n", 1)[0] + if ":" in line and attribute.docstring.parser_options.get("returns_type_in_property_summary", False): + _, line = line.split(":", 1) + return line + return DocstringSectionAttributes( [ DocstringAttribute( name=attribute.name, - description=attribute.docstring.value.split("\n", 1)[0] if attribute.docstring else "", + description=_parse_docstring_summary(attribute), annotation=attribute.annotation, value=attribute.value, # type: ignore[arg-type] ) From 9751b536c0ed9ad3f60b89b2d8cba36089ef486d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Wed, 5 Feb 2025 16:02:37 +0100 Subject: [PATCH 2/2] chore: Prepare release 1.14.5 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9469c574..34430a94 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.14.5](https://github.com/mkdocstrings/python/releases/tag/1.14.5) - 2025-02-05 + +[Compare with 1.14.4](https://github.com/mkdocstrings/python/compare/1.14.4...1.14.5) + +### Bug Fixes + +- Remove type from property docstring summary in summary sections ([15f2cd4](https://github.com/mkdocstrings/python/commit/15f2cd48b79a1f062086a47ea0c6bc52d89786d8) by Uchechukwu Orji). [PR-242](https://github.com/mkdocstrings/python/pull/242) + ## [1.14.4](https://github.com/mkdocstrings/python/releases/tag/1.14.4) - 2025-02-04 [Compare with 1.14.3](https://github.com/mkdocstrings/python/compare/1.14.3...1.14.4)