From bb9c0924c5f62fc388237f8e21fcc4cbcb9cf0c9 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Tue, 8 Sep 2026 13:51:26 -0400 Subject: [PATCH 1/2] List klink in the theme previews The preview links and the bundled theme list in the configuration docs are maintained by hand, so klink was missing from both after it was added. Cover the links with a test parametrized over BUNDLED_THEMES so a newly added theme cannot go undocumented. --- docs/src/configuration.md | 3 ++- yardang/tests/test_themes.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/src/configuration.md b/docs/src/configuration.md index f6c5c4fe..d1b1ed3b 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -282,7 +282,7 @@ yardang preview ``` This renders the documentation into `docs/html/_previews//` for each -bundled theme (`furo`, `sphinxawesome_theme`, `shibuya`, `fuma`). Themes whose +bundled theme (`furo`, `sphinxawesome_theme`, `shibuya`, `fuma`, `klink`). Themes whose package is not installed are skipped. Restrict the set with `--themes`: ```bash @@ -303,6 +303,7 @@ each theme is browsable live at a suburl of the published site: - [`/_previews/sphinxawesome_theme/`](https://yardang.python-templates.dev/_previews/sphinxawesome_theme/) - [`/_previews/shibuya/`](https://yardang.python-templates.dev/_previews/shibuya/) - [`/_previews/fuma/`](https://yardang.python-templates.dev/_previews/fuma/) +- [`/_previews/klink/`](https://yardang.python-templates.dev/_previews/klink/) ## `source-dir` diff --git a/yardang/tests/test_themes.py b/yardang/tests/test_themes.py index 7593a611..9102a47c 100644 --- a/yardang/tests/test_themes.py +++ b/yardang/tests/test_themes.py @@ -32,6 +32,17 @@ def test_other_themes_are_unchanged(self): assert build_module.theme_module("furo") == "furo" +class TestDocumentedThemes: + """The theme lists in the docs are maintained by hand, so they drift.""" + + @pytest.mark.parametrize("theme", BUNDLED_THEMES) + def test_theme_has_a_preview_link(self, theme): + docs = Path(__file__).parents[2] / "docs" / "src" / "configuration.md" + if not docs.is_file(): + pytest.skip("documentation sources are not shipped with the package") + assert f"/_previews/{theme}/" in docs.read_text() + + class TestSearchIntegration: """Search is theme-independent, so it is wired for every first-class theme.""" From d51863d87299bba6c3d066b20640215698e4f88f Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Tue, 8 Sep 2026 15:19:34 -0400 Subject: [PATCH 2/2] Drop the unreachable skip in the preview link test The guard never ran, leaving an uncovered line in the patch. --- yardang/tests/test_themes.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/yardang/tests/test_themes.py b/yardang/tests/test_themes.py index 9102a47c..9347276a 100644 --- a/yardang/tests/test_themes.py +++ b/yardang/tests/test_themes.py @@ -38,8 +38,6 @@ class TestDocumentedThemes: @pytest.mark.parametrize("theme", BUNDLED_THEMES) def test_theme_has_a_preview_link(self, theme): docs = Path(__file__).parents[2] / "docs" / "src" / "configuration.md" - if not docs.is_file(): - pytest.skip("documentation sources are not shipped with the package") assert f"/_previews/{theme}/" in docs.read_text()