diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-24 14:23:55 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-24 14:23:55 +0200 |
| commit | a87f2fafbda90cc9eeb32ea856356c34e1d880b0 (patch) | |
| tree | 20d1a9ab2bca099e1fdf8afd6391321de1119b50 /internal/render/render.go | |
| parent | e54b24308e42addad396a13f9f53a60e5f6468d5 (diff) | |
| download | lectio-a87f2fafbda90cc9eeb32ea856356c34e1d880b0.tar.gz lectio-a87f2fafbda90cc9eeb32ea856356c34e1d880b0.zip | |
grb: strip SBLGNT apparatus markers (U+2E00–U+2E0D); render: show scripture ref in traditional headings; v0.12.0
Diffstat (limited to 'internal/render/render.go')
| -rw-r--r-- | internal/render/render.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/render/render.go b/internal/render/render.go index 7ba8ebd..6cdb939 100644 --- a/internal/render/render.go +++ b/internal/render/render.go @@ -65,6 +65,22 @@ func LocalizeHeading(heading, partID, lang string) string { return heading } +// HeadingWithRef returns a section's localised heading with its scripture +// reference appended in parentheses when the heading does not already carry +// one. The modern (niedziela) heading already embeds its citation -- e.g. +// "Ewangelia (J 20, 1. 11-18)" -- while the traditional (missalemeum) heading +// is a bare label ("Gospel"/"Ewangelia") with the reference only in +// sec.Citation; this appends it so every reading shows where it is from, +// uniformly across cli/tui/web. The citation is source-form (like the modern +// one), never translated. +func HeadingWithRef(sec liturgy.Section, lang string) string { + heading := LocalizeHeading(sec.Heading, sec.PartID, lang) + if sec.Citation != "" && !strings.Contains(heading, "(") { + heading += " (" + sec.Citation + ")" + } + return heading +} + // versionSystem maps a bible version to the Psalter system bible.ToEnglishRef // expects: vul/grb/wuj follow the Vulgate/Septuagint numbering, drb follows // the Hebrew chapter with the DRB title-fold verse shift. Ported from |
