Skip to content

Update the same file with updated annotations #51

@riasat-sheikh

Description

@riasat-sheikh

I really appreciate your work on this plugin. It is amazing. But I wish you add a very basic feature as explained below.

Problem

If I import a book into obsidian it makes the file accordingly based on the template mentioned. And I can see you have added an option to rename the old file when importing a updated instance of the same book. It won't even import the same book with the off. Really painful.

Possible solution

I am using a plugin called Obsidian Zotero Integration. It pulls the entries in my Zotero library and then creates a file in the said location according to the defined template.

Now, the best part is that it follows something called Nunjucks templating language. I don't know the technical stuff much but it made the plugin really amazing.

What it does?

Well simply saying it just prevents part of the defined template to not be overwritten every time the user initiate the import to add the new annotations into pre-existent file. For more information please check this section of obsidian zotero plugin

I can add {% persist "id" %} nothing is changed inside this {% endpersist %}

For example I am attaching a part of my zotero import code here

{% persist "annotations" %}
{% set newAnnotations = annotations | filterby("date", "dateafter", lastImportDate) %}
{% if newAnnotations.length > 0 %}

### Imported on {{importDate | format("DD MMM, YYYY HH:mm")}}

{% for annotation in newAnnotations -%}

> [!{{annotation.colorCategory|lower}}|{{annotation.colorCategory|lower}}]+ Annotation
> {%- if annotation.annotatedText -%} {{annotation.annotatedText}} ([pg. {{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 %} [!note]- comment
> > {{annotation.comment}}{%- endif %}

{% endfor %}

{% endif %}
{% endpersist %}

Outcome

  • Make it easier to manage annotations
  • No file clutter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions