resume/lib.typ

129 lines
3.0 KiB
Plaintext
Raw Normal View History

#import "fontawesome.typ": github, fa
#let DEFAULT_STRONG = 300;
#let SMALL_STRONG = 200;
2023-10-21 22:27:41 -04:00
#let TITLE_FONT = "Bitter"
#let HEADING_FONT = TITLE_FONT
#let BODY_FONT = "Open Sans"
#let BODY_FONT_SIZE = 10pt
#let HEADING_FONT_SIZE = 1em
#let TITLE_FONT_SIZE = 2em
#let HEADING_LINE_GAP = 3mm
#let BODY_LINE_HEIGHT = 0.85em
// rest = not top
#let PAGE_MARGINS = (rest: 0.5in, top: 0.4in)
// Format locations.
#let format_location(location) = {
[_#block(above: 0.7em, location)_]
}
#let indent(content) = {
2023-10-25 21:00:11 -04:00
block(inset: (left: 1em, right: 0.5em), content)
}
// General entry that is split into a left and right half (for experience and education).
#let cv_entry(left_content: none, right_content: none, details: none) = {
stack(
dir: ttb,
2023-10-21 22:36:52 -04:00
spacing: 0.9em,
2023-10-25 21:00:11 -04:00
grid(columns: (11fr, 6fr), column-gutter: 1cm, {
2023-10-21 22:36:52 -04:00
set strong(delta: DEFAULT_STRONG)
set align(left)
left_content
2023-10-25 21:00:11 -04:00
}, {
set strong(delta: SMALL_STRONG)
set align(right)
right_content
2023-10-25 21:00:11 -04:00
}),
{
set align(left)
set strong(delta: SMALL_STRONG)
details
},
)
}
// Entry for work.
2023-10-25 21:00:11 -04:00
#let work_entry(
role,
company,
tasks: none,
start_date: none,
end_date: none,
location: none,
) = {
let task_list = if tasks != none {
let list = []
for task in tasks {
list += [- #task]
}
list
} else {
none
}
2023-10-25 21:00:11 -04:00
cv_entry(left_content: {
text(1.1em)[*#role*] + "\n" + text[#emph[#company]]
}, right_content: {
[*#start_date -- #end_date*]
2023-10-25 21:00:11 -04:00
if location != none {
"\n" + format_location(location)
}
}, details: task_list)
}
#let project(title, repo_link, tools) = {
set strong(delta: DEFAULT_STRONG)
2023-10-25 21:00:11 -04:00
link(repo_link)[#text(1.1em)[*#title* #fa(github)]] + [ | _ #tools _ ]
}
// Set name and contact data and format headings
#let template(name, contact_data, color, doc) = {
2023-10-21 22:27:41 -04:00
set page(margin: PAGE_MARGINS, paper: "us-letter")
set list(indent: 1.25em, marker: [•])
2023-10-25 21:00:11 -04:00
set text(font: (BODY_FONT), BODY_FONT_SIZE)
2023-10-21 22:27:41 -04:00
set par(justify: true, leading: BODY_LINE_HEIGHT)
align(center)[
2023-10-21 22:27:41 -04:00
#text(size: TITLE_FONT_SIZE, font: TITLE_FONT, fill: color)[*#name*]
#block(above: 0em, below: 1em)
#{
if contact_data != none and contact_data.len() > 0 {
let elements = for el in contact_data {
2023-10-25 21:00:11 -04:00
(link(el.link)[#{ el.service + " " + el.display }],)
}
text(1.1em)[#elements.join(" | ")]
}
}
]
show heading.where(level: 1): i => {
set align(left + horizon)
let title = smallcaps(i.body)
2023-10-21 22:36:52 -04:00
let colored_line(header_text) = style(styles => {
2023-10-25 21:00:11 -04:00
let size = measure(header_text, styles)
2023-10-25 21:00:11 -04:00
// 100% - spacing - width of text
line(
length: 100% - HEADING_LINE_GAP - size.width,
stroke: (paint: color, thickness: 2pt, cap: "round"),
)
})
set block(above: 0.9em, below: 0.75em)
2023-10-25 21:00:11 -04:00
set text(size: 1em, fill: color, font: HEADING_FONT)
stack(
dir: ltr,
spacing: HEADING_LINE_GAP,
title,
box(height: 2pt, fill: color, colored_line(title)),
)
}
doc
}