From ecc80b329206d535398edbc065ab7d872318e665 Mon Sep 17 00:00:00 2001 From: jgart <47760695+jgarte@users.noreply.github.com> Date: Thu, 30 Sep 2021 12:42:24 -0400 Subject: [PATCH 1/5] docs: Fix typo in theming page --- docs/theming.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/theming.md b/docs/theming.md index 8a1d969c..994d9ba6 100644 --- a/docs/theming.md +++ b/docs/theming.md @@ -1,7 +1,7 @@ # Themes *mkdocstrings* can support multiple MkDocs themes. -It currently supports supports the +It currently supports the *[Material for MkDocs](https://squidfunk.github.io/mkdocs-material/)* theme and, partially, the built-in ReadTheDocs theme. From 0831343aa8726ed785b17bba1c8d4adf49b46748 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Mon, 4 Oct 2021 05:52:42 -0400 Subject: [PATCH 2/5] deps: Support `pymdown-extensions` v9.x PR #327: https://github.com/mkdocstrings/mkdocstrings/pull/327 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4f806842..5e3fa81c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dependencies = [ "MarkupSafe>=1.1,<3.0", "mkdocs~=1.2", "mkdocs-autorefs>=0.1,<0.4", - "pymdown-extensions>=6.3,<9.0", + "pymdown-extensions>=6.3,<10.0", "pytkdocs>=0.2.0,<0.13.0", ] From 38b22ec11cded4689115dafc43e16a1e8e40feda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Mon, 4 Oct 2021 12:22:04 +0200 Subject: [PATCH 3/5] refactor: Support new `pymdownx.Highlight` fields --- src/mkdocstrings/handlers/rendering.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/mkdocstrings/handlers/rendering.py b/src/mkdocstrings/handlers/rendering.py index e8383cf2..e7ff9802 100644 --- a/src/mkdocstrings/handlers/rendering.py +++ b/src/mkdocstrings/handlers/rendering.py @@ -33,8 +33,27 @@ class Highlighter(Highlight): The underlying implementation is `pymdownx.highlight` regardless. """ + # https://raw.githubusercontent.com/facelessuser/pymdown-extensions/main/docs/src/markdown/extensions/highlight.md _highlight_config_keys = frozenset( - "use_pygments guess_lang css_class pygments_style noclasses linenums language_prefix".split(), + ( + "css_class", + "guess_lang", + "pygments_style", + "noclasses", + "use_pygments", + "linenums", + "linenums_special", + "linenums_style", + "linenums_class", + "extend_pygments_lang", + "language_prefix", + "code_attr_on_pre", + "auto_title", + "auto_title_map", + "line_spans", + "anchor_linenums", + "line_anchors", + ) ) def __init__(self, md: Markdown): From b7723d882e64f86e38152ed500d28bbc1fc5ce14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Mon, 4 Oct 2021 12:22:19 +0200 Subject: [PATCH 4/5] tests: Parametrize theme test --- tests/test_themes.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/test_themes.py b/tests/test_themes.py index c3396ad9..3d6066d1 100644 --- a/tests/test_themes.py +++ b/tests/test_themes.py @@ -14,10 +14,9 @@ ], indirect=["plugin"], ) -@pytest.mark.skipif(sys.version_info < (3, 7), reason="material is not installed on Python 3.6") -def test_render_themes_templates_python(plugin): - """Test rendering of a given theme's templates.""" - modules = { +@pytest.mark.parametrize( + "module", + [ "mkdocstrings.extension", "mkdocstrings.inventory", "mkdocstrings.loggers", @@ -25,9 +24,12 @@ def test_render_themes_templates_python(plugin): "mkdocstrings.handlers.base", "mkdocstrings.handlers.python", "mkdocstrings.handlers.rendering", - } + ], +) +@pytest.mark.skipif(sys.version_info < (3, 7), reason="material is not installed on Python 3.6") +def test_render_themes_templates_python(module, plugin): + """Test rendering of a given theme's templates.""" handler = plugin.handlers.get_handler("python") handler.renderer._update_env(plugin.md, plugin.handlers._config) # noqa: WPS437 - for identifier in modules: - data = handler.collector.collect(identifier, {}) - handler.renderer.render(data, {}) + data = handler.collector.collect(module, {}) + handler.renderer.render(data, {}) From 8741e7f986ab2f0baa7e67ead651d56828254c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Mon, 4 Oct 2021 12:44:48 +0200 Subject: [PATCH 5/5] chore: Prepare release 0.16.2 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 557f070d..0f1c2b98 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). +## [0.16.2](https://github.com/mkdocstrings/mkdocstrings/releases/tag/0.16.2) - 2021-10-04 + +[Compare with 0.16.1](https://github.com/mkdocstrings/mkdocstrings/compare/0.16.1...0.16.2) + +### Dependencies +- Support `pymdown-extensions` v9.x ([0831343](https://github.com/mkdocstrings/mkdocstrings/commit/0831343aa8726ed785b17bba1c8d4adf49b46748) by Ofek Lev and [38b22ec](https://github.com/mkdocstrings/mkdocstrings/commit/38b22ec11cded4689115dafc43e16a1e8e40feda) by Timothée Mazzucotelli). + + ## [0.16.1](https://github.com/mkdocstrings/mkdocstrings/releases/tag/0.16.1) - 2021-09-23 [Compare with 0.16.0](https://github.com/mkdocstrings/mkdocstrings/compare/0.16.0...0.16.1)