From 0543492a6f43f28408fb98e148f1a206d4e7a6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Thu, 3 Mar 2022 19:22:20 +0100 Subject: [PATCH 1/5] chore: Typo in comment --- src/mkdocstrings_handlers/python/templates/material/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mkdocstrings_handlers/python/templates/material/style.css b/src/mkdocstrings_handlers/python/templates/material/style.css index 350ce132..3b797587 100644 --- a/src/mkdocstrings_handlers/python/templates/material/style.css +++ b/src/mkdocstrings_handlers/python/templates/material/style.css @@ -29,7 +29,7 @@ h5.doc-heading { display: inline; } -/* Defaults in Spacy table style/ */ +/* Defaults in Spacy table style. */ .doc-param-default { float: right; -} \ No newline at end of file +} From 6545900eecc67c8a6ddd343c497ac22fdd6a26e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Thu, 3 Mar 2022 19:22:44 +0100 Subject: [PATCH 2/5] refactor: Use `pycon` for examples code blocks --- .../python/templates/material/_base/docstring/examples.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html index 8f6df880..54bbfa5d 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html @@ -4,6 +4,6 @@ {% if section_type.value == "text" %} {{ sub_section|convert_markdown(heading_level, html_id) }} {% elif section_type.value == "examples" %} - {{ sub_section|highlight(language="python", linenums=False) }} + {{ sub_section|highlight(language="pycon", linenums=False) }} {% endif %} {% endfor %} From 2ec638e083bfa98c41c59d86bb467a7fe23ce8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Sat, 5 Mar 2022 18:54:17 +0100 Subject: [PATCH 3/5] docs: Cross-link to griffe API --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index ec029ae6..0d35a92b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -76,6 +76,7 @@ plugins: import: - https://docs.python.org/3/objects.inv - https://mkdocstrings.github.io/objects.inv + - https://mkdocstrings.github.io/griffe/objects.inv selection: docstring_style: google docstring_options: From 7f579d162e184adcfe25b2215bce4d38677f75b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Sat, 5 Mar 2022 18:55:28 +0100 Subject: [PATCH 4/5] refactor: Always hide `self` and `cls` parameters Issue #7: https://github.com/mkdocstrings/python/issues/7 --- .../python/templates/material/_base/class.html | 6 ++---- .../python/templates/material/_base/signature.html | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html b/src/mkdocstrings_handlers/python/templates/material/_base/class.html index 8f47fb84..0e629dbe 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html @@ -28,9 +28,7 @@ {%- with function = class.members["__init__"] -%} {%- filter highlight(language="python", inline=True) -%} {% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %} - {% with no_self = True %} - {%- include "signature.html" with context -%} - {% endwith %} + {%- include "signature.html" with context -%} {%- endfilter -%} {%- endwith -%} {% else %} @@ -45,7 +43,7 @@ {% if config.separate_signature and config.merge_init_into_class %} {% if "__init__" in class.members %} - {% with function = class.members["__init__"], no_self = True %} + {% with function = class.members["__init__"] %} {% filter highlight(language="python", inline=False) %} {% filter format_signature(config.line_length) %} {% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/signature.html b/src/mkdocstrings_handlers/python/templates/material/_base/signature.html index 98658b6b..fb116880 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/signature.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/signature.html @@ -10,7 +10,7 @@ ( {%- for parameter in function.parameters -%} - {%- if parameter.name != "self" or not no_self -%} + {%- if parameter.name not in ("self", "cls") or loop.index0 > 0 or not (function.parent and function.parent.is_class) -%} {%- if parameter.kind.value == "positional-only" -%} {%- if ns.render_pos_only_separator -%} From b43e1a588fcf8d738bc3100edd60d735af8171f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Sun, 6 Mar 2022 00:12:16 +0100 Subject: [PATCH 5/5] chore: Prepare release 0.6.6 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cd416a5..ea3c8079 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.6](https://github.com/mkdocstrings/python/releases/tag/0.6.6) - 2022-03-06 + +[Compare with 0.6.5](https://github.com/mkdocstrings/python/compare/0.6.5...0.6.6) + +### Code Refactoring +- Always hide `self` and `cls` parameters ([7f579d1](https://github.com/mkdocstrings/python/commit/7f579d162e184adcfe25b2215bce4d38677f75b7) by Timothée Mazzucotelli). [Issue #7](https://github.com/mkdocstrings/python/issues/7) +- Use `pycon` for examples code blocks ([6545900](https://github.com/mkdocstrings/python/commit/6545900eecc67c8a6ddd343c497ac22fdd6a26e2) by Timothée Mazzucotelli). + + ## [0.6.5](https://github.com/mkdocstrings/python/releases/tag/0.6.5) - 2022-02-24 [Compare with 0.6.4](https://github.com/mkdocstrings/python/compare/0.6.4...0.6.5)