You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
love the template. I am using it a lot lately which is why I tweaked it a bit to my needs ;)
Espacially I am using the Headings as Links which makes it easier for me to organise my writing. The problem I has was that new comments where always added to the end and ones I already deleted in Zotero have still been visible in the obsidian file. I removed the persist badge from this and now that works but unfortunately It does not work with the self notes.
I would like to keep the self notes but reload the reading notes with every import. If I keep the persist at the self notes, write something there and reimport all my reading notes are gone :D
Do you have any idea how to solve this? Help would be highly appreciated ;)
You can try it yourself, just use this template, import a paper, add something add the self notes and reimport the paper
`---
tags: [{{allTags}}]
title: "{{title}}"
authors: "{{authors}}"
year: {{date | format("YYYY")}}
publisher: "{{publicationTitle}}"
citekey: {{citekey}}
collection: "[[{{collections[0].fullPath}}]]"
[!meta]- Metadata
abstract:: {{abstractNote}}
zotero_link:: {{pdfZoteroLink}}
Related:: {% for relation in relations -%} {%- if relation.citekey -%} [[{{relation.citekey}}]], {% endif -%} {%- endfor%}
url:: {{url}}
doi:: {{doi}}
bibliography:: {{bibliography}}
{%- if annot.color in zoteroColors -%}
{%- set customColor = zoteroColors[annot.color] -%}
{%- elif annot.colorCategory|lower in colorHeading -%}
{%- set customColor = annot.colorCategory|lower -%}
{%- else -%}
{%- set customColor = "other" -%}
{%- endif -%}
{%- set newAnnotations = (newAnnotations.push({"annotation": annot, "customColor": customColor}), newAnnotations) -%}
{%- endfor -%}
{#- INSERT ANNOTATIONS -#}
{#- Loops through each of the available colors and only inserts matching annotations -#}
{#- This is a workaround for inserting categories in a predefined order (instead of using groupby & the order in which they appear in the PDF) -#}
{%- for color, heading in colorHeading -%}
{%- for entry in newAnnotations | filterby ("customColor", "startswith", color) -%}
{%- set annot = entry.annotation -%}
{%- if entry and loop.first %}
{{colorHeading[color]}}
{%- endif %}
[!quote{{"|" + color if color != "other"}}]+ {{calloutHeader(annot.type)}} (page. {{annot.pageLabel}})
{%- if annot.annotatedText %}
{{annot.annotatedText|nl2br}} {% if annot.hashTags %}{{annot.hashTags}}{% endif -%}
{%- endif %}
{%- if annot.imageRelativePath %}
![[{{annot.imageRelativePath}}]]
{%- endif %}
{%- if annot.ocrText %}
{{annot.ocrText}}
{%- endif %}
{%- if annot.comment %}
{{annot.comment|nl2br}}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
{% endif %}`
The text was updated successfully, but these errors were encountered:
The template contains two lists. One containing the previous annotations and one new. You just need to remove the previous annotations and consider only new annotations each time you import. And no "persist" wrap around the annotations which you already did.
Hey man,
love the template. I am using it a lot lately which is why I tweaked it a bit to my needs ;)
Espacially I am using the Headings as Links which makes it easier for me to organise my writing. The problem I has was that new comments where always added to the end and ones I already deleted in Zotero have still been visible in the obsidian file. I removed the persist badge from this and now that works but unfortunately It does not work with the self notes.
I would like to keep the self notes but reload the reading notes with every import. If I keep the persist at the self notes, write something there and reimport all my reading notes are gone :D
Do you have any idea how to solve this? Help would be highly appreciated ;)
You can try it yourself, just use this template, import a paper, add something add the self notes and reimport the paper
`---
tags: [{{allTags}}]
title: "{{title}}"
authors: "{{authors}}"
year: {{date | format("YYYY")}}
publisher: "{{publicationTitle}}"
citekey: {{citekey}}
collection: "[[{{collections[0].fullPath}}]]"
Webpage
<iframe src="{{url}}" allow="fullscreen" allowfullscreen="" style="height:100%;width:100%; aspect-ratio: 16 / 10; "></iframe>Self Notes
{% persist "notes" %}{% if isFirstImport %}
{% endif %}things to add each time you import
{% endpersist %}
Reading notes
{%-
set zoteroColors = {
"#2ea8e5": "blue",
"#5fb236": "green",
"#a28ae5": "purple",
"#ff6666": "red",
"#ffd400": "yellow",
"#f19837": "orange",
"#aaaaaa": "grey",
"#e56eee": "magenta"
}
-%}
{%-⚠️ Discussion, Disagree with author",
set colorHeading = {
"blue": "ℹ Background information, Prerequisites",
"green": "❓ Assumptions, Questions, Goals, Problems",
"purple": "📊 Main findings, Results, Conclusions",
"red": "🧪Experimental details or Methods",
"yellow": "⭐ Interesting point, Facts, Examples",
"orange": "
"grey": "📅 Vocabulary, Names, Dates, Definitions",
"magenta": "📄 Important references"
}
-%}
{%- macro calloutHeader(type) -%}
{%- switch type -%}
{%- case "highlight" -%}
Highlight
{%- case "image" -%}
Image
{%- default -%}
Note
{%- endswitch -%}
{%- endmacro %}
{%- set newAnnot = [] -%}
{%- set newAnnotations = [] -%}
{%- set annotations = annotations | filterby("date", "dateafter", lastImportDate) %}
{% if annotations.length > 0 %}
Imported: {{importDate | format("YYYY-MM-DD HH:mm")}}
{%- for annot in annotations -%}
{%- endfor -%}
{#- INSERT ANNOTATIONS -#}
{#- Loops through each of the available colors and only inserts matching annotations -#}
{#- This is a workaround for inserting categories in a predefined order (instead of using groupby & the order in which they appear in the PDF) -#}
{%- for color, heading in colorHeading -%}
{%- for entry in newAnnotations | filterby ("customColor", "startswith", color) -%}
{%- set annot = entry.annotation -%}
{%- if entry and loop.first %}
{{colorHeading[color]}}
{%- endif %}
{%- if annot.annotatedText %}
{%- if annot.imageRelativePath %}
{%- if annot.ocrText %}
{%- if annot.comment %}
{%- endfor -%}
{%- endfor -%}
{% endif %}`
The text was updated successfully, but these errors were encountered: