Format with typstyle

This commit is contained in:
Marty Oehme 2025-01-28 21:30:12 +01:00
parent 64dffb43d6
commit 18df7051e7
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 491 additions and 439 deletions

80
cv.typ
View file

@ -40,19 +40,21 @@
}
#let header(about, columns: (1.5fr, 1fr, 1fr)) = {
[= #about.fullname];
let contact_fields = (for c in about.contact {
[= #about.fullname]
let contact_fields = (
for c in about.contact {
if "link" in c {
([#c.icon ~ #link(c.link)[#c.text]],)
} else {
([#c.icon ~ #c.text],)
}
})
}
)
grid(
columns: columns,
gutter: 5pt,
..contact_fields
);
)
}
#let subdued(body) = {
@ -80,18 +82,25 @@
}
if "publication" in item {
subdued[#item.publication.at(lang) \ ]
};
}
if "abstract" in item {
subdued[#item.abstract.at(lang) \ ]
}
}
#let horizon_line() = {v(-3pt); line(length: 100%); v(-5pt)}
#let horizon_line() = {
v(-3pt)
line(length: 100%)
v(-5pt)
}
#let section_header(title) = {[== #title]; horizon_line()};
#let section_header(title) = {
[== #title]
horizon_line()
};
#let section(title: "Section", entries: (), body) = {
section_header(title);
section_header(title)
if body == none or body == [] {
for e in entries {
entry(item: e)
@ -103,15 +112,18 @@
// Slightly re-styled entry with PLACE first and TITLE second
#let education_entry(item: ()) = {
assert("place" in item and "title" in item and "date" in item, message: "Education items require place, program and date.");
[*#item.place.at(lang)*, #item.title.at(lang) #h(1fr)];
[ _#item.date.at(lang)_ \ ];
assert(
"place" in item and "title" in item and "date" in item,
message: "Education items require place, program and date.",
)
[*#item.place.at(lang)*, #item.title.at(lang) #h(1fr)]
[ _#item.date.at(lang)_ \ ]
}
// Restyled entry with PLACE not emphasized like usual, and no date but an abstract
#let thesis_entry(item: ()) = {
assert("title" in item and "place" in item, message: "Thesis items require type and title.");
[*#item.title.at(lang)* #item.place.at(lang) #h(1fr)];
assert("title" in item and "place" in item, message: "Thesis items require type and title.")
[*#item.title.at(lang)* #item.place.at(lang) #h(1fr)]
[#par(item.abstract.at(lang))]
}
@ -167,10 +179,13 @@
let body = {
if "summary" in contents {
section(title:"", {
section(
title: "",
{
contents.summary.at(lang)
})
};
},
)
}
if "experience" in contents {
let title = sel_word_lang(en: "Professional Experience", de: "Berufserfahrung")
@ -190,16 +205,22 @@
if "skills" in contents {
let title = sel_word_lang(en: "Qualifications", de: "Qualifikationen")
section(title: title, {
section(
title: title,
{
skill_item(item: contents.skills)
})
},
)
}
if "languages" in contents {
let title = sel_word_lang(en: "Languages", de: "Sprachen")
section(title: title, {
section(
title: title,
{
skill_item(item: contents.languages)
})
},
)
}
}
}
@ -237,7 +258,12 @@
let margin = 1pt
grid(
columns: (2fr, 1fr),
block(outset: 0pt, inset: (top: 0.4 * margin, right: 0pt, rest: margin), stroke: none, width: 100%, {
block(
outset: 0pt,
inset: (top: 0.4 * margin, right: 0pt, rest: margin),
stroke: none,
width: 100%,
{
set block(above: 10pt)
show heading.where(level: 1): it => style(s => {
let h = text(size: 18pt, upper(it))
@ -249,12 +275,13 @@
dy: 7pt,
dx: 10pt,
horizon + left,
line(stroke: accent-color, length: 100% - dim.width - 10pt)
line(stroke: accent-color, length: 100% - dim.width - 10pt),
),
)
})
body
}),
},
),
{
v(20pt)
set block(inset: (left: 20 * margin, right: 20 * margin))
@ -265,12 +292,9 @@
align(right, block(it))
}
sidebar
}
},
)
}
#cv.with(use_sidebar: false)(
yaml("content.yml")
)
#cv.with(use_sidebar: false)(yaml("content.yml"))

View file

@ -40,19 +40,21 @@
}
#let header(about, columns: (1.5fr, 1fr, 1fr)) = {
[= #about.fullname];
let contact_fields = (for c in about.contact {
[= #about.fullname]
let contact_fields = (
for c in about.contact {
if "link" in c {
([#c.icon ~ #link(c.link)[#c.text]],)
} else {
([#c.icon ~ #c.text],)
}
})
}
)
grid(
columns: columns,
gutter: 5pt,
..contact_fields
);
)
}
#let subdued(body) = {
@ -66,7 +68,6 @@
let client = item.place.at(lang)
if client not in by_client {
by_client.insert(client, ())
}
by_client.at(client).push((item.title.at(lang), item.date.at(lang)))
}
@ -82,15 +83,14 @@
#let by_experience_type(type: (), experience: ()) = {
let by_ty = (:)
for (id, desc) in type {
let matching_exp_items = ();
let matching_exp_items = ()
// for item in experience {
// [itemtypeid: #item.typeid, id: #id]
// if item.typeid == id {
// matching_exp_items.push(item)
// }
// }
let matching_exp_items = experience.filter(item =>
int(item.typeid) == int(id))
let matching_exp_items = experience.filter(item => int(item.typeid) == int(id))
[=== _#desc.at(lang)_]
by_client(experience: matching_exp_items)
}
@ -117,18 +117,25 @@
}
if "publication" in item {
subdued[#item.publication.at(lang) \ ]
};
}
if "abstract" in item {
subdued[#item.abstract.at(lang) \ ]
}
}
#let horizon_line() = {v(-3pt); line(length: 100%); v(-5pt)}
#let horizon_line() = {
v(-3pt)
line(length: 100%)
v(-5pt)
}
#let section_header(title) = {[== #title]; horizon_line()};
#let section_header(title) = {
[== #title]
horizon_line()
};
#let section(title: "Section", entries: (), body) = {
section_header(title);
section_header(title)
if body == none or body == [] {
for e in entries {
entry(item: e)
@ -140,15 +147,18 @@
// Slightly re-styled entry with PLACE first and TITLE second
#let education_entry(item: ()) = {
assert("place" in item and "title" in item and "date" in item, message: "Education items require place, program and date.");
[*#item.place.at(lang)*, #item.title.at(lang) #h(1fr)];
[ _#item.date.at(lang)_ \ ];
assert(
"place" in item and "title" in item and "date" in item,
message: "Education items require place, program and date.",
)
[*#item.place.at(lang)*, #item.title.at(lang) #h(1fr)]
[ _#item.date.at(lang)_ \ ]
}
// Restyled entry with PLACE not emphasized like usual, and no date but an abstract
#let thesis_entry(item: ()) = {
assert("title" in item and "place" in item, message: "Thesis items require type and title.");
[*#item.title.at(lang)* #item.place.at(lang) #h(1fr)];
assert("title" in item and "place" in item, message: "Thesis items require type and title.")
[*#item.title.at(lang)* #item.place.at(lang) #h(1fr)]
[#par(item.abstract.at(lang))]
}
@ -204,9 +214,12 @@
let body = {
if "summary" in main and "summary" in contents {
section(title:"", {
section(
title: "",
{
contents.summary.at(lang)
})
},
)
}
if "experience" in main and "experience" in contents {
@ -227,16 +240,22 @@
if "skills" in main and "skills" in contents {
let title = sel_word_lang(en: "Qualifications", de: "Qualifikationen")
section(title: title, {
section(
title: title,
{
skill_item(item: contents.skills)
})
},
)
}
if "languages" in main and "languages" in contents {
let title = sel_word_lang(en: "Languages", de: "Sprachen")
section(title: title, {
section(
title: title,
{
skill_item(item: contents.languages)
})
},
)
}
}
@ -269,7 +288,12 @@
let margin = 1pt
grid(
columns: (2fr, 1fr),
block(outset: 0pt, inset: (top: 0.4 * margin, right: 0pt, rest: margin), stroke: none, width: 100%, {
block(
outset: 0pt,
inset: (top: 0.4 * margin, right: 0pt, rest: margin),
stroke: none,
width: 100%,
{
set block(above: 10pt)
show heading.where(level: 1): it => style(s => {
let h = text(size: 18pt, upper(it))
@ -281,13 +305,18 @@
dy: 7pt,
dx: 10pt,
horizon + left,
line(stroke: accent-color, length: 100% - dim.width - 10pt)
line(stroke: accent-color, length: 100% - dim.width - 10pt),
),
)
})
body
}),
align(right, block(fill: luma(250), width: 90%,
},
),
align(
right,
block(
fill: luma(250),
width: 90%,
{
v(15pt)
set block(inset: (left: 20 * margin, right: 20 * margin))
@ -299,11 +328,10 @@
}
sidebar
v(15pt)
}))
},
),
),
)
}
#resume(
yaml("content.yml")
)
#resume(yaml("content.yml"))