mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-10-24 14:29:14 +00:00
Remove duplicated logic across the backend, keeping all imports at module top: - get_books(): 5 identical route-local copies -> one helper in utils/helpers.py - create_slug(): data/__init__._create_slug was byte-identical to helpers.create_slug; route data + api.py now share the one helper - normalize_strongs(): 4 copies of Strong's leading-zero normalization unified into strongs.py; fixes a latent bug where /search?q=H0001 (web) emitted an un-normalized /strongs/H0001 redirect instead of /strongs/H1 - highlight_terms(): the two search highlighters (search.py, search_index.py) now share one implementation; fixes lowercase <mark> output on the FTS path - parse_reference_parts(): one canonical "Book Chapter:Verse[-end]" parser in kjv.py (next to VerseReference), replacing ad-hoc parsing in cross_references and topics; cross_references.parse_reference is now a thin wrapper - get_adjacent_stories(): prev/next story nav extracted from two route handlers - build_interlinear_rows(): interlinear row builder extracted in bible.py Adds TestNormalizeStrongs unit tests. 941 passed, 3 skipped; data validation clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
25 KiB
1200x630px
25 KiB
1200x630px