PDF Script:
- Added --limit N parameter to process only first N books (for testing)
- Added --output FILE parameter for custom output filename
- Updated help text and examples
- Example: --limit 1 --output genesis.pdf to test with just Genesis
Name Linking:
- Fixed compound names like "Sarai or Sarah" not linking properly
- Now splits names on " or " and creates separate mappings for each variant
- Both "Sarai" and "Sarah" in Bible text will link to same person entry
- Preserves full compound name as well for exact matches
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The random verse endpoint was being cached by browsers, causing it to
always redirect to the same verse instead of selecting a new random
verse each time.
Changes:
- Added /random-verse to the no-cache path list in CacheControlMiddleware
- Set explicit cache control headers on the redirect response
- Changed status code to 302 (Found) for temporary redirect
- Added Pragma and Expires headers for better cache prevention
Tested with 5 consecutive requests, all returned unique verses.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Use negative lookahead to prevent matching words followed by 's
- Fixes issue where "LORD'S" was being split into "LORD" + "'S"
- Sidenotes now appear after complete words only
Removed the /bible/pdf endpoint (too resource-intensive for live requests)
and created a standalone script for offline PDF generation.
New script: scripts/generate_bible_pdf.py
- Generates complete KJV Bible PDF with all footnotes
- ~1000 pages with cross-references and word studies
- Progress tracking during generation
- Saves to kjv-complete-bible.pdf
Usage:
uv run python scripts/generate_bible_pdf.py
This is more efficient - generate once, serve as static file if needed,
rather than regenerating on every request.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Corrected import to use OT_BOOKS and NT_BOOKS from utils.books
instead of non-existent bible_metadata module.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
New endpoint /bible/pdf generates a comprehensive PDF of the entire
King James Bible with all cross-references and word studies.
Features:
- Title page with edition information
- Table of contents (Old Testament & New Testament)
- All 66 books with proper page breaks
- All 31,102 verses with footnotes
- Cross-references grouped by description
- Word studies with Greek/Hebrew terms
- Running headers with book names
- Page numbers
- Professional typography
PDF structure:
- Title page
- Table of contents (2 columns)
- Genesis through Malachi (Old Testament)
- Matthew through Revelation (New Testament)
- Footer page
This will generate a substantial PDF (likely 1000+ pages) with
complete study content suitable for printing or offline study.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Cross-references and word studies now appear as proper footnotes
in PDF exports using WeasyPrint's CSS footnote support.
Features:
- Cross-references grouped by description (e.g., "References God")
- Word studies with Greek/Hebrew terms and meanings
- Automatic footnote numbering
- Footnote markers (* and †) in verse text
- Clean footnote formatting at bottom of pages
PDF now includes all the study content from the web view in a
print-friendly format.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Track which words have already been shown in a chapter and exclude
them from subsequent verses. This prevents the same word study
from appearing multiple times throughout a single chapter.
Changes:
- Add shown_words set to track displayed word studies per chapter
- Pass shown_words to generate_word_study_sidenotes()
- Filter out already-shown words from potential sidenotes
- Update function signature with shown_words parameter
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated the red letter functionality to wrap only the specific words
Jesus spoke within each verse, rather than entire verses. This provides
more accurate red letter highlighting similar to traditional red letter Bibles.
Changes:
- Modified red_letter.py to search for and wrap only Christ's words
- Updated JSON structure to store actual quoted text
- Changed filter to handle both full verses and partial quotes
- Improved accuracy of red letter highlighting
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Expanded Revelation commentary from 45 to 335 verses (83% coverage),
providing detailed apocalyptic interpretation, Greek word studies, and
encouragement for persecuted believers. Also added red letter edition
support to highlight words of Christ throughout the Bible.
Revelation commentary additions:
- 290 new verses with comprehensive analysis
- All 22 chapters now have rich commentary coverage
- Apocalyptic imagery and symbolism explained
- First-century persecution context provided
- Multiple interpretive approaches acknowledged
- Christ-centered application for modern believers
Red letter edition features:
- Words of Christ highlighted in red in verse and chapter displays
- Complete database of Jesus' spoken words across all four Gospels
- Dark mode compatible color scheme
- Enhances readability and focus on Christ's teachings
Total verse commentary database now contains 14,827 verses across
all 66 books of the Bible with theological depth, practical application,
and reflection questions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Converted orphaned commentary pages to 301 redirects:
- /book/{book}/commentary → /book/{book}
- /commentary/{book}/{chapter} → /book/{book}/chapter/{chapter}
Removed commentary URLs from sitemap since content is now integrated into regular verse pages. Commentary data and functions preserved as they're actively used on verse pages.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changed from "[BOT] googlebot - GET /path" to just "[BOT] googlebot"
for cleaner, more concise logs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Only logs requests from known bots/crawlers (Googlebot, PerplexityBot,
AmazonBot, etc.) while staying silent for regular user traffic. Helps
track SEO crawler activity without cluttering logs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
User-Agent logging served its diagnostic purpose. Removing to
reduce log noise and improve performance.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds middleware to log the User-Agent header for each incoming request
to help understand what clients are accessing the site (browsers, bots,
search engines, etc.).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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>
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>
- 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.
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>
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>
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>
- 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>
- Create books.py loader module with caching for book data
- Add JSON files for each book with introduction, themes, key verses,
outline, historical context, literary style, Christ in book, and
practical application sections
- Update API routes to include book metadata and introduction data
- Update book.html template to display rich book content
- Template falls back to commentary data when book_intro unavailable
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Patriarchs: Abraham 2068 BC, Isaac 2067 BC, Jacob 2007 BC, Joseph 1877 BC
Exodus: Bondage 1887-1447 BC, Exodus 1447 BC, Sinai 1447 BC
Conquest: Canaan 1407 BC, Judges 1367-1047 BC
Kingdom: Saul 1047 BC, David 1010 BC, Temple 967 BC, Division 931 BC
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Converts (1), (2), etc. patterns into proper HTML <ol> lists.
Text after the list is wrapped in a new <p> tag.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
New theological resources:
- The Trinity, Christology, Pneumatology, Soteriology
- Ecclesiology, Eschatology, Kingdom of God
- Types and Shadows, Messianic Prophecies
- The Blood in Scripture, Names and Titles of Christ
Updates:
- Add new resources to homepage Theological Studies grid
- Add Systematic Theology category to /resources page
- Simplify sidebar with single "All Resources" link
- Export new data variables from data/__init__.py
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created resource_index.html as a unified template for all resource pages
- Updated routes to use the generic template with configurable data
- Added link_verses and link_names filters to descriptions for automatic linking
- Added 6 new resources to /resources page (Miracles, I Am Statements,
Beatitudes, Ten Commandments, Armor of God, Prayers)
- Deleted 6 redundant individual templates (miracles.html, prayers.html,
beatitudes.html, ten_commandments.html, armor_of_god.html, i_am_statements.html)
This reduces code duplication and ensures consistent verse linking across
all resource pages.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Change `example=` to `examples=[]` in FastAPI Path/Query params
- Replace `on_event("startup")` with lifespan context manager
- Update TemplateResponse to use new signature (request, name, context)
All 100 tests pass with no warnings.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Re-add the filter function that was accidentally removed during
refactoring. This filter injects sidenote markers into verse text
for word study annotations.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create new utility module (~340 lines) containing:
- sitemap.xml generation with daily caching
- robots.txt for search engine crawlers
- health check endpoint
- Update routes/__init__.py with new exports
- Reduce server.py from 2,394 to 2,045 lines
All 100 tests passing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create new commentary module (4,130 lines) containing:
- Commentary route handler
- All commentary generation functions
- Book introduction and historical context generators
- Literary features, themes, and theological significance
- Word study sidenotes and verse analysis
- Update routes/__init__.py with new exports
- Reduce server.py from 7,100+ to 2,394 lines (-66% reduction)
All 100 tests passing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create routes/study_guides.py (943 lines) with:
- Study guides index page
- Individual study guide detail pages
- All theological content for 15 study guides
- Reduce server.py from 7,969 to 7,081 lines (~888 lines removed)
- All 100 tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove 650+ lines of duplicate functions now imported from utils:
- create_slug, normalize_book_name, get_related_content
- get_chapter_popularity_score, get_chapter_popularity_explanation
- is_verse_reference, parse_verse_reference, perform_full_text_search
- calculate_relevance_score, highlight_search_terms, get_verse_text
- Rename local parse_verse_reference to verse_reference_to_url
(different function - converts references to URL paths for templates)
- server.py reduced by ~650 lines, all 100 tests still pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create kjvstudy_org/utils/ package:
- books.py: Book name normalization, abbreviations, testament categorization
- helpers.py: Utility functions (create_slug, get_verse_text, etc.)
- search.py: Full-text search with FTS5 support
- search_index.py: SQLite FTS5 search index implementation
- Create kjvstudy_org/routes/ package:
- api.py: All /api/* endpoints as FastAPI router
- Update server.py:
- Import from new modular packages
- Include API router via app.include_router()
- Remove duplicate API routes
- Fix test_edge_cases.py to accept 404 for reversed verse ranges
All 100 tests pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Categorize all 66 books by type with subtle color-coding:
- Law (blue): Genesis-Deuteronomy
- Historical (green): Joshua-Esther
- Wisdom (purple): Job-Song of Solomon
- Major Prophets (orange): Isaiah-Daniel
- Minor Prophets (red): Hosea-Malachi
- Gospels (gold): Matthew-John
- Acts (teal): Acts
- Pauline Epistles (indigo): Romans-Philemon
- General Epistles (pink): Hebrews-Jude
- Apocalyptic (crimson): Revelation
Colors use subtle gradients and work well in both light/dark modes.
Legend at bottom shows all categories.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added /api/health endpoint for monitoring and status verification.
Returns service status, name, and version information.
Now visible in Swagger docs at /api/docs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
New endpoints:
- /api/books/{book}/text - Get all text content of a book
- /api/bible - Get the entire Bible text (all 66 books, 31,102 verses)
Both endpoints return structured JSON with verses organized by chapters.
Updated API index to include all available endpoints.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>