Need help with creating a template

What I’m trying to do

I am a PhD student looking to create a literature matrix for my literature review . Here is a detailed account of what I am trying to achieve:

  1. I have annotated pdfs in Zotero. Each annotated text has a highlight of the same colour [yellow] and also has a tag I think is relevant . For example :

Caspases, also known as Cysteine ASPartyl proteASES, are a vital family of protease enzymes integral to various cellular processes, with a prominent function in apoptosis [13,14]

I have highlighted this text with yellow and kept the tag as #caspases and # apoptosis.

  1. I want to import all the pdfs and their annotation with tags and comments as new note in Obsidian.
    Example: Highlighted text with highlight colour, page number , tags and comments and images if annotated.

  2. I want to link the secondary source of that annotated text in my note , preferably directly from Zotero and reference section of that paper , or Obsidian .
    Example : [13,14] = [Green 2022; McArthur 2018]

  3. I am trying to synthesise information based on topics . So I want all annotated texts for each tag separately.

Example : for # caspases- I want a new note, and all annotated text that has #caspases tag should be in this note. Similarly for other tags such as # OxS, # apoptosis etc.

This note should also contain the highlighted colour and page number , with secondary citations, so that I know where the primary paper sourced that text from.

Similarly, If I have tagged images as well, I want the images also in this same note .
This will allow me to see what different papers and sources mention regarding that particular topic.

  1. If possible, I would like to just highlight different themes with different colour without putting tags in Zotero , and I would like tags to be automatically assigned to the annotated text based on highlight colour.

And then go back to step 4.

Example : if I have identified certain text that talk about caspases on 5 different papers, I will highlight those texts in orange colour.

When I import that paper in Obsidian , I want to automatically tag all text with orange colour as #caspases. Then go to step 4.

Things I have tried

1)I have created a base template with title, authors, keywords and citation .
2) I can also import annotated text with highlight colour and page number.
3) I can also import images if taken.

This is my template code-

---
title: "{{title}}"
year: '{{date | format("YYYY")}}'
authors: "{{authors}}"
citation: "{{bibliography}}"
---
---

📖   pdf                {{pdfZoteroLink}}

🏷️   tags              {{hashTags}}

🗝️  citekey          {{citekey}}

---

{% for annotation in annotations -%}
{%- if annotation.annotatedText -%}  
{% if annotation.color %}  
<mark class="hltr-{{annotation.colorCategory | lower}}">
"{{annotation.annotatedText | safe}}"</mark>  
{% else %}  
{{annotation.type | capitalize}}  
{% endif %}  
{%- endif %}  

📖 **Page:** [Page {{annotation.pageLabel}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}})  

{%- if annotation.imageRelativePath %}  
![[{{annotation.imageRelativePath}}]]  
{%- endif %}  

{% if annotation.comment %}  
### 🗨 Comment:  
{{annotation.comment | safe}}  
{% endif %}  

{% if annotation.allTags %}  
🏷 **Tags:** {{annotation.allTags}}  
{% endif %}  
{% endfor %}

And output-

I am stuck after this . Any help would be greatly appreciated.

Thank you .