feature: support mkdocs-callouts plugin by enabling pymdownx.quotes extension with callouts support (#938)

Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
This commit is contained in:
Timothée Mazzucotelli
2026-09-13 14:55:48 +00:00
committed by GitHub
parent 9f36bb54ef
commit d8fbb0559c
4 changed files with 122 additions and 0 deletions
+28
View File
@@ -280,6 +280,7 @@ class TestPluginShimming:
) -> None:
plugins: dict[str, dict[str, Any]] = {
"autorefs": {},
"callouts": {},
"glightbox": {"auto": False},
"macros": {"render_by_default": False},
"mike": {"version_selector": False},
@@ -290,6 +291,7 @@ class TestPluginShimming:
baseline = self._parse_yaml(tmp_path, plugins=plugins)
for name, options in {
"autorefs": {"link_titles": "external"},
"callouts": {"aliases": False, "breakless_lists": False},
"glightbox": {"slide_effect": "fade"},
"macros": {"force_render_paths": "guides/**"},
"mike": {"javascript_dir": "scripts"},
@@ -587,6 +589,32 @@ class TestPluginShimming:
"width": "80%"
}
def test_callouts_enables_quotes_callouts(self, tmp_path: Path) -> None:
config = self._parse_yaml(
tmp_path,
markdown_extensions=[{"pymdownx.quotes": {"callouts": False}}],
plugins={
"callouts": {
"aliases": False,
"breakless_lists": False,
"title_from_first_bold": True,
}
},
)
assert config["markdown_extensions"].count("pymdownx.quotes") == 1
assert config["mdx_configs"]["pymdownx.quotes"] == {"callouts": True}
assert config["plugins"]["callouts"]["config"] == {}
def test_disabled_callouts_does_not_enable_quotes(
self, tmp_path: Path
) -> None:
config = self._parse_yaml(
tmp_path, plugins={"callouts": {"enabled": False}}
)
assert "pymdownx.quotes" not in config["markdown_extensions"]
def test_macros_plugin_shimmed(self, tmp_path: Path) -> None:
config = self._parse_yaml(tmp_path, plugins={"macros": {}})
assert MacrosExtension.name in config["markdown_extensions"]
+7
View File
@@ -40,6 +40,7 @@ PYTHON_PLUGINS = (
"offline",
"mike",
"autorefs",
"callouts",
"markdown-exec",
"mkdocstrings",
"glightbox",
@@ -49,6 +50,7 @@ PYTHON_PLUGINS = (
SHIM_PLUGINS = (
"autorefs",
"callouts",
"markdown-exec",
"mkdocstrings",
"glightbox",
@@ -221,6 +223,9 @@ def test_ignores_unsupported_plugin_names(name: str) -> None:
("autorefs", "resolve_closest"),
("autorefs", "link_titles"),
("autorefs", "strip_title_tags"),
("callouts", "aliases"),
("callouts", "breakless_lists"),
("callouts", "title_from_first_bold"),
("glightbox", "touchNavigation"),
("glightbox", "loop"),
("glightbox", "effect"),
@@ -332,6 +337,7 @@ def test_normalizes_null_shim_configuration(name: str) -> None:
("name", "config"),
[
pytest.param("autorefs", {"enabled": False}, id="autorefs"),
pytest.param("callouts", {"enabled": False}, id="callouts"),
pytest.param(
"markdown-exec",
{"enabled": False, "ansi": "off", "languages": ["python"]},
@@ -472,6 +478,7 @@ def test_silently_discards_unsupported_autorefs_options(
"version_selector must be a boolean",
),
("autorefs", {"enabled": "yes"}, "enabled must be a boolean"),
("callouts", {"enabled": "yes"}, "enabled must be a boolean"),
("markdown-exec", {"ansi": "sometimes"}, "ansi must be"),
(
"markdown-exec",