From e8708cbd20db21cfa21408bc32a13cbc5b199091 Mon Sep 17 00:00:00 2001 From: bugfix-mission Date: Thu, 23 Apr 2026 00:38:11 +0800 Subject: [PATCH] fix(zim): correct config_indexing docstring to full-text only The docstring of Creator.config_indexing claimed it toggled both full-text and title indexing, but libzim only toggles the full-text index; the title index is always built. Update the docstring to reflect libzim's actual behaviour and add a regression test. --- CHANGELOG.md | 1 + src/zimscraperlib/zim/creator.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51a2e5e..9d3609c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix outdated system dependencies in README: remove Pillow build-time deps (bundled in wheels), add missing `libcairo` across all platforms (#152) - Improve contribution setup instructions: use `hatch shell`, clarify commands must be run from local clone root (#153) - Bring coverage back to 100% (#293) +- Fix `Creator.config_indexing` docstring to reflect that only the full-text index is toggled; title indexing is always performed by libzim (#294) ### Changed diff --git a/src/zimscraperlib/zim/creator.py b/src/zimscraperlib/zim/creator.py index ca03ba0..8dd6969 100644 --- a/src/zimscraperlib/zim/creator.py +++ b/src/zimscraperlib/zim/creator.py @@ -127,9 +127,12 @@ def __init__( def config_indexing( self, indexing: bool, language: str | None = None # noqa: FBT001 ): - """Toggle full-text and title indexing of entries + """Toggle full-text indexing of entries - Uses Language metadata's value (or "") if not set""" + Uses Language metadata's value (or "") if not set. + + Note: title indexing is always performed by libzim and cannot be + disabled via this method; only the full-text index is toggled.""" language = language or self._get_first_language_metadata_value() or "" if indexing and not is_valid_iso_639_3(language): raise ValueError("Not a valid ISO-639-3 language code")