mgmeyers / obsidian-zotero-integration

Insert and import citations, bibliographies, notes, and PDF annotations from Zotero into Obsidian.
GNU General Public License v3.0
1.09k stars 55 forks source link

{{annotations.length}} works in main template but not output path file name template #393

Open KateNave opened 2 months ago

KateNave commented 2 months ago

Hello,

I would like to only create literature notes for pdfs that do have some annotations, so ignoring those that are unannotated. To do this I'm attempting to use {% if annotations.length > 0%}... This works fine within the main template for the literature note, but for some reason in the template settings for the output path file name, including annotations.length creates an error. If I just get it to print {{annotations.length}} here, then it always prints 0, no matter how many annotations the file has.

I cannot figure out why this would work in the main template, but not the output path one and any advice on this would be really appreciated - thanks!

mgmeyers commented 2 months ago

Yeah, unfortunately annotations are not accessible to the output path templates. This is because the output path has to be computed before extracting annotations from PDFs. I'll have to think on this a bit to see if there's a good way to only create notes for items with annotations.

KateNave commented 2 months ago

Ah, that makes sense - thanks :)