Skip to content

Instantly share code, notes, and snippets.

@QWxleA
Last active May 13, 2025 13:48
Show Gist options
  • Select an option

  • Save QWxleA/c7f08e8feded332736a6b376045d0fe4 to your computer and use it in GitHub Desktop.

Select an option

Save QWxleA/c7f08e8feded332736a6b376045d0fe4 to your computer and use it in GitHub Desktop.

Revisions

  1. QWxleA revised this gist Aug 24, 2023. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # QWxlea's over-engineered zotero template

    ## Faq

    **What are these `%% begin id-pn2xitti%%` and `%% end id-pn2xitti %%` and `^pn2xitti`?**
    These are the persistance-markers of the indivual highlights, and the reference-id to that highlight.

    The markers are meant for the importer. It will skip all text within those markers, so they stay when updating a zotero-import. Removing a marked block does not work well, it will not be reimported. Don't know how to fix that. If you want to reimport a highlight-block, best is to change the highlight in zotero (for example change the color). This will update the id, and on the next import the new highlight will be imported.

    The reference-id is used like this: `[[@name-of-the-note#^pn2xitti]]`

  2. QWxleA revised this gist Aug 5, 2023. 1 changed file with 12 additions and 6 deletions.
    18 changes: 12 additions & 6 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    ---
    title: "{{title | safe}}"
    aliases:
    {#- Backwards compatible with older version, which had @title in the published url -#}
    {% set tempAlias = ["%40", citekey] | join | safe -%}
    - "{{ tempAlias }}"
    {% if shortTitle %}- {{shortTitle | safe}}
    @@ -98,7 +99,7 @@ permalink: "{{citekey | safe }}"
    %}
    # {{title}}

    > [!info]- Info - [**Zotero**]({{desktopURI}}) {% if DOI %}| [**DOI**](https://doi.org/{{DOI}}){% endif %} | Local {% for attachment in attachments | filterby("path", "endswith", ".pdf") %}[**PDF**](file:///{{attachment.path | replace(" ", "%20")}}){%- endfor %}
    > [!info] Info - [**Zotero**]({{desktopURI}}) {% if DOI %}| [**DOI**](https://doi.org/{{DOI}}){% endif %} | Local {% for attachment in attachments | filterby("path", "endswith", ".pdf") %}[**PDF**](file:///{{attachment.path | replace(" ", "%20")}}){%- endfor %}
    {% if ShortTitle %}> Short title: {{shortTitle | safe}}{% endif -%}
    > Authors: {% for c in creators %}[[{{c.firstName}} {{c.lastName}}]] {% endfor %}
    {% if publicationTitle %}> Publication: {{publicationTitle | safe}}{% endif -%}
    @@ -110,8 +111,11 @@ permalink: "{{citekey | safe }}"
    >
    > **History**
    > Date item added to Zotero: [[{{dateAdded | format("YYYY-MM-DD")}}]]
    {%- if annotations %}
    > First date annotations or notes modified: [[{{minEditDate() | truncate(10,true,"")}}]]
    > Last date annotations or notes modified: [[{{maxEditDate()| truncate(10,true,"")}}]]
    {%- endif %}
    > Export date: [[{{exportDate | format("YYYY-MM-DD")}}]]

    {%- if relations.length > 0 %}
    {{ "" }}
    @@ -149,25 +153,27 @@ permalink: "{{citekey | safe }}"
    {% endpersist %}

    ---
    # Annotations
    <small>(Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]</small>)

    ## Annotations
    {% for color, colorCategorie in zoteroColors %}
    {%- for entry in annotations | filterby ("color", "startswith", color) -%}
    {%- if entry.id %}
    {%- if entry and loop.first %}## {{categoryIcon[zoteroColors[entry.color]]}} {{categoryHeading[zoteroColors[color]]}}{% endif %}
    {% if entry and loop.first %}## {{categoryIcon[zoteroColors[entry.color]]}} {{categoryHeading[zoteroColors[color]]}}{% endif %}
    {% set annoID = ["id-", entry.id] | join | lower %}
    {%- persist annoID %}
    {%- if entry.date > lastExportDate %}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{ entry.annotatedText }}{% endif %}
    {%- if entry.imageBaseName %}![[@{{citekey}}/{{entry.imageBaseName}}|300]]
    {% endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}{% endif %}
    {{printTags(entry.tags)}}<small>([{{title | truncate(50)}} p.{{entry.pageLabel}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.page}}&annotation={{entry.id}})) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small>
    {%- endif %}
    {% endpersist %} {# do not add "-", entry-id needs newline #}
    ^{{ entry.id | lower }}

    {%- if entry.comment %}
    >[!note]
    >{{entry.comment}}
    {% endif -%}

    {% endif -%} {# /if entry.id -#}
    {% endfor -%}
    {% endfor -%}
  3. QWxleA revised this gist Jul 29, 2023. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,14 @@
    ---
    title: "{{title | safe}}"
    alias: {% if ShortTitle %}"{{shortTitle | safe}}"{% endif %}
    aliases:
    {% set tempAlias = ["%40", citekey] | join | safe -%}
    - "{{ tempAlias }}"
    {% if shortTitle %}- {{shortTitle | safe}}
    {% endif -%}
    Year: {{date | format("YYYY")}}
    tags: type/source
    Authors: {{authors}}{{directors}}
    permalink: "{{citekey | safe }}"
    ---

    {#- These can be changed -#}
    @@ -155,7 +160,8 @@ Authors: {{authors}}{{directors}}
    {%- persist annoID %}
    {%- if entry.date > lastExportDate %}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{ entry.annotatedText }}{% endif %}
    {%- if entry.imageBaseName %}![[Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>{% endif %}
    {%- if entry.imageBaseName %}![[@{{citekey}}/{{entry.imageBaseName}}|300]]
    {% endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}{% endif %}
    {{printTags(entry.tags)}}<small>([{{title | truncate(50)}} p.{{entry.pageLabel}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.page}}&annotation={{entry.id}})) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small>
    {%- endif %}
  4. QWxleA revised this gist Jul 29, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -154,10 +154,10 @@ Authors: {{authors}}{{directors}}
    {% set annoID = ["id-", entry.id] | join | lower %}
    {%- persist annoID %}
    {%- if entry.date > lastExportDate %}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{ entry.annotatedText | replace(r/\n/g, ' ') }}{% endif %}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{ entry.annotatedText }}{% endif %}
    {%- if entry.imageBaseName %}![[Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>{% endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}{% endif %}
    {{printTags(entry.tags)}}<small>([{{title | truncate(50)}} p.{{entry.pageLabel}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.pageLabel}}&annotation={{entry.id}})) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small>
    {{printTags(entry.tags)}}<small>([{{title | truncate(50)}} p.{{entry.pageLabel}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.page}}&annotation={{entry.id}})) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small>
    {%- endif %}
    {% endpersist %} {# do not add "-", entry-id needs newline #}
    ^{{ entry.id | lower }}
  5. QWxleA revised this gist Jul 29, 2023. 1 changed file with 11 additions and 9 deletions.
    20 changes: 11 additions & 9 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,7 @@ Year: {{date | format("YYYY")}}
    tags: type/source
    Authors: {{authors}}{{directors}}
    ---

    {#- These can be changed -#}
    {#- This is the order in which the annotations are ordered -#}
    {%-
    @@ -124,7 +125,7 @@ Authors: {{authors}}{{directors}}
    {{ "" }}
    {%- for note in notes -%}
    {#- Clean up note, change heading level, just in case -#}
    > {{ note.note | replace ("# ","### ") }}
    > {{ note.note | replace ("# ","### ") | replace(r/\n/g, '\n> ')}}
    > {{printTags(note.tags)}}
    > <small>πŸ“οΈ (modified: {{ note.dateModified | format("YYYY-MM-DD") }}) [link](zotero://select/library/items/{{note.key}}) - [web]({{note.uri}})</small>
    > {{ "" }}
    @@ -140,26 +141,27 @@ Authors: {{authors}}{{directors}}
    ---
    ## Persistant notes
    {% persist "notes" %}

    {% endpersist %}

    ---
    # Annotations <small>(Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]</small>)
    # Annotations
    <small>(Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]</small>)

    {% for color, colorCategorie in zoteroColors %}
    {%- for entry in annotations | filterby ("color", "startswith", color) -%}
    {%- if entry.id %}
    {%- if entry and loop.first %}## {{categoryIcon[zoteroColors[entry.color]]}} {{categoryHeading[zoteroColors[color]]}}{% endif %}
    {% set annoID = ["id-", entry.id] | join | lower %}
    {%- persist annoID %}
    {% if entry.date > lastExportDate %}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{entry.annotatedText}}{% endif %}
    {%- if entry.date > lastExportDate %}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{ entry.annotatedText | replace(r/\n/g, ' ') }}{% endif %}
    {%- if entry.imageBaseName %}![[Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>{% endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}{% endif %}
    {{printTags(entry.tags)}} <small>([{{title | truncate(50)}} p.{{entry.pageLabel}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.pageLabel}}&annotation={{entry.id}})) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small> ^{{ entry.id | lower }}
    {% endif %} {# needs a newline so the reference id doesn't break #}
    {%- endpersist %}
    {{printTags(entry.tags)}}<small>([{{title | truncate(50)}} p.{{entry.pageLabel}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.pageLabel}}&annotation={{entry.id}})) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small>
    {%- endif %}
    {% endpersist %} {# do not add "-", entry-id needs newline #}
    ^{{ entry.id | lower }}

    {% endif -%} {# entry.id #}
    {% endif -%} {# /if entry.id -#}
    {% endfor -%}
    {% endfor -%}
  6. QWxleA revised this gist Jun 7, 2023. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -151,14 +151,14 @@ Authors: {{authors}}{{directors}}
    {%- if entry.id %}
    {%- if entry and loop.first %}## {{categoryIcon[zoteroColors[entry.color]]}} {{categoryHeading[zoteroColors[color]]}}{% endif %}
    {% set annoID = ["id-", entry.id] | join | lower %}
    {% persist annoID %}
    {%- persist annoID %}
    {% if entry.date > lastExportDate %}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{entry.annotatedText}}{% endif %}
    {%- if entry.imageBaseName %}![[Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>{% endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}{% endif %}
    {{printTags(entry.tags)}} <small>([{{title | truncate(50)}} p.{{entry.pageLabel}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.pageLabel}}&annotation={{entry.id}})) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small> ^{{ entry.id | lower }}
    {%- endif %}
    {% endpersist %}
    {% endif %} {# needs a newline so the reference id doesn't break #}
    {%- endpersist %}

    {% endif -%} {# entry.id #}
    {% endfor -%}
  7. QWxleA revised this gist Jun 6, 2023. 1 changed file with 10 additions and 9 deletions.
    19 changes: 10 additions & 9 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -149,16 +149,17 @@ Authors: {{authors}}{{directors}}
    {% for color, colorCategorie in zoteroColors %}
    {%- for entry in annotations | filterby ("color", "startswith", color) -%}
    {%- if entry.id %}
    {%- if entry and loop.first %}## {{categoryIcon[zoteroColors[entry.color]]}} {{categoryHeading[zoteroColors[color]]}}
    {% endif -%}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{entry.annotatedText}}
    {% endif -%}
    {%- if entry.imageBaseName %}>![[Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>
    {%- if entry and loop.first %}## {{categoryIcon[zoteroColors[entry.color]]}} {{categoryHeading[zoteroColors[color]]}}{% endif %}
    {% set annoID = ["id-", entry.id] | join | lower %}
    {% persist annoID %}
    {% if entry.date > lastExportDate %}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{entry.annotatedText}}{% endif %}
    {%- if entry.imageBaseName %}![[Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>{% endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}{% endif %}
    {{printTags(entry.tags)}} <small>([{{title | truncate(50)}} p.{{entry.pageLabel}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.pageLabel}}&annotation={{entry.id}})) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small> ^{{ entry.id | lower }}
    {%- endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}
    {% endif -%}
    {{printTags(entry.tags)}} <small>([p. {{entry.pageLabel}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.pageLabel}}&annotation={{entry.id}})) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small> ^{{ entry.id | lower }}
    {% endpersist %}

    {% endif -%}
    {% endif -%} {# entry.id #}
    {% endfor -%}
    {% endfor -%}
  8. QWxleA revised this gist Jun 5, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion zotero template
    Original file line number Diff line number Diff line change
    @@ -157,7 +157,7 @@ Authors: {{authors}}{{directors}}
    {%- endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}
    {% endif -%}
    {{printTags(entry.tags)}} <small>[Page {{entry.page}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.page}}) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small> ^{{ entry.id | lower }}
    {{printTags(entry.tags)}} <small>([p. {{entry.pageLabel}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.pageLabel}}&annotation={{entry.id}})) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small> ^{{ entry.id | lower }}

    {% endif -%}
    {% endfor -%}
  9. QWxleA revised this gist Jun 4, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion zotero template
    Original file line number Diff line number Diff line change
    @@ -153,7 +153,7 @@ Authors: {{authors}}{{directors}}
    {% endif -%}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{entry.annotatedText}}
    {% endif -%}
    {%- if entry.imageBaseName %}>![[/Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>
    {%- if entry.imageBaseName %}>![[Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>
    {%- endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}
    {% endif -%}
  10. QWxleA revised this gist Jun 4, 2023. 1 changed file with 6 additions and 7 deletions.
    13 changes: 6 additions & 7 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -89,18 +89,17 @@ Authors: {{authors}}{{directors}}
    "#e56eee": "magenta",
    "#aaaaaa": "grey"
    }
    -%}

    %}
    # {{title}}

    > [!info]- Info - [**Zotero**]({{desktopURI}}) | [**DOI**](https://doi.org/{{DOI}}) | Local {% for attachment in attachments | filterby("path", "endswith", ".pdf") %}[**PDF**](file:///{{attachment.path | replace(" ", "%20")}}){%- endfor %}
    > {% if ShortTitle %}Short title: {{shortTitle | safe}}{% endif %}
    > [!info]- Info - [**Zotero**]({{desktopURI}}) {% if DOI %}| [**DOI**](https://doi.org/{{DOI}}){% endif %} | Local {% for attachment in attachments | filterby("path", "endswith", ".pdf") %}[**PDF**](file:///{{attachment.path | replace(" ", "%20")}}){%- endfor %}
    {% if ShortTitle %}> Short title: {{shortTitle | safe}}{% endif -%}
    > Authors: {% for c in creators %}[[{{c.firstName}} {{c.lastName}}]] {% endfor %}
    > Publication: {{publicationTitle}}
    {% if publicationTitle %}> Publication: {{publicationTitle | safe}}{% endif -%}
    > Type: {{itemType}}
    > Year: {{date | format("YYYY")}}
    {% if DOI %}> DOI: **{{DOI}}**{% endif %}
    > Zotero links: [Item]({{select}}) {% if pdfZoteroLink %}PDF: {{pdfZoteroLink}}{% endif %}
    > Web links: [Item]({{uri}}) {% if pdfLink %}PDF: {{pdfLink}}{% endif %}
    > Web links: {% if itemType == "webpage" %}[{{title}}]({{url}}){%else%}[Item]({{uri}}){%endif%} {% if pdfLink %}PDF: {{pdfLink}}{% endif %}
    > {{printTags(note.tags)}}
    >
    > **History**
  11. QWxleA revised this gist Jun 4, 2023. No changes.
  12. QWxleA revised this gist Jun 3, 2023. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -91,7 +91,9 @@ Authors: {{authors}}{{directors}}
    }
    -%}

    > [!note] {{title}}
    # {{title}}

    > [!info]- Info - [**Zotero**]({{desktopURI}}) | [**DOI**](https://doi.org/{{DOI}}) | Local {% for attachment in attachments | filterby("path", "endswith", ".pdf") %}[**PDF**](file:///{{attachment.path | replace(" ", "%20")}}){%- endfor %}
    > {% if ShortTitle %}Short title: {{shortTitle | safe}}{% endif %}
    > Authors: {% for c in creators %}[[{{c.firstName}} {{c.lastName}}]] {% endfor %}
    > Publication: {{publicationTitle}}
    @@ -106,7 +108,8 @@ Authors: {{authors}}{{directors}}
    > First date annotations or notes modified: [[{{minEditDate() | truncate(10,true,"")}}]]
    > Last date annotations or notes modified: [[{{maxEditDate()| truncate(10,true,"")}}]]

    {%- if relations.length > 0 -%}
    {%- if relations.length > 0 %}
    {{ "" }}
    > [!abstract] Related Zotero items ({{ relations.length}}):
    >
    > | title | proxy note | desktopURI |
    @@ -136,14 +139,13 @@ Authors: {{authors}}{{directors}}
    > {% endif %}

    ---
    ## Personal notes
    ## Persistant notes
    {% persist "notes" %}

    {% endpersist %}

    ---
    # Annotations
    <small>Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]</small>
    # Annotations <small>(Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]</small>)

    {% for color, colorCategorie in zoteroColors %}
    {%- for entry in annotations | filterby ("color", "startswith", color) -%}
    @@ -161,5 +163,3 @@ Authors: {{authors}}{{directors}}
    {% endif -%}
    {% endfor -%}
    {% endfor -%}


  13. QWxleA revised this gist Jun 3, 2023. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion zotero template
    Original file line number Diff line number Diff line change
    @@ -136,7 +136,7 @@ Authors: {{authors}}{{directors}}
    > {% endif %}

    ---
    ## Notes
    ## Personal notes
    {% persist "notes" %}

    {% endpersist %}
    @@ -157,6 +157,7 @@ Authors: {{authors}}{{directors}}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}
    {% endif -%}
    {{printTags(entry.tags)}} <small>[Page {{entry.page}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.page}}) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small> ^{{ entry.id | lower }}

    {% endif -%}
    {% endfor -%}
    {% endfor -%}
  14. QWxleA revised this gist Jun 3, 2023. 1 changed file with 39 additions and 3 deletions.
    42 changes: 39 additions & 3 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -32,6 +32,39 @@ Authors: {{authors}}{{directors}}
    }
    -%}
    {#- ---------- Don't make any changes under here --------- #}
    {%- macro minEditDate() -%}
    {%- set tempDate = "" -%}
    {%- for a in annotations -%}
    {%- set testDate = a.date | format("YYYY-MM-DD#HH:mm:ss") -%}
    {%- if testDate < tempDate or tempDate == ""-%}
    {%- set tempDate = testDate -%}
    {%- endif -%}
    {%- endfor -%}
    {%- for a in notes -%}
    {%- set testDate = a.dateModified | format("YYYY-MM-DD#HH:mm:ss") -%}
    {%- if testDate < tempDate or tempDate == ""-%}
    {%- set tempDate = testDate -%}
    {%- endif -%}
    {%- endfor -%}
    {{tempDate }}
    {%- endmacro -%}
    {# infer latest note date #}
    {%- macro maxEditDate() -%}
    {%- set tempDate = "" -%}
    {%- for n in annotations -%}
    {%- set testDate = n.date | format("YYYY-MM-DD#HH:mm:ss") -%}
    {%- if testDate > tempDate or tempDate == ""-%}
    {%- set tempDate = testDate -%}
    {%- endif -%}
    {%- endfor -%}
    {%- for n in notes -%}
    {%- set testDate = n.dateModified | format("YYYY-MM-DD#HH:mm:ss") -%}
    {%- if testDate > tempDate or tempDate == ""-%}
    {%- set tempDate = testDate -%}
    {%- endif -%}
    {%- endfor -%}
    {{tempDate}}
    {%- endmacro -%}
    {#- handle | characters in zotero strings used in MD -#}
    {% macro formatCell(cellText) -%}
    {{ cellText | replace("|","❕")}}
    @@ -69,10 +102,11 @@ Authors: {{authors}}{{directors}}
    > {{printTags(note.tags)}}
    >
    > **History**
    > Date added to Zotero: [[{{dateAdded | format("YYYY-MM-DD")}}]]
    > Last date modified: [[{{dateModified | format("YYYY-MM-DD")}}]]
    > Date item added to Zotero: [[{{dateAdded | format("YYYY-MM-DD")}}]]
    > First date annotations or notes modified: [[{{minEditDate() | truncate(10,true,"")}}]]
    > Last date annotations or notes modified: [[{{maxEditDate()| truncate(10,true,"")}}]]

    {% if relations.length > 0 -%}
    {%- if relations.length > 0 -%}
    > [!abstract] Related Zotero items ({{ relations.length}}):
    >
    > | title | proxy note | desktopURI |
    @@ -126,3 +160,5 @@ Authors: {{authors}}{{directors}}
    {% endif -%}
    {% endfor -%}
    {% endfor -%}


  15. QWxleA revised this gist Jun 3, 2023. 1 changed file with 42 additions and 23 deletions.
    65 changes: 42 additions & 23 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,33 @@ Year: {{date | format("YYYY")}}
    tags: type/source
    Authors: {{authors}}{{directors}}
    ---
    {#- These can be changed -#}
    {#- This is the order in which the annotations are ordered -#}
    {%-
    set categoryHeading = {
    "orange": "Main ideas and conclusions",
    "yellow": "Ordinary notes",
    "blue": "Quote / quotable",
    "green": "Important To Me",
    "red": "Disagree With Author",
    "purple": "Interesting side-point",
    "magenta": "Methodology",
    "grey": "Definitions and concepts"
    }
    -%}
    {%-
    set categoryIcon = {
    "orange": "πŸ’‘",
    "yellow": "πŸ“š",
    "blue": "πŸ’¬",
    "green": "πŸ’š",
    "red": "β›”",
    "purple": "πŸ’­",
    "magenta": "βš™οΈ",
    "grey": "🧩"
    }
    -%}
    {#- ---------- Don't make any changes under here --------- #}
    {#- handle | characters in zotero strings used in MD -#}
    {% macro formatCell(cellText) -%}
    {{ cellText | replace("|","❕")}}
    @@ -30,19 +57,6 @@ Authors: {{authors}}{{directors}}
    "#aaaaaa": "grey"
    }
    -%}
    {#- This is the order in which the annotations are ordered -#}
    {%-
    set colorHeading = {
    "orange": "πŸ’‘ Main ideas and conclusions",
    "yellow": "πŸ“š Ordinary notes",
    "blue": "πŸ’¬ Quote / quotable",
    "green": "πŸ’š Important To Me",
    "red": "β›” Disagree With Author",
    "purple": "πŸ’­ Interesting side-point",
    "magenta": "βš™οΈ Methodology",
    "grey": "🧩 Definitions and concepts"
    }
    -%}

    > [!note] {{title}}
    > {% if ShortTitle %}Short title: {{shortTitle | safe}}{% endif %}
    @@ -82,24 +96,29 @@ Authors: {{authors}}{{directors}}
    {% endfor %}
    {% endif -%}

    {% if abstractNote %}
    ### Abstract
    {{abstractNote}}
    {% endif %}
    > [!abstract]-
    > {% if abstractNote %}
    > {{abstractNote|replace("\n"," ")}}
    > {% endif %}

    ---
    ## Notes
    {% persist "notes" %}

    {% endpersist %}

    {% for note in notes %}{% endfor %}
    ---
    > [!abstract] Annotations
    > <small>Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]</small>
    # Annotations
    <small>Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]</small>

    {% for color, colorCategorie in zoteroColors %}
    {%- for entry in annotations | filterby ("color", "startswith", color) -%}
    {%- if entry.id %}
    {%- if entry and loop.first %}## {{colorHeading[zoteroColors[color]]}}
    {%- if entry and loop.first %}## {{categoryIcon[zoteroColors[entry.color]]}} {{categoryHeading[zoteroColors[color]]}}
    {% endif -%}
    {%- if entry.id %}{{entry.annotatedText}}
    {%- if entry.annotatedText %}{{categoryIcon[zoteroColors[entry.color]]}} {{entry.annotatedText}}
    {% endif -%}
    {%- if entry.imageBaseName %}![[/Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>
    {%- if entry.imageBaseName %}>![[/Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>
    {%- endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}
    {% endif -%}
  16. QWxleA revised this gist Jun 3, 2023. 1 changed file with 42 additions and 10 deletions.
    52 changes: 42 additions & 10 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,31 @@ Authors: {{authors}}{{directors}}
    {%- endfor -%}
    {%- endif -%}
    {%- endmacro %}
    {%-
    set zoteroColors = {
    "#ff6666": "red",
    "#f19837": "orange",
    "#5fb236": "green",
    "#ffd400": "yellow",
    "#2ea8e5": "blue",
    "#a28ae5": "purple",
    "#e56eee": "magenta",
    "#aaaaaa": "grey"
    }
    -%}
    {#- This is the order in which the annotations are ordered -#}
    {%-
    set colorHeading = {
    "orange": "πŸ’‘ Main ideas and conclusions",
    "yellow": "πŸ“š Ordinary notes",
    "blue": "πŸ’¬ Quote / quotable",
    "green": "πŸ’š Important To Me",
    "red": "β›” Disagree With Author",
    "purple": "πŸ’­ Interesting side-point",
    "magenta": "βš™οΈ Methodology",
    "grey": "🧩 Definitions and concepts"
    }
    -%}

    > [!note] {{title}}
    > {% if ShortTitle %}Short title: {{shortTitle | safe}}{% endif %}
    @@ -64,14 +89,21 @@ Authors: {{authors}}{{directors}}

    {% for note in notes %}{% endfor %}
    ---
    > [!Abstract] Annotations
    > Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]
    > [!abstract] Annotations
    > <small>Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]</small>

    {% for annotation in annotations %}
    {% if annotation.annotatedText %}<mark style="background-color: {{annotation.color}};color: black">{% if (annotation.colorCategory == "Yellow") %}Highlight{% elif (annotation.colorCategory == "Orange") %}πŸ’‘ Main ideas and conclusions{% elif (annotation.colorCategory == "Red") %}β›” Disagree{% elif (annotation.colorCategory == "Green") %}πŸ’š Important to Me{% elif (annotation.colorCategory == "Purple") %}πŸ’¬ Quote{% elif (annotation.colorCategory == "Blue") %}πŸ’­ Interesting side-point{% elif (annotation.colorCategory == "Magenta") %}βš™οΈ Method{% elif (annotation.colorCategory == "Gray") %}🧩 Definitions and concepts{% else %}Other{% endif %}</mark> [Page {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}) <small>({% if ShortTitle %}{{shortTitle | safe}}{% else %}{{title}}{% endif %})</small>
    {{annotation.annotatedText}} ^{{ annotation.id | lower }}{% endif %}
    {% if annotation.comment %}>[!Note] Comment [[{{ annotation.date | format("YYYY-MM-DD")}}]]
    > [Page {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}) {% if annotation.hashTags %} {{ annotation.hashTags }}{% endif %}
    > {{annotation.comment}}{% endif %}
    {% if annotation.imageRelativePath %}![[{{annotation.imageRelativePath}}]]{% endif %}
    {% endfor %}
    {% for color, colorCategorie in zoteroColors %}
    {%- for entry in annotations | filterby ("color", "startswith", color) -%}
    {%- if entry.id %}
    {%- if entry and loop.first %}## {{colorHeading[zoteroColors[color]]}}
    {% endif -%}
    {%- if entry.id %}{{entry.annotatedText}}
    {% endif -%}
    {%- if entry.imageBaseName %}![[/Assets/@{{citekey}}/{{entry.imageBaseName}}|300]]<br>
    {%- endif %}
    {%- if entry.comment %}πŸ“οΈ {{entry.comment}}
    {% endif -%}
    {{printTags(entry.tags)}} <small>[Page {{entry.page}}](zotero://open-pdf/library/items/{{entry.attachment.itemKey}}?page={{entry.page}}) edited:[[{{ entry.date | format("YYYY-MM-DD")}}]]</small> ^{{ entry.id | lower }}
    {% endif -%}
    {% endfor -%}
    {% endfor -%}
  17. QWxleA revised this gist Jun 3, 2023. 1 changed file with 44 additions and 16 deletions.
    60 changes: 44 additions & 16 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -5,42 +5,70 @@ Year: {{date | format("YYYY")}}
    tags: type/source
    Authors: {{authors}}{{directors}}
    ---
    {#- handle | characters in zotero strings used in MD -#}
    {% macro formatCell(cellText) -%}
    {{ cellText | replace("|","❕")}}
    {%- endmacro %}
    {#- TAGS: handle space characters in zotero tags -#}
    {%- set space = joiner(' ') -%}
    {%- macro printTags(rawTags) -%}
    {%- if rawTags.length > 0 -%}
    {%- for tag in rawTags -%}
    #{{ tag.tag | lower | replace(" ","_") }} {{ space() }}
    {%- endfor -%}
    {%- endif -%}
    {%- endmacro %}

    > [!note] {{title}}
    > {% if ShortTitle %}Short title: {{shortTitle | safe}}{% endif %}
    > Authors: {% for c in creators %}[[{{c.firstName}} {{c.lastName}}]] {% endfor %}
    > Publication: {{publicationTitle}}
    > Year: {{date | format("YYYY")}}
    {% if DOI %}> DOI: **{{DOI}}**{% endif %}
    > Zotero PDF link: {{pdfZoteroLink}}
    > PDF: {{pdfLink}}
    > Web link: {{uri}}
    {% if hashTags %}>
    > {% for t in tags %}#{{t.tag}}{% if not loop.last %} {% endif %}{% endfor %}{% endif %}

    {% if relations %}
    {% for rel in relations %}
    > [!abstract] Related: [[@{{ rel.citationKey }}]]
    > Zotero: [{{rel.title}}]({{rel.desktopURI}})
    {% if rel.DOI %}> DOI: {{rel.DOI}}{% endif %}
    {% endfor %}{% endif %}

    ---
    > [!info] Item history
    > Zotero links: [Item]({{select}}) {% if pdfZoteroLink %}PDF: {{pdfZoteroLink}}{% endif %}
    > Web links: [Item]({{uri}}) {% if pdfLink %}PDF: {{pdfLink}}{% endif %}
    > {{printTags(note.tags)}}
    >
    > **History**
    > Date added to Zotero: [[{{dateAdded | format("YYYY-MM-DD")}}]]
    > Last date modified: [[{{dateModified | format("YYYY-MM-DD")}}]]

    {% if relations.length > 0 -%}
    > [!abstract] Related Zotero items ({{ relations.length}}):
    >
    > | title | proxy note | desktopURI |
    > | --- | --- | --- |
    {%- for r in relations %}
    > | {{formatCell(r.title)}} | [[@{{r.citekey}}]] | [Zotero Link]({{r.desktopURI}}) | {% if rel.DOI %}> DOI: {{rel.DOI}}{% endif %} |
    {%- endfor -%}
    {{ "" }}
    {%- endif %}

    {% if notes.length > 0 %}
    > [!note] Notes ({{notes.length}})
    {{ "" }}
    {%- for note in notes -%}
    {#- Clean up note, change heading level, just in case -#}
    > {{ note.note | replace ("# ","### ") }}
    > {{printTags(note.tags)}}
    > <small>πŸ“οΈ (modified: {{ note.dateModified | format("YYYY-MM-DD") }}) [link](zotero://select/library/items/{{note.key}}) - [web]({{note.uri}})</small>
    > {{ "" }}
    > ---
    {% endfor %}
    {% endif -%}

    {% if abstractNote %}
    ### Abstract
    {{abstractNote}}
    {% endif %}

    {% for note in notes %}{% endfor %}
    ---
    > [!Abstract] Annotations
    > Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]

    {% for annotation in annotations %}
    {% if annotation.annotatedText %}<mark style="background-color: {{annotation.color}};color: black">{% if (annotation.colorCategory == "Yellow") %}Highlight{% elif (annotation.colorCategory == "Orange") %}πŸ’‘ Main ideas and conclusions{% elif (annotation.colorCategory == "Red") %}β›” Disagree{% elif (annotation.colorCategory == "Green") %}πŸ’š Important to Me{% elif (annotation.colorCategory == "Purple") %}πŸ’¬ Quote{% elif (annotation.colorCategory == "Blue") %}πŸ’­ Interesting side-point{% elif (annotation.colorCategory == "Magenta") %}βš™οΈ Method{% elif (annotation.colorCategory == "Gray") %}🧩 Definitions and concepts{% else %}Other{% endif %}</mark> [Page {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}) <small>({% if ShortTitle %}{{shortTitle | safe}}{% else %}{{title}}{% endif %})</small>
    {% if annotation.annotatedText %}<mark style="background-color: {{annotation.color}};color: black">{% if (annotation.colorCategory == "Yellow") %}Highlight{% elif (annotation.colorCategory == "Orange") %}πŸ’‘ Main ideas and conclusions{% elif (annotation.colorCategory == "Red") %}β›” Disagree{% elif (annotation.colorCategory == "Green") %}πŸ’š Important to Me{% elif (annotation.colorCategory == "Purple") %}πŸ’¬ Quote{% elif (annotation.colorCategory == "Blue") %}πŸ’­ Interesting side-point{% elif (annotation.colorCategory == "Magenta") %}βš™οΈ Method{% elif (annotation.colorCategory == "Gray") %}🧩 Definitions and concepts{% else %}Other{% endif %}</mark> [Page {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}) <small>({% if ShortTitle %}{{shortTitle | safe}}{% else %}{{title}}{% endif %})</small>
    {{annotation.annotatedText}} ^{{ annotation.id | lower }}{% endif %}
    {% if annotation.comment %}>[!Note] Comment [[{{ annotation.date | format("YYYY-MM-DD")}}]]
    > [Page {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}) {% if annotation.hashTags %} {{ annotation.hashTags }}{% endif %}
  18. QWxleA revised this gist May 28, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion zotero template
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ Authors: {{authors}}{{directors}}
    > Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]

    {% for annotation in annotations %}
    {% if annotation.annotatedText %}<mark style="background-color: {{annotation.color}};color: black">{% if (annotation.colorCategory == "Yellow") %}Highlight{% elif (annotation.colorCategory == "Orange") %}πŸ’‘ Main ideas and conclusions{% elif (annotation.colorCategory == "Red") %}β›” Disagree{% elif (annotation.colorCategory == "Green") %}πŸ’š Important to Me{% elif (annotation.colorCategory == "Purple") %}πŸ’¬ Quote{% elif (annotation.colorCategory == "Blue") %}πŸ’­ Interesting side-point{% elif (annotation.colorCategory == "Magenta") %}βš™οΈ Method{% elif (annotation.colorCategory == "Gray") %}🧩 Definitions and concepts{% else %}Other{% endif %}</mark> [Page {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}})
    {% if annotation.annotatedText %}<mark style="background-color: {{annotation.color}};color: black">{% if (annotation.colorCategory == "Yellow") %}Highlight{% elif (annotation.colorCategory == "Orange") %}πŸ’‘ Main ideas and conclusions{% elif (annotation.colorCategory == "Red") %}β›” Disagree{% elif (annotation.colorCategory == "Green") %}πŸ’š Important to Me{% elif (annotation.colorCategory == "Purple") %}πŸ’¬ Quote{% elif (annotation.colorCategory == "Blue") %}πŸ’­ Interesting side-point{% elif (annotation.colorCategory == "Magenta") %}βš™οΈ Method{% elif (annotation.colorCategory == "Gray") %}🧩 Definitions and concepts{% else %}Other{% endif %}</mark> [Page {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}) <small>({% if ShortTitle %}{{shortTitle | safe}}{% else %}{{title}}{% endif %})</small>
    {{annotation.annotatedText}} ^{{ annotation.id | lower }}{% endif %}
    {% if annotation.comment %}>[!Note] Comment [[{{ annotation.date | format("YYYY-MM-DD")}}]]
    > [Page {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}) {% if annotation.hashTags %} {{ annotation.hashTags }}{% endif %}
  19. QWxleA revised this gist May 28, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion zotero template
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ Authors: {{authors}}{{directors}}
    > Authors: {% for c in creators %}[[{{c.firstName}} {{c.lastName}}]] {% endfor %}
    > Publication: {{publicationTitle}}
    > Year: {{date | format("YYYY")}}
    > DOI: **{{DOI}}**
    {% if DOI %}> DOI: **{{DOI}}**{% endif %}
    > Zotero PDF link: {{pdfZoteroLink}}
    > PDF: {{pdfLink}}
    > Web link: {{uri}}
  20. QWxleA created this gist May 28, 2023.
    49 changes: 49 additions & 0 deletions zotero template
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    ---
    title: "{{title | safe}}"
    alias: {% if ShortTitle %}"{{shortTitle | safe}}"{% endif %}
    Year: {{date | format("YYYY")}}
    tags: type/source
    Authors: {{authors}}{{directors}}
    ---

    > [!note] {{title}}
    > {% if ShortTitle %}Short title: {{shortTitle | safe}}{% endif %}
    > Authors: {% for c in creators %}[[{{c.firstName}} {{c.lastName}}]] {% endfor %}
    > Publication: {{publicationTitle}}
    > Year: {{date | format("YYYY")}}
    > DOI: **{{DOI}}**
    > Zotero PDF link: {{pdfZoteroLink}}
    > PDF: {{pdfLink}}
    > Web link: {{uri}}
    {% if hashTags %}>
    > {% for t in tags %}#{{t.tag}}{% if not loop.last %} {% endif %}{% endfor %}{% endif %}

    {% if relations %}
    {% for rel in relations %}
    > [!abstract] Related: [[@{{ rel.citationKey }}]]
    > Zotero: [{{rel.title}}]({{rel.desktopURI}})
    {% if rel.DOI %}> DOI: {{rel.DOI}}{% endif %}
    {% endfor %}{% endif %}

    ---
    > [!info] Item history
    > Date added to Zotero: [[{{dateAdded | format("YYYY-MM-DD")}}]]
    > Last date modified: [[{{dateModified | format("YYYY-MM-DD")}}]]

    {% if abstractNote %}
    ### Abstract
    {{abstractNote}}
    {% endif %}

    ---
    > [!Abstract] Annotations
    > Exported: [[{{exportDate | format("YYYY-MM-DD")}}]]

    {% for annotation in annotations %}
    {% if annotation.annotatedText %}<mark style="background-color: {{annotation.color}};color: black">{% if (annotation.colorCategory == "Yellow") %}Highlight{% elif (annotation.colorCategory == "Orange") %}πŸ’‘ Main ideas and conclusions{% elif (annotation.colorCategory == "Red") %}β›” Disagree{% elif (annotation.colorCategory == "Green") %}πŸ’š Important to Me{% elif (annotation.colorCategory == "Purple") %}πŸ’¬ Quote{% elif (annotation.colorCategory == "Blue") %}πŸ’­ Interesting side-point{% elif (annotation.colorCategory == "Magenta") %}βš™οΈ Method{% elif (annotation.colorCategory == "Gray") %}🧩 Definitions and concepts{% else %}Other{% endif %}</mark> [Page {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}})
    {{annotation.annotatedText}} ^{{ annotation.id | lower }}{% endif %}
    {% if annotation.comment %}>[!Note] Comment [[{{ annotation.date | format("YYYY-MM-DD")}}]]
    > [Page {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}) {% if annotation.hashTags %} {{ annotation.hashTags }}{% endif %}
    > {{annotation.comment}}{% endif %}
    {% if annotation.imageRelativePath %}![[{{annotation.imageRelativePath}}]]{% endif %}
    {% endfor %}