I’m currently trying to customize a Zotero annotation template and have seen a lot of good examples, but I’m still not completely satisfied. I can’t seem to wrap my head around how the code is working and keep getting errors.
I’m currently using this block of code (mostly stolen from different templates found on different forums:
{% for annotation in annotations -%}
{%- if annotation.annotatedText -%}{% if 'Red' in annotation.colorCategory %} ### {{annotation.annotatedText | escape}} {% else %} {{annotation.annotatedText | escape}}"([side {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}&annotation={{annotation.id}})) {%- endif %}
{%- if annotation.imageRelativePath -%} ![[{{annotation.imageRelativePath}}]] {%- endif %} {% if annotation.comment %}
- {{annotation.comment}}
{% endif %}{% if annotation.comment %} >{{annotation.comment}} {% endif %}{% endfor -%}
When using this i get the error ‘unknown block tag: endfor’
I originally used this:
{% for annotation in annotations %}
{%- if annotation.annotatedText -%}{{annotation.annotatedText}}"([side {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}&annotation={{annotation.id}})) {%- endif %}
{%- if annotation.imageRelativePath -%} ![[{{annotation.imageRelativePath}}]] {%- endif %} {% if annotation.comment %}
- {{annotation.comment}}
{% endif %}
{% endfor -%}
The only difference is that I want to be able to highlight titles and subtitles in different colours (anything but yellow), and use yellow for normal-text highlighting. This is to organize my highlighting under each topic, by e.g. making everything that’s highlighted with ‘red’ a level 2 or 3 header
As you might have noticed I’m quite new here and couldn’t find any matching topics for this question.