From d6270773c9308f2b9ba8752309b33434c499d2f0 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 27 Jun 2023 18:17:25 +0200 Subject: [PATCH] Add processing for thesis content into document --- processing/content.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/processing/content.py b/processing/content.py index 255c15d..0060b89 100644 --- a/processing/content.py +++ b/processing/content.py @@ -8,6 +8,7 @@ def summary_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""): return md + def _publication_md(publication: str, subdued: bool): md = "> " if subdued: @@ -17,6 +18,7 @@ def _publication_md(publication: str, subdued: bool): md += "}" return f"{md}\n\n" + def experience_to_md( data: dict[str, Any], lang: str = "en", @@ -32,7 +34,7 @@ def experience_to_md( md += f"## {exp['title'][lang]}\\hfill{exp['date'][lang]}\n\n" if "publication" in exp: - md += _publication_md(exp['publication'][lang], subdued_publications) + md += _publication_md(exp["publication"][lang], subdued_publications) for point in exp["bullets"]: md += f"* {point[lang]}\n" @@ -41,11 +43,26 @@ def experience_to_md( return md -def education_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""): +def thesis_to_md(data: dict[str, Any], lang: str = "en"): + md = "" + for thesis in data["thesis"]: + md += f"{thesis['type'][lang]}\n" + md += f": {thesis['title'][lang]}\n" + md += f": {thesis['abstract'][lang]}\n" + return f"{md}\n" + + +def education_to_md( + data: dict[str, Any], lang: str = "en", headline: str = "", thesis: bool = True +): if "education" not in data: return md = f"{headline}\n\n" + + if thesis and "thesis" in data: + md += thesis_to_md(data, lang) + for edu in data["education"]: md += ( f"{edu['place'][lang]}\n\n: {edu['program'][lang]}; {edu['date'][lang]}\n\n"