I have found some time to look into this. Actually, I remembered a demo vault of the author was downloaded months ago on my iPad and the zip file was left unopened ever since.
So you wanted to take it a step further hoping that Properties would add extra functionality or spruce it up more, but I am still stuck at first base on this.
I took an arbitrary piece of paper, annotated it complete with tags (following some of those used by the author on purpose), added various colors to try the callouts for the fun of it, and then ended up not getting the tags with my annotations.
I thought you also could not start the manual Templater way of sorting – which would lead to Auto Note Mover kicking in and moving the files to designated folders for further processing – because of the same problem – unless I have my tags in Obsidian with each bit of text (annotation), I can’t make that work.
But then I remembered your tags were not annotation tags local/specific to each annotation but globally administered outside of the PDF viewer/editor.
Which means the above cited part dealing with tags (which did not do anything for me as I did not have global tags set for the ad hoc document I started annotating for the sake of testing all this), being outside of the scope of the ‘persist loop’ is not responsible for doing anything I want.
But if you go about the way the the author explains it, it works: select the text, run the extract research note from selection
template on the selection, it will cut it into a file the user names and the template will copy the header, meaning that the global tags will be copied over, which when meeting the criteria set by Auto Note Mover, will set off moving the newly created chunk of file.
So what you don’t like is that these tags are inline, rather than nicely nested in the YAML or Properties section, right?
Then delete the section which would produce the inline tags (the part we talked about above) and replace the YAML with this:
---
cssclasses: research-note
type: "{{itemType}}"{% for type, creators in creators | groupby("creatorType") -%}{% if loop.first %}
{% endif %}{{type | replace("interviewee", "author") | replace("director", "author") | replace("presenter", "author") | replace("podcaster", "author") | replace("programmer", "author") | replace("cartographer", "author") | replace("inventor", "author") | replace("sponsor", "author") | replace("performer", "author") | replace("artist", "author")}}: "{%- for creator in creators -%}{%- if creator.name %}{{creator.name}}{%- else %}{{creator.lastName}}, {{creator.firstName}}{%- endif %}{% if not loop.last %}; {% endif %}{% endfor %}"{% if not loop.last %}
{% endif %}{%- endfor %}{% if title %}
title: "{{title}}"{% endif %}{% if publicationTitle %}
publication: "{{publicationTitle}}"{% endif %}{% if date %}
date: {{date | format("YYYY-MM-DD")}}{% endif %}{% if archive %}
archive: "{{archive}}"{% endif %}{% if archiveLocation %}
archive-location: "{{archiveLocation}}"{% endif %}
citekey: {{citekey}}
tags: {% if tags.length > 0 -%} {%- for t in tags -%} {%- set replaced_tag = t.tag %} {%- if t.tag == "secondary" %} {%- set replaced_tag = "source/secondary" %} {%- elif t.tag == "primary" %} {%- set replaced_tag = "source/primary" %} {%- elif "-project" in t.tag %} {%- set replaced_tag = "project/" ~ t.tag | lower | replace(" ", "-") | replace("-project", "") %} {%- else %} {%- set replaced_tag = "subject/" ~ t.tag | lower | replace(" ", "-") %} {%- endif %} {{ "\n - " ~ replaced_tag }} {%- endfor %} {%- endif %}
---
- I tested it with various files, with 2-4 tags and does the conversion the original author sought to conduct.
The tags line ('triple-click` it in Obsidian to select it) can be shifted into any line; it doesn’t have to be last in YAML.
Now for the version that handles annotation tags as well…
I found some that do here, but they are not as clean as this template. Otherwise a reaaly good thread for inspiration and all kinds of template hexenküch-ing.