aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-01-12 02:23:00 +0100
committerMatěj Cepl <mcepl@cepl.eu>2024-04-21 20:17:56 +0200
commit1fabef456ca42dd1a3d2b76184b86e324d9690bc (patch)
treeaddd5d6e62c9d5489535804502cda4e8e49a2e01
parent953c11a26ce2601eb34d9e61d053ccbfb8b31e82 (diff)
downloadhesla-1fabef456ca42dd1a3d2b76184b86e324d9690bc.tar.gz
WIP: add test case and result for parsing referencesdaily_reading
-rwxr-xr-xgenerate_html_cs.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/generate_html_cs.py b/generate_html_cs.py
index e449b9a..519a2a0 100755
--- a/generate_html_cs.py
+++ b/generate_html_cs.py
@@ -3,6 +3,7 @@ import codecs
import logging
import re
import sys
+from typing import Any, Dict
import jinja2
@@ -166,6 +167,35 @@ def csv2dict(filename):
logging.debug("out_dict:\n%s", out_dict)
return out_dict
+"""
+{%- macro bible_url(ref, bib_mod) -%}
+ http://www.crosswire.org/study/passagestudy.jsp?key={{ ref.book
+ }}+{{ ref.chapter }}%3A{{ ref.verse }}&amp;mod={{ bibMod }}
+{%- endmacro -%}
+{%- macro verses(word) -%}
+<p>{{ word.text }}</p>
+ <p class="reference">{% if word.int_ref_id -%}
+ <a href="{{ bible_url(word.int_ref_id) }}">
+ {{ word.ref }}
+ </a>
+ {%- else %}
+ {{ word.ref }}
+ {%- endif %}</p>{%- endmacro -%}
+
+ <Ev><SL>Lukáš 4,16-21</SL></Ev>
+ <Ep><SL>Jakubova 4,13-15</SL></Ep>
+ <Pr><SL>Filipským 4,10-20</SL></Pr>
+ <AT><SL>Jozue 1,1-9</SL></AT>
+ <Bl><SL>Žalm 100</SL></Bl>
+"""
+def parse_biblical_reference(instr: str) -> Dict[str, Any]:
+ return {
+ "book": "",
+ "chapter": 0,
+ "verse": 0,
+ "ref": ""
+ }
+
def parse_verses(lines):
"""