{% extends "base.html" %} {% block title %}{{ book }} {{ chapter }} - KJV Bible{% endblock %} {% block description %}Read {{ book }} chapter {{ chapter }} from the King James Version Bible. {{ verses[0].text[:100] if verses and verses|length > 0 else '' }}...{% endblock %} {% block head %} {% endblock %} {% block content %}

{{ book }} {{ chapter }}

Authorized King James Version

Interlinear {% if pdf_available %} PDF {% endif %}
{% for verse in verses %} {% set commentary = commentaries[verse.verse] if commentaries and verse.verse in commentaries else none %} {% set has_commentary = commentary and (commentary.get('is_enhanced') or commentary.get('analysis')) %} {% set has_stanza_break = is_poetry and verse.verse in stanza_breaks %} {% set has_section_heading = section_headings and verse.verse in section_headings %} {% if has_stanza_break and has_section_heading %}

{{ section_headings[verse.verse] }}

{% elif has_section_heading %}

{{ section_headings[verse.verse] }}

{% elif has_stanza_break %} {# stanza break without heading - handled on verse p tag #} {% endif %}

{{ verse.verse }} {{ verse.text | red_letter(book, chapter, verse.verse) | inject_word_markers(commentary.word_studies if commentary else [], verse.verse, commentary.word_study_auto_expand if commentary else false) | safe }} {% if commentary %} {% if commentary.cross_reference_groups %} {# Flatten refs with their group info for counting #} {% set ns = namespace(all_refs=[], ref_count=0) %} {% for group in commentary.cross_reference_groups %} {% for ref in group.refs %} {% set ns.all_refs = ns.all_refs + [{'ref': ref, 'group': group.description, 'group_idx': loop.index0, 'is_first_in_group': loop.first}] %} {% set ns.ref_count = ns.ref_count + 1 %} {% endfor %} {% endfor %} {% set total_refs = ns.ref_count %} {# Show all if 6 or fewer (avoid "+1"), otherwise show 5 with expand #} {% set preview_count = total_refs if total_refs <= 6 else 5 %} {% set extra_count = total_refs - preview_count %} {% for item in ns.all_refs[:preview_count] %}{% if item.is_first_in_group %}{% if not loop.first %}. {% endif %}{{ item.group }}: {% endif %}{{ item.ref.display }}{% if not loop.last and not ns.all_refs[loop.index].is_first_in_group %}, {% endif %}{% endfor %}{% if extra_count > 0 %}{% for item in ns.all_refs[preview_count:] %}{% if item.is_first_in_group %}. {{ item.group }}: {% elif loop.first %}, {% endif %}{{ item.ref.display }}{% if not loop.last and not ns.all_refs[preview_count + loop.index].is_first_in_group %}, {% endif %}{% endfor %} +{{ extra_count }}{% endif %} {% endif %} {% endif %}

{% if has_stanza_break and has_section_heading %}
{% endif %} {% endfor %} {% if pdf_available %} {% endif %} {% if related_content and (related_content.topics or related_content.people or related_content.resources or related_content.stories) %} {% endif %} {% endblock %}