diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b51648e..818971b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ 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). +## [0.6.1](https://github.com/mkdocstrings/python/releases/tag/0.6.1) - 2022-02-17 + +[Compare with 0.6.0](https://github.com/mkdocstrings/python/compare/0.6.0...0.6.1) + +### Bug Fixes +- Don't pop from fallback config ([bde32af](https://github.com/mkdocstrings/python/commit/bde32afb5d99539813b1884a4c735de5845f62ae) by Timothée Mazzucotelli). +- Fix rendering init method source when merged into class ([4a20aea](https://github.com/mkdocstrings/python/commit/4a20aeaa60f3efbcb4781a369feef3b4826ff1df) by Timothée Mazzucotelli). + + ## [0.6.0](https://github.com/mkdocstrings/python/releases/tag/0.6.0) - 2022-02-13 [Compare with 0.5.4](https://github.com/mkdocstrings/python/compare/0.5.4...0.6.0) diff --git a/src/mkdocstrings_handlers/python/collector.py b/src/mkdocstrings_handlers/python/collector.py index 02502e05..eb1879bd 100644 --- a/src/mkdocstrings_handlers/python/collector.py +++ b/src/mkdocstrings_handlers/python/collector.py @@ -55,7 +55,7 @@ def collect(self, identifier: str, config: dict) -> CollectorItem: # noqa: WPS2 """ module_name = identifier.split(".", 1)[0] unknown_module = module_name not in self._modules_collection - if config.pop("fallback", False) and unknown_module: + if config.get("fallback", False) and unknown_module: raise CollectionError("Not loading additional modules during fallback") final_config = ChainMap(config, self.default_config) diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html b/src/mkdocstrings_handlers/python/templates/material/_base/class.html index 97a5640b..8f47fb84 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html @@ -91,10 +91,10 @@ {% if config.show_source %} {% if config.merge_init_into_class %} - {% if "__init__" in class.members %} + {% if "__init__" in class.members and class.members["__init__"].source %}
Source code in {{ class.relative_filepath }} - {{ class.members["__init__"].source|highlight(language="python", linestart=class.lineno, linenums=True) }} + {{ class.members["__init__"].source|highlight(language="python", linestart=class.members["__init__"].lineno, linenums=True) }}
{% endif %} {% elif class.source %}