Closed AustinRP closed 1 year ago
Hi @AustinRP,
Thanks for reaching out, I am glad to hear the plugin is useful to you!
That makes sense, I did not consider properties. The idea behind the marker is to be able to detect if a file has been generated by the plugin to avoid accidental modification of user files. However, I haven't actually implemented such a fail safe yet, so you are right, changing the marker position shouldn't break anything.
How about we make the marker available as part of the template (e.g. under data.marker
) so users can place them freely (e.g. after the property header or at the end of the file etc.). If one doesn't add the marker in the template, it gets automatically prepended as before. So something like this:
element.marker = this.getMarker(element)
let note = this.generateNote(element)
if (!note.includes(element.marker)) {
note = element.marker + '\n\n' + note
}
// getMarker needs to be updated to not include the '\n\n'
Would that work for you?
And sure, I am always open to PRs although given this is a minor thing I'd also be happy to do it, just let me know.
Thanks @frthjf for the detailed reply! This would work perfectly for me.
I can't work on this now, but I should have time over the next few weeks. If you get to it sooner than me, that would be great, but don't feel obliged. I'll let you know when I get started.
First off, great plugin! I spent some time browsing Obsidian/Zotero integrations and this one is my favorite, so thanks for creating it. :)
In this plugin's config, I coded a template that includes some Obsidian properties. However, Obsidian doesn't detect these properties because the generated file contains a "marker" (the zotero key) and a Zotero link at the top (the relevant piece of code from the plugin is here).
I think the simplest, non-breaking fix would be an optional setting to read/write the marker at the end of the note instead of the beginning. A more robust approach might be to include the marker as another file property, but then we'd need some way for the plugin user to create their own properties.
My availability is honestly shaky right now, but I'd be happy to work on this if you're open to pull requests!