Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KateNave opened this issue Sep 11, 2024 · 2 comments

Comments

@KateNave
Copy link

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
Copy link
Owner

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
Copy link
Author

Ah, that makes sense - thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants