From 01960d1d4ce6d065addc7e55a17e56bc08b9d9b8 Mon Sep 17 00:00:00 2001 From: Florian Matter Date: Wed, 27 Dec 2023 21:07:56 +0100 Subject: [PATCH] empty text ref if text not in db --- src/lingdocs/data/model_templates/latex_util.md | 2 +- src/lingdocs/data/model_templates/mkdocs_util.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lingdocs/data/model_templates/latex_util.md b/src/lingdocs/data/model_templates/latex_util.md index 1540178..b218300 100644 --- a/src/lingdocs/data/model_templates/latex_util.md +++ b/src/lingdocs/data/model_templates/latex_util.md @@ -15,7 +15,7 @@ {% macro txt_src(ctx) -%} {% if data is undefined %} {{ctx.data["Text_ID"]}}{% if ctx.data["Sentence_Number"] %}: {{ctx.data["Sentence_Number"]}}{%endif%}{% if ctx.data["Phrase_Number"] %} ({{ctx.data["Phrase_Number"]}}){%endif%} -{% else %} +{% elif data["examples"][ctx.id].text %} {{link(data["examples"][ctx.id].text, anchor=ctx.id, html=True)}}{% if ctx.data["Sentence_Number"] %}: {{ctx.data["Sentence_Number"]}}{%endif%} {% endif %} {%- endmacro %} diff --git a/src/lingdocs/data/model_templates/mkdocs_util.md b/src/lingdocs/data/model_templates/mkdocs_util.md index 01cf2c7..d14b5e4 100644 --- a/src/lingdocs/data/model_templates/mkdocs_util.md +++ b/src/lingdocs/data/model_templates/mkdocs_util.md @@ -49,7 +49,7 @@ {% macro txt_src(ctx) -%} {%- if data is undefined %} {{ctx.data["Text_ID"]}}{% if ctx.data["Sentence_Number"] %}: {{ctx.data["Sentence_Number"]}}{%endif%} -{% else %} +{% elif data["examples"][ctx.id].text %} {{link(data["examples"][ctx.id].text, anchor=ctx.id, html=True)}}{% if ctx.data["Sentence_Number"] %}: {{ctx.data["Sentence_Number"]}}{%endif%} {% endif %} {%- endmacro %}