Add subdued coloring for publications

This commit is contained in:
Marty Oehme 2023-06-27 18:02:01 +02:00
parent 5286d11052
commit 0433985cd6
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -8,17 +8,31 @@ def summary_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
return md return md
def _publication_md(publication: str, subdued: bool):
md = "> "
if subdued:
md += "\\textcolor{publication}{"
md += publication
if subdued:
md += "}"
return f"{md}\n\n"
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 = "",
subdued_publications: bool = True,
):
if "experience" not in data: if "experience" not in data:
return return
md = f"{headline}\n\n" md = f"{headline}\n\n"
md += "\\definecolor{publication}{rgb}{0.5,0.5,0.5}\n\n"
for exp in data["experience"]: for exp in data["experience"]:
md += f"## {exp['title'][lang]}\\hfill{exp['date'][lang]}\n\n" md += f"## {exp['title'][lang]}\\hfill{exp['date'][lang]}\n\n"
if "publication" in exp: if "publication" in exp:
md += f"> {exp['publication'][lang] or ''}\n\n" md += _publication_md(exp['publication'][lang], subdued_publications)
for point in exp["bullets"]: for point in exp["bullets"]:
md += f"* {point[lang]}\n" md += f"* {point[lang]}\n"