Hey everyone, trying to create a template to build a CV and im now coming to a roadblock and I can't figure out what the issue is. I have a add_skills function which fills a state dict with topics and individual skills.
Somehow, some topics (after calling add_skills multiple times with different array of "learned_skills") are getting lost.
Example of a learned_skill array:
learned_skills: (
(
"category": (
"de": "Cybersecurity",
"en": "Cybersecurity"
),
"values": (
"de": ("Penetration Testing", "Reverse Engineering", "Web Security", "Cryptography", "Forensics", "Binary Exploitation"),
"en": ("Penetration Testing", "Reverse Engineering", "Web Security", "Cryptography", "Forensics", "Binary Exploitation")
)
),
)
I would add this to the state with add_skills(dict.learned_skills) where dict is the individual "experience". From testing i can see that the array is being loaded in correctly. However in this case, after "adding" the following the topics "Technologies" and "Programming-/Scripting-Languages" do not make it to the final render function
learned_skills: (
(
"category": (
"de": "Programmier-/Skripting-Sprachen",
"en": "Programming/Scripting Languages"
),
"values": (
"de": ("Python", "C", "C++", "Java", "JavaScript", "Bash", "HTML/CSS", "LaTeX"),
"en": ("Python", "C", "C++", "Java", "JavaScript", "Bash", "HTML/CSS", "LaTeX")
),
),
(
"category": (
"de": "Technologien",
"en": "Technologies"
),
"values": (
"de": ("Docker", "Git", "SQL", "Excel", "Word", "Powerpoint", "Qiskit", "Ghidra", "Tigress"),
"en": ("Docker", "Git", "SQL", "Excel", "Word", "Powerpoint", "Qiskit", "Ghidra", "Tigress"),
)
),
(
"category": (
"de": "Management",
"en": "Management"
),
"values": (
"de": ("Risikomanagement", "Qualitätsmanagement", "Projektmanagement"),
"en": ("Risk Management", "Quality Management", "Project Management")
)
),
(
"category": (
"de": "Betriebssysteme",
"en": "Operating Systems"
),
"values": (
"de": ("Windows", "BSD (FreeBSD, OpenBSD)", "Debian-basierte Linux"),
"en": ("Windows", "BSD (FreeBSD, OpenBSD)", "Debian-based Linux")
)
)
)
#let add_skills(array) = {
context{
for category in array {
let values = category.at("values").at(text.lang, default: ())
let topic = category.at("category").at(text.lang)
let skills = skills_state.get()
let dict_items = values
let existing_items = skills.at(topic, default: ())
existing_items.push(dict_items)
existing_items = existing_items.flatten()
let new_items = existing_items.dedup()
skills.insert(topic, new_items)
skills_state.update(skills)
}
}
}
My render function looks as follows:
#let render-skills() ={
context{
let skills = skills_state.get()
if(skills != none and skills != () and skills != "" and skills != "none") {
let topics = skills.keys()
topics = topics.sorted() // Sort topics alphabetically
for topic in topics {
if(topic != "PLACEHOLDER") [
#let skills_items = skills.at(topic)
- *#topic:* #skills_items.join(", ") \
]
}
}
}
}
And the function to render a specific section of the CV would look like this: