Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions src/resume.typ
Original file line number Diff line number Diff line change
Expand Up @@ -129,37 +129,33 @@
}

// Converts datetime format into readable period.
#let period_worked(start-date, end-date) = {
#let period_worked(start-date, end-date, present-label: "Present") = {
// sanity checks
assert.eq(type(start-date), datetime)
assert(type(end-date) == datetime or type(end-date) == str)

if type(end-date) == str and end-date == "Present" {
end-date = datetime.today()
}
assert.eq(type(end-date), datetime)

return [
#start-date.display("[month repr:short] [year]") --
#if (
(end-date.month() == datetime.today().month()) and
(end-date.year() == datetime.today().year())
) [
Present
#present-label
] else [
#end-date.display("[month repr:short] [year]")
]
]
}

// Pretty self-explanatory.
#let work-heading(title, company, location, start-date, end-date, body) = {
#let work-heading(title, company, location, start-date, end-date, present-label: "Present", body) = {
// sanity checks
assert.eq(type(start-date), datetime)
assert(type(end-date) == datetime or type(end-date) == str)
assert.eq(type(end-date), datetime)

generic_2x2(
(1fr, 1fr),
[*#title*], [*#period_worked(start-date, end-date)*],
[*#title*], [*#period_worked(start-date, end-date, present-label: present-label)*],
[#company], emph(location)
)
v(-0.2em)
Expand Down Expand Up @@ -192,15 +188,15 @@
}

// Pretty self-explanatory.
#let education-heading(institution, location, degree, major, start-date, end-date, body) = {
#let education-heading(institution, location, degree, major, start-date, end-date, present-label: "Present", body) = {
// sanity checks
assert.eq(type(start-date), datetime)
assert(type(end-date) == datetime or type(end-date) == str)
assert.eq(type(end-date), datetime)

generic_2x2(
(70%, 30%),
[*#institution*], [*#location*],
[#degree, #major], period_worked(start-date, end-date)
[#degree, #major], period_worked(start-date, end-date, present-label: present-label)
)
v(-0.2em)
if body != [] {
Expand Down