Add dynamic qualification content

This commit is contained in:
Marty Oehme 2023-06-22 18:03:59 +02:00
parent 14be4ea1ca
commit a1d41cc2ac
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
4 changed files with 57 additions and 2 deletions

View file

@ -71,3 +71,33 @@ education:
de: 2021 de: 2021
en: 2021 en: 2021
skills:
- de: Digitales Toolset
en: Digital toolset
content:
- name:
de: Versionskontrollsoftware
en: Version control software
items:
- de: git
en: git
- name:
de: Office-Suite
en: Office suite
items:
- de: Excel
en: Excel
- de: Word
en: Word
- de: Access
en: Access
- name:
de: Autorensoftware
en: Authoring software
items:
- de: LaTeX
en: LaTeX
- de: Pandoc
en: pandoc
- de: quarto
en: quarto

View file

@ -1,5 +1,6 @@
from typing import Any from typing import Any
def summary_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""): def summary_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
if "summary" not in data: if "summary" not in data:
return return
@ -7,6 +8,7 @@ def summary_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
return md return md
def experience_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""): def experience_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
if "experience" not in data: if "experience" not in data:
return return
@ -19,10 +21,11 @@ def experience_to_md(data: dict[str, Any], lang: str = "en", headline: str = "")
md += f"> {exp['publication'][lang]}\n\n" md += f"> {exp['publication'][lang]}\n\n"
for point in exp["bullets"]: for point in exp["bullets"]:
md+=f"* {point[lang]}\n" md += f"* {point[lang]}\n"
return md return md
def education_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""): def education_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
if "education" not in data: if "education" not in data:
return return
@ -30,7 +33,21 @@ def education_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
md = f"{headline}\n\n" md = f"{headline}\n\n"
for edu in data["education"]: for edu in data["education"]:
md += ( md += (
f"{edu['place'][lang]}\n\n: {edu['program'][lang]};{edu['date'][lang]}\n\n" f"{edu['place'][lang]}\n\n: {edu['program'][lang]}; {edu['date'][lang]}\n\n"
) )
return md return md
def qualifications_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
if "skills" not in data:
return
md = f"{headline}\n\n"
for skillset in data["skills"]:
md += f"{skillset[lang]}\n\n"
for content in skillset["content"]:
md += f": {content['name'][lang]} ({', '.join([item[lang] for item in content['items']])})\n"
md += "\n"
return md

View file

@ -32,3 +32,7 @@ display(Markdown(content.experience_to_md(data, headline="# Berufserfahrung", la
```{python} ```{python}
display(Markdown(content.education_to_md(data, headline="# Ausbildung", lang=lang))) display(Markdown(content.education_to_md(data, headline="# Ausbildung", lang=lang)))
``` ```
```{python}
display(Markdown(content.qualifications_to_md(data, headline="# Qualifikationen", lang=lang)))
```

View file

@ -30,3 +30,7 @@ display(Markdown(content.experience_to_md(data, headline="# Professional experie
```{python} ```{python}
display(Markdown(content.education_to_md(data, headline="# Education", lang=lang))) display(Markdown(content.education_to_md(data, headline="# Education", lang=lang)))
``` ```
```{python}
display(Markdown(content.qualifications_to_md(data, headline="# Qualifications", lang=lang)))
```