From e087ba9933a56d48f7193836eac4122f32c8b84d Mon Sep 17 00:00:00 2001 From: Mark Wissink Date: Mon, 28 Sep 2026 22:39:57 -0400 Subject: [PATCH] Add chapter headers --- assets/css/app.css | 18 ++++++++++++++++-- assets/templates/base.njk | 9 ++++----- utils/compile_bible.py | 15 +++++++++++---- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/assets/css/app.css b/assets/css/app.css index fc6b3ed..e184f98 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -3,17 +3,31 @@ "Times New Roman", serif; } +/* Both of these are links to their own id. They keep the text colour they + had as plain numbers, since an underlined blue verse number in the middle + of a sentence reads as part of the text. */ +.v, +.chapter-number a { + color: var(--bs-secondary-color); + text-decoration: none; +} + +.v:hover, +.chapter-number a:hover { + color: var(--bs-emphasis-color); +} + .v { font-size: .7em; font-weight: 700; vertical-align: super; line-height: 0; margin-right: .15em; - color: var(--bs-secondary-color); user-select: none; } -.v:focus-visible { +.v:focus-visible, +.chapter-number a:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; border-radius: 2px; diff --git a/assets/templates/base.njk b/assets/templates/base.njk index 6db066d..92beeb9 100644 --- a/assets/templates/base.njk +++ b/assets/templates/base.njk @@ -46,15 +46,14 @@
+ {# A verse number is a link to itself, so the browser handles the jump and + the address bar; this only adds the dialog on top. Enter comes free + with the link, which is why there is no key handler here. #}
+ swap: 'innerHTML' });"> {% block content %}{% endblock %}
diff --git a/utils/compile_bible.py b/utils/compile_bible.py index 03abfab..c01d11e 100644 --- a/utils/compile_bible.py +++ b/utils/compile_bible.py @@ -460,11 +460,16 @@ def render_inline(nodes, book, chapter, out): out.append(esc(node["v"])) elif kind == "verse": label = esc(node["label"]) - out.append('%s ' - % (verse_id(chapter, node["label"]), label, label)) + 'aria-label="Verse %s, options">%s ' + % (vid, vid, label, label)) elif kind == "noteref": n = node["id"].replace("FN", "") out.append('' @@ -531,7 +536,9 @@ def render_chapter(chapter, book, out): num = chapter["number"] out.append('
\n' % (num, num)) - out.append('

%d

\n' % num) + out.append('

' + '%d

\n' + % (num, num, num)) group = None