Replace all 26 calls to list(bible.iter_books()) with bible.get_books()
which uses @lru_cache to avoid iterating through 31,102 verses on
every page request.
Expected improvement: 50-70% faster page loads
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Make _resource_index_pdf_response async
- Add await to all 35 calls to this helper function
- Fixes second SyntaxError in resources.py PDF generation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Make _resource_detail_pdf_response async and add await to all calls.
This fixes the SyntaxError where await was used in a non-async function.
The helper function is called by 38 PDF endpoints and needs to be async
to properly await render_html_to_pdf_async().
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Convert all PDF generation endpoints from synchronous to async to
prevent blocking FastAPI's event loop during CPU-intensive operations.
Changes:
- Add render_html_to_pdf_async() using ThreadPoolExecutor (2 workers)
- Convert all PDF endpoints to async def
- Use await render_html_to_pdf_async() instead of blocking calls
- Keep render_html_to_pdf() for backward compatibility
Performance impact:
- Prevents event loop blocking during PDF generation
- Allows other requests to be processed while PDFs are rendering
- Limits concurrent PDF generation to 2 workers to control CPU usage
Files updated:
- kjvstudy_org/utils/pdf.py (new async implementation)
- kjvstudy_org/server.py (5 PDF endpoints)
- kjvstudy_org/routes/api.py (4 PDF endpoints)
- kjvstudy_org/routes/resources.py (7 PDF endpoints)
- kjvstudy_org/routes/stories.py (2 PDF endpoints)
- kjvstudy_org/routes/study_guides.py (1 PDF endpoint)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add SQLite FTS5 search index initialization to dramatically improve
search performance from ~2.8s to <100ms.
Changes:
- Build search index at Docker image build time
- Initialize search index on app startup as fallback
- Index enables fast full-text search across all 31,102 verses
Performance impact:
- Before: ~2.8s (O(n) iteration through all verses)
- After: <100ms (FTS5 indexed search)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Update _BOOK_FILENAME_MAP to use "Solomon's Song" as the key and
point to the renamed file "solomons_song.json".
This fixes the book data loading issue where get_book_data() couldn't
find the book introduction, themes, and other metadata, causing the
page to fall back to generic auto-generated content.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace all "Song of Solomon" references with "Solomon's Song" in
commentary route dictionaries to match the updated book naming.
This fixes the "Major Themes" display issue where dictionary lookups
were failing because the book is now named "Solomon's Song" throughout
the codebase but commentary.py still used "Song of Solomon" as keys.
Changes:
- Updated 9 dictionary entries across multiple functions
- Functions affected: genre, time_period, historical_context, tags,
word studies, and OT book list
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Rename book data file and update all references to use "Solomon's Song"
(matching verses-1769.json) instead of "Song of Solomon".
Changes:
- Rename song_of_solomon.json → solomons_song.json
- Update "name" field: "Song of Solomon" → "Solomon's Song"
- Update all verse references to use "Solomon's Song X:Y" format
This ensures the book data name matches the verses file exactly,
eliminating the need for normalization redirects.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Correct the book name normalization to map FROM "Song of Solomon"
TO "Solomon's Song" (the name used in verses-1769.json).
Changes:
- Reverse all Song mappings to point to "Solomon's Song"
- Update OT_BOOKS to use "Solomon's Song" (matching verses file)
- Map "Song of Solomon", "Song of Songs", and "Canticles" → "Solomon's Song"
This fixes the 404 error on /book/Song%20of%20Solomon by ensuring
that alternative names redirect to the canonical verses file name.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add "Solomon's Song" to BOOK_ABBREVIATIONS mapping to fix URL
routing. The KJV verses file (verses-1769.json) uses "Solomon's Song"
as the book name, but the book data uses "Song of Solomon". This
mapping ensures normalize_book_name() correctly handles the variant.
Fixes URL: https://kjvstudy.org/book/Solomon's%20Song🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated all sections of the Song of Solomon book data:
- Introduction: Revised to emphasize the Song's unique place in Scripture,
Hebrew superlative title, dialogue structure, and dual literal/typological
interpretation following Reformed approach
- Key Themes: Replaced 8 themes with 7 focused themes including goodness of
marital desire, exclusive devotion, love strong as death, beauty of the
beloved, seeking and finding, the garden enclosed, and Christ/church typology
- Key Verses: Simplified to 7 core verses with reference and text only
- Outline: Updated to 6 sections tracking the Song's movement from longing
through consummation to the seal of love
- Historical Context: Expanded on Solomonic era and wisdom literature context
- Literary Style: Enhanced treatment of lyric poetry, wasf genre, imagery,
and Hebrew linguistic complexity
- Theological Significance: Four-paragraph treatment of creation goodness,
marital love, bride metaphor, and love's cosmic significance
- Christ in Book: Six-paragraph typological reading showing bridegroom seeking
bride, delighting in beauty, mutual possession, garden restoration, and
love conquering death
- Relationship to NT: Four-paragraph treatment of Ephesians 5, Revelation's
marriage imagery, Jesus as bridegroom, and NT sexual ethics
- Practical Application: Five-paragraph treatment for married couples, singles,
spiritual dryness, non-transactional love, and meditation on Christ's love
All content maintains theological depth while being more accessible and
clearly structured for the website.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
All four books now have comprehensive 2,000+ character introductions:
- Titus (890 → 2,800+ chars): Expanded to cover Cretan culture, Pastoral
Epistles context, dual emphasis on doctrine and good works, gospel
counterculture theme, and detailed letter structure
- 2 Timothy (898 → 3,400+ chars): Expanded to emphasize final testament
nature, contrast between imprisonments, passing the torch theme, guarding
the gospel deposit, Scripture's inspiration, and finishing well
- Zechariah (1,029 → 3,800+ chars): Expanded to cover post-exilic context,
eight night visions, messianic prophecies (humble king, pierced one),
two-part structure (chs 1-8 vs 9-14), and extensive NT quotations
- Philemon (1,090 → 3,600+ chars): Expanded to cover slavery in Roman
context, gospel doctrines (substitution, imputation, reconciliation),
Paul's pastoral diplomacy, gospel undermining slavery from within
All introductions now match the depth and comprehensiveness of other
major books (Genesis, Romans, John, Song of Solomon, etc.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed two issues:
- Replaced unescaped straight double quotes with single quotes in "I wills"
- Fixed typo: "cunningbut" → "cunning but"
JSON now validates correctly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Significantly expand 10 key theological sections with comprehensive,
multi-paragraph descriptions:
Major expansions:
- Demons Are Real: 4 paragraphs on reality of spiritual beings
- Origin of Demons: 4 paragraphs on fallen angels
- Demonic Hierarchy: 4 paragraphs on organized evil
- Names of Satan: 4 paragraphs on devil's titles and meanings
- Satan's Fall: 4 paragraphs on pride and rebellion
- Satan's Limitations: 4 paragraphs on defeated foe under God's sovereignty
- Binding the Strong Man: 4 paragraphs on plundering Satan's kingdom
- The Armor of God: 4 paragraphs on spiritual warfare equipment
- Demonic Deception: 4 paragraphs on wolves in sheep's clothing
- The Lake of Fire: 4 paragraphs on everlasting punishment
Each section now includes:
- Deeper theological exposition
- More biblical cross-references and connections
- Practical applications for believers
- Original language insights where relevant
- Historical and eschatological context
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace "Reformed understanding" with direct teaching statement:
- "This anticipates the Reformed understanding that even repentance is God's gift"
- → "This teaches that even repentance is God's gift"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace 5 additional instances that used "Reformed tradition," "Reformed faith,"
and "Reformed worship":
- Bibliology introduction: "The Reformed tradition holds" → "Scripture is"
- Divine Existence: "The Reformed faith confesses" → direct statement
- Middle Knowledge Rejected: "The Reformed tradition rejects" → passive voice
- Regulative Principle: "The Reformed tradition holds" → direct statement
- Word and Sacrament: "Reformed worship" → "biblical worship"
Note: "reformed governments" on line 1563 uses "reformed" as a verb
(meaning "changed"), not as theological terminology, so it remains unchanged.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace all 12 instances of "Reformed theology" with alternative phrasing that
preserves the theological substance while removing the explicit label:
- Introduction sections: Use "Scripture teaches/emphasizes"
- Verbal Plenary Inspiration: "Historic Christian orthodoxy confesses"
- Scripture and Tradition: Remove attribution, state doctrine directly
- Compatibilism: "Scripture affirms"
- Cessation Question: State position directly
- No Sinless Perfection: "Scripture uniformly rejects"
- Simul Justus et Peccator: "This biblical truth"
Also includes previously staged template changes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Introduced new routes for systematic theology topics including Bibliology, Theology Proper, Anthropology, Hamartiology, Providence, Grace, Justification, Sanctification, Law and Gospel, and Worship.
- Each topic includes HTML and PDF endpoints for resource index and detail pages.
- Updated the resources page to include descriptions and counts for the new theology topics.
Add extensive theological analysis, key themes, verses with significance,
and practical applications for in-depth Bible study.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Include all book page sections (introduction, outline, themes,
key verses, historical context, literary style, theological
significance, Christ in book, NT relationship, and practical
application) at the beginning of book PDF exports before the
chapter text.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add markdown rendering to verse text and significance fields
to properly display bold and italic formatting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Create new 'mdi' filter for inline markdown (bold/italic only)
without paragraph wrapping. Apply to Key Themes descriptions
to properly render markdown formatting within list items.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Update markdown filter to convert *italic* to <em>italic</em>
in addition to existing **bold** support. Processes bold first
to avoid conflicts with italic markers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Apply markdown filter to Introduction and Historical Context sections
to properly render bold text and other markdown formatting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Apply markdown filter to Literary Style section to properly render
bold text and other markdown formatting. Makes it consistent with
other sections like Theological Significance.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Scope the 1.8rem font-size rule to only the .chapters-section
so parenthetical chapter references in other sections don't
get enlarged.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Previously single-paragraph content was returned unwrapped,
causing missing paragraph styling on sections like "Christ in Acts".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Handle patterns like "Hebrews 5-7" (chapter range) and "Hebrews 11"
(single chapter) that don't include verse numbers (no colon).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Single verses now use /book/{book}/chapter/{ch}/verse/{v} format
which matches the tooltip parser pattern in base.html.
Verse ranges continue to use #verse-{start}-{end} anchor format.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Track both currentBook and currentChapter context so abbreviated
ranges like "45-49" in "(1 Corinthians 15:21-22, 45-49)" correctly
inherit the book (1 Corinthians) and chapter (15) from the preceding
reference.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add cross-book reference support (e.g., Romans 5:12-21)
- Handle comma-separated verse ranges with inherited chapter context
(e.g., 27:27-29, 39-40 where 39-40 inherits chapter 27)
- Support semicolon-separated references (e.g., 48:15-16; 49:1-27)
- Fix verse range linking to use #verse-start-end anchor format
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Genesis, Exodus, Leviticus, Numbers, Deuteronomy fully expanded
- Each book now includes: multi-paragraph introductions, key themes with
descriptions, key verses with significance, detailed outlines, historical
context, literary style, theological significance, Christ in book,
relationship to NT, and practical application
- Update book.html template to handle new data structure
- Add markdown filter for bold text conversion
- Template now supports both old and new data formats
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>