Skip to content

Commit 91af334

Browse files
kennethreitzclaude
andcommitted
Remove dead Scofield commentary code and unused data file
The scofield_commentary.json static file was never loaded; the only function referencing it (generate_cross_references) was shadowed by a later same-named definition, so it never ran. Removed the dead function, its sole helper parse_cross_reference, the unused JSON, and the now-moot skip entry in generate_static_site.py. The biblical timeline's Scofield chronology-date column is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8c1f3a6 commit 91af334

3 files changed

Lines changed: 1 addition & 664 deletions

File tree

kjvstudy_org/routes/commentary.py

Lines changed: 0 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,144 +1690,6 @@ def generate_chapter_overview(book, chapter, verses):
16901690
return overview
16911691

16921692

1693-
def parse_cross_reference(ref_string):
1694-
"""Parse a cross-reference string like 'John 1:1-3' or 'Genesis 3:15' into structured data"""
1695-
try:
1696-
# Handle verse ranges like "John 1:1-3" or simple refs like "John 1:1"
1697-
match = re.match(r'(.+?)\s+(\d+):(\d+)(?:-(\d+))?', ref_string.strip())
1698-
if not match:
1699-
return None
1700-
1701-
ref_book = match.group(1).strip()
1702-
ref_chapter = int(match.group(2))
1703-
ref_verse_start = int(match.group(3))
1704-
ref_verse_end = int(match.group(4)) if match.group(4) else ref_verse_start
1705-
1706-
# Create the display text and URL
1707-
if ref_verse_end > ref_verse_start:
1708-
text = f"{ref_book} {ref_chapter}:{ref_verse_start}-{ref_verse_end}"
1709-
else:
1710-
text = f"{ref_book} {ref_chapter}:{ref_verse_start}"
1711-
1712-
url = f"/book/{ref_book}/chapter/{ref_chapter}#verse-{ref_verse_start}"
1713-
1714-
return {
1715-
"text": text,
1716-
"url": url,
1717-
"context": None # Will be populated from theme or left empty
1718-
}
1719-
except Exception as e:
1720-
print(f"Error parsing cross-reference '{ref_string}': {e}")
1721-
return None
1722-
1723-
1724-
def generate_cross_references(book, chapter, verse, verse_text):
1725-
"""Generate cross-references for a verse using Scofield commentary when available"""
1726-
1727-
# First, try to get cross-references from Scofield commentary
1728-
if book in scofield_commentary:
1729-
if str(chapter) in scofield_commentary[book]:
1730-
if str(verse) in scofield_commentary[book][str(chapter)]:
1731-
verse_data = scofield_commentary[book][str(chapter)][str(verse)]
1732-
if "cross_references" in verse_data and verse_data["cross_references"]:
1733-
# Parse the Scofield cross-references
1734-
references = []
1735-
for ref_string in verse_data["cross_references"][:4]: # Limit to 4 references
1736-
parsed_ref = parse_cross_reference(ref_string)
1737-
if parsed_ref:
1738-
references.append(parsed_ref)
1739-
1740-
if references:
1741-
return references
1742-
1743-
# Fall back to thematic cross-references if no Scofield data
1744-
# Dictionary of sample cross-references by theme with actual verse texts
1745-
theme_references = {
1746-
"salvation": [
1747-
{"book": "John", "chapter": 3, "verse": 16, "context": "God's love and salvation", "verse_text": "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life."},
1748-
{"book": "Romans", "chapter": 10, "verse": 9, "context": "Confession and belief for salvation", "verse_text": "That if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised him from the dead, thou shalt be saved."},
1749-
{"book": "Ephesians", "chapter": 2, "verse": 8, "context": "Salvation by grace through faith", "verse_text": "For by grace are ye saved through faith; and that not of yourselves: it is the gift of God:"}
1750-
],
1751-
"faith": [
1752-
{"book": "Hebrews", "chapter": 11, "verse": 1, "context": "Definition of faith", "verse_text": "Now faith is the substance of things hoped for, the evidence of things not seen."},
1753-
{"book": "James", "chapter": 2, "verse": 17, "context": "Faith and works", "verse_text": "Even so faith, if it hath not works, is dead, being alone."},
1754-
{"book": "Romans", "chapter": 1, "verse": 17, "context": "The righteous shall live by faith", "verse_text": "For therein is the righteousness of God revealed from faith to faith: as it is written, The just shall live by faith."}
1755-
],
1756-
"love": [
1757-
{"book": "1 Corinthians", "chapter": 13, "verse": 4, "context": "Characteristics of love", "verse_text": "Charity suffereth long, and is kind; charity envieth not; charity vaunteth not itself, is not puffed up,"},
1758-
{"book": "1 John", "chapter": 4, "verse": 8, "context": "God is love", "verse_text": "He that loveth not knoweth not God; for God is love."},
1759-
{"book": "John", "chapter": 15, "verse": 13, "context": "Greatest form of love", "verse_text": "Greater love hath no man than this, that a man lay down his life for his friends."}
1760-
],
1761-
"judgment": [
1762-
{"book": "Matthew", "chapter": 25, "verse": 31, "context": "Final judgment", "verse_text": "When the Son of man shall come in his glory, and all the holy angels with him, then shall he sit upon the throne of his glory:"},
1763-
{"book": "Romans", "chapter": 2, "verse": 1, "context": "Judging others", "verse_text": "Therefore thou art inexcusable, O man, whosoever thou art that judgest: for wherein thou judgest another, thou condemnest thyself; for thou that judgest doest the same things."},
1764-
{"book": "Revelation", "chapter": 20, "verse": 12, "context": "Judgment according to deeds", "verse_text": "And I saw the dead, small and great, stand before God; and the books were opened: and another book was opened, which is the book of life: and the dead were judged out of those things which were written in the books, according to their works."}
1765-
],
1766-
"creation": [
1767-
{"book": "Genesis", "chapter": 1, "verse": 1, "context": "Creation of heavens and earth", "verse_text": "In the beginning God created the heaven and the earth."},
1768-
{"book": "Psalm", "chapter": 19, "verse": 1, "context": "Heavens declare God's glory", "verse_text": "The heavens declare the glory of God; and the firmament sheweth his handywork."},
1769-
{"book": "Colossians", "chapter": 1, "verse": 16, "context": "All things created through Christ", "verse_text": "For by him were all things created, that are in heaven, and that are in earth, visible and invisible, whether they be thrones, or dominions, or principalities, or powers: all things were created by him, and for him:"}
1770-
],
1771-
"prayer": [
1772-
{"book": "Matthew", "chapter": 6, "verse": 9, "context": "The Lord's Prayer", "verse_text": "After this manner therefore pray ye: Our Father which art in heaven, Hallowed be thy name."},
1773-
{"book": "1 Thessalonians", "chapter": 5, "verse": 17, "context": "Pray without ceasing", "verse_text": "Pray without ceasing."},
1774-
{"book": "James", "chapter": 5, "verse": 16, "context": "Prayer of the righteous", "verse_text": "Confess your faults one to another, and pray one for another, that ye may be healed. The effectual fervent prayer of a righteous man availeth much."}
1775-
],
1776-
"wisdom": [
1777-
{"book": "Proverbs", "chapter": 9, "verse": 10, "context": "Beginning of wisdom", "verse_text": "The fear of the Lord is the beginning of wisdom: and the knowledge of the holy is understanding."},
1778-
{"book": "James", "chapter": 1, "verse": 5, "context": "Ask God for wisdom", "verse_text": "If any of you lack wisdom, let him ask of God, that giveth to all men liberally, and upbraideth not; and it shall be given him."},
1779-
{"book": "1 Corinthians", "chapter": 1, "verse": 25, "context": "God's wisdom vs man's", "verse_text": "Because the foolishness of God is wiser than men; and the weakness of God is stronger than men."}
1780-
],
1781-
"hope": [
1782-
{"book": "Romans", "chapter": 15, "verse": 13, "context": "God of hope", "verse_text": "Now the God of hope fill you with all joy and peace in believing, that ye may abound in hope, through the power of the Holy Ghost."},
1783-
{"book": "Hebrews", "chapter": 6, "verse": 19, "context": "Hope as anchor", "verse_text": "Which hope we have as an anchor of the soul, both sure and stedfast, and which entereth into that within the veil;"},
1784-
{"book": "1 Peter", "chapter": 1, "verse": 3, "context": "Living hope", "verse_text": "Blessed be the God and Father of our Lord Jesus Christ, which according to his abundant mercy hath begotten us again unto a lively hope by the resurrection of Jesus Christ from the dead,"}
1785-
],
1786-
"peace": [
1787-
{"book": "John", "chapter": 14, "verse": 27, "context": "Christ's peace", "verse_text": "Peace I leave with you, my peace I give unto you: not as the world giveth, give I unto you. Let not your heart be troubled, neither let it be afraid."},
1788-
{"book": "Philippians", "chapter": 4, "verse": 7, "context": "Peace that passes understanding", "verse_text": "And the peace of God, which passeth all understanding, shall keep your hearts and minds through Christ Jesus."},
1789-
{"book": "Isaiah", "chapter": 26, "verse": 3, "context": "Perfect peace", "verse_text": "Thou wilt keep him in perfect peace, whose mind is stayed on thee: because he trusteth in thee."}
1790-
]
1791-
}
1792-
1793-
# Identify themes in the verse text
1794-
verse_themes = []
1795-
for theme in theme_references.keys():
1796-
if theme in verse_text or random.random() < 0.2: # Randomly include some themes
1797-
verse_themes.append(theme)
1798-
1799-
# If no themes match, pick a random theme
1800-
if not verse_themes:
1801-
verse_themes = [random.choice(list(theme_references.keys()))]
1802-
1803-
# Get references for identified themes
1804-
references = []
1805-
for theme in verse_themes[:2]: # Limit to two themes
1806-
theme_refs = theme_references[theme]
1807-
for ref in random.sample(theme_refs, min(2, len(theme_refs))):
1808-
# Skip self-references
1809-
if ref["book"] == book and ref["chapter"] == chapter and ref["verse"] == verse:
1810-
continue
1811-
1812-
references.append({
1813-
"text": f"{ref['book']} {ref['chapter']}:{ref['verse']}",
1814-
"url": f"/book/{ref['book']}/chapter/{ref['chapter']}#verse-{ref['verse']}",
1815-
"context": ref["context"],
1816-
"verse_text": ref["verse_text"]
1817-
})
1818-
1819-
# Ensure we have at least one reference
1820-
if not references:
1821-
references.append({
1822-
"text": "John 1:1",
1823-
"url": "/book/John/chapter/1#verse-1",
1824-
"context": "Related teaching",
1825-
"verse_text": "In the beginning was the Word, and the Word was with God, and the Word was God."
1826-
})
1827-
1828-
return references
1829-
1830-
18311693
def get_theme(text):
18321694
"""Extract a thematic element from text"""
18331695
themes = [

0 commit comments

Comments
 (0)