PKM-er / obsidian-zotlit

A third-party project that aims to facilitate the integration between Obsidian.md and Zotero, by providing a set of community plugins for both Obsidian and Zotero.
https://zotlit.aidenlx.top
MIT License
589 stars 25 forks source link

[Feature Request] partial persistence of note #251

Open SeveNOlogy7 opened 8 months ago

SeveNOlogy7 commented 8 months ago

In my use case, somewhere of zt-note.eta contains some info about the literature item that may need update, and elsewhere contains some custom note that one would like to keep unchanged. This arrangement of note is actually quite common.

For example, part of a zt-note.eta file I'm testing is like:

# <%= it.title %>
* Authors: <% = it.authors.map(author=>'[['+author+']]').join(', ') %>
* KeyWords: <% = it.tags.map(tag=>'#'+tag.name).join(', ') %>
* Collections: <% = (new Set([].concat(...it.collections.map(c=>c.path.map(p=>'#'+p.replaceAll(' ','_')))))).join(', ') %>
* DOI: [<%= it.DOI %>](https://doi.org/<%= it.DOI %>)
* Zotero: [Local Library](<%= it.backlink %>)
***
### Comment
comment:: 
***
### Annotations
<%~ include("annots", it.annotations) %>

The above template contains an 'info' panel, a comment panel and zotero annotations. In the 'info' panel, the * KeyWords: and * Collections: lines may need update after a while, e.x. new tags added to the Zotero item, the item being added to new collection, etc. One may add a short, descriptive comment after comment:: after a while, and maybe in other case a more extensive note, and do want to keep this part unchanged after 'Update Literature note'.

I've noticed that the zt-field.eta will always update the frontmatter of note (which is a surprise to me since it's not covered in doc yet), no matter how you twist the Note update setting. So perhaps a similar mechanism can be used to partial update the note content?

ycbrd commented 7 months ago

+1, also need this, many thanks!

"Bibnotes Formatter" plugin will not update a certain part of template between 2 user-defined strings. Perhaps Zotlit can also use this strategy, but it will only work in note content, where there's already an option "In-place update" (#233). To keep part of the frontmatter is more complicated, but also very useful especially for whom writes note in self-defined properties rather than key:: value as above.