Skip to content

Commit e8708cb

Browse files
bugfix-missionbenoit74
authored andcommitted
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.
1 parent ff65d77 commit e8708cb

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
- Fix outdated system dependencies in README: remove Pillow build-time deps (bundled in wheels), add missing `libcairo` across all platforms (#152)
2222
- Improve contribution setup instructions: use `hatch shell`, clarify commands must be run from local clone root (#153)
2323
- Bring coverage back to 100% (#293)
24+
- Fix `Creator.config_indexing` docstring to reflect that only the full-text index is toggled; title indexing is always performed by libzim (#294)
2425

2526
### Changed
2627

src/zimscraperlib/zim/creator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,12 @@ def __init__(
127127
def config_indexing(
128128
self, indexing: bool, language: str | None = None # noqa: FBT001
129129
):
130-
"""Toggle full-text and title indexing of entries
130+
"""Toggle full-text indexing of entries
131131
132-
Uses Language metadata's value (or "") if not set"""
132+
Uses Language metadata's value (or "") if not set.
133+
134+
Note: title indexing is always performed by libzim and cannot be
135+
disabled via this method; only the full-text index is toggled."""
133136
language = language or self._get_first_language_metadata_value() or ""
134137
if indexing and not is_valid_iso_639_3(language):
135138
raise ValueError("Not a valid ISO-639-3 language code")

0 commit comments

Comments
 (0)