From 1fabef456ca42dd1a3d2b76184b86e324d9690bc Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 12 Jan 2024 02:23:00 +0100 Subject: WIP: add test case and result for parsing references --- generate_html_cs.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) 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 }}&mod={{ bibMod }} +{%- endmacro -%} +{%- macro verses(word) -%} +

{{ word.text }}

+

{% if word.int_ref_id -%} + + {{ word.ref }} + + {%- else %} + {{ word.ref }} + {%- endif %}

{%- endmacro -%} + + Lukáš 4,16-21 + Jakubova 4,13-15 + Filipským 4,10-20 + Jozue 1,1-9 + Žalm 100 +""" +def parse_biblical_reference(instr: str) -> Dict[str, Any]: + return { + "book": "", + "chapter": 0, + "verse": 0, + "ref": "" + } + def parse_verses(lines): """ -- cgit