ref(resume): Extract column creation from resume func

Extracted into their own functions called 'create_main' and
'create_sidebar' for now.
This commit is contained in:
Marty Oehme 2025-03-18 14:57:57 +01:00
parent f404bf3c55
commit 2970745b7d
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -1,39 +1,6 @@
#import "lib.typ": *
#let resume(contents, main: ("experience_by_type", "education"), sidebar: ("volunteering", "languages", "skills")) = {
show: style
set text(lang: lang)
let date_formatting = {
if lang == "de" {
"[day]. [month repr:long] [year]"
} else {
"[month repr:long] [day], [year]"
}
}
set page(
paper: "a4",
margin: (x: 0.9cm, y: 1.3cm),
footer: [
#set text(
fill: luma(200),
size: 8pt,
)
#_columns_3[
#smallcaps[#datetime.today().display(date_formatting)]
][
#smallcaps[#contents.about.fullname]
][
#context counter(page).display()
]
],
)
set par(justify: true)
header(contents.about)
let body = {
#let create_body(main: (), contents: (:)) = {
for item in main {
if item == "summary" and "summary" in contents {
section(
@ -89,9 +56,9 @@
)
}
}
}
}
let sidebar = {
#let create_sidebar(sidebar: (), contents: (:)) = {
for item in sidebar {
if item == "volunteering" and "volunteering" in contents {
let title = (en: "Volunteer Work", de: "Ehrenamt").at(lang)
@ -117,7 +84,41 @@
sidebar_entry(item: contents.skills, is_sidebar: true)
}
}
}
#let resume(contents, main: ( "experience", "education"), sidebar: ("volunteering", "languages", "skills")) = {
show: style
set text(lang: lang)
let date_formatting = {
if lang == "de" {
"[day]. [month repr:long] [year]"
} else {
"[month repr:long] [day], [year]"
}
}
set page(
paper: "a4",
margin: (x: 0.9cm, y: 1.3cm),
footer: [
#set text(
fill: luma(200),
size: 8pt,
)
#_columns_3[
#smallcaps[#datetime.today().display(date_formatting)]
][
#smallcaps[#contents.about.fullname]
][
#context counter(page).display()
]
],
)
set par(justify: true)
header(contents.about)
let margin = 1pt
grid(
@ -143,7 +144,7 @@
),
)
})
body
create_body(main: main, contents: contents)
},
),
align(
@ -160,7 +161,7 @@
set par(justify: false)
align(right, block(it))
}
sidebar
create_sidebar(sidebar: sidebar, contents: contents)
v(15pt)
},
),