Skip to content

Commit

Permalink
Add references to verses
Browse files Browse the repository at this point in the history
In this commit, references to verses were added in the chapters.sql
file. A new condition was introduced to filter references with a rate
greater than 3. Additionally, in the same file, the logic related to
grouping verses was modified to differentiate between verses with
references and those without, affecting the structure and content of the
output.
  • Loading branch information
placek committed Apr 22, 2024
1 parent 3d298ae commit dca9250
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions chapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ WITH
) AS refs
FROM
cr.cross_references AS c
WHERE
c.rate > 3
GROUP BY
c.book_number, c.chapter, c.verse
),
Expand Down Expand Up @@ -60,10 +62,17 @@ WITH
v.book_number,
v.book,
v.chapter,
GROUP_CONCAT('{{verse data-verse="' || v.verse || '" data-references="' || c.refs || '"}}' || v.text || '{{/verse}}', '') AS verses
GROUP_CONCAT(
CASE
WHEN c.book_number IS NOT NULL THEN
'{{verse data-verse="' || v.verse || '" data-references="' || c.refs || '"}}' || v.text || '{{/verse}}'
ELSE
'{{verse data-verse="' || v.verse || '"}}' || v.text || '{{/verse}}'
END, ''
) AS verses
FROM
AllVersesD1 AS v
JOIN
LEFT JOIN
CrossReferences AS c
ON
v.book_number = c.book_number AND v.chapter = c.chapter AND v.verse = c.verse
Expand Down
1 change: 1 addition & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ chapter[data-chapter="1"] verse[data-verse="1"] { padding-top: 1em; }
chapter[data-chapter="1"] verse[data-verse="1"]::first-letter { font-size: 2.2em; float: left; line-height: 0.5em; }
verse[data-verse="1"] { display: inline-block; }
verse:before { content: attr(data-verse); font-family: mono; font-weight: 600; font-size: .6em; margin: 0 .5em; vertical-align: super; }
verse:after { content: attr(data-references); font-family: mono; font-size: .6em; margin: 0 .5em; vertical-align: baseline; }

0 comments on commit dca9250

Please sign in to comment.