resume/lib.typ
2023-10-24 11:42:42 -04:00

138 lines
3.0 KiB
Plaintext

#import "fontawesome.typ": github, fa
#let DEFAULT_STRONG = 300;
#let SMALL_STRONG = 200;
#let TITLE_FONT = "Calibri"
#let HEADING_FONT = TITLE_FONT
#let BODY_FONT = "Calibri"
#let BODY_FONT_SIZE = 11pt
#let HEADING_FONT_SIZE = 1.1em
#let TITLE_FONT_SIZE = 1.9em
#let HEADING_LINE_GAP = 1.2mm
#let BODY_LINE_HEIGHT = 0.6em
// rest = not top
#let PAGE_MARGINS = (rest: 0.35in, top: 0.3in, bottom: 0.3in)
#let indent(content) = {
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,
spacing: 0.6em,
grid(
columns: (13fr, 3fr),
column-gutter: 0.5cm,
{
set strong(delta: DEFAULT_STRONG)
set align(left)
left_content
},
{
set strong(delta: SMALL_STRONG)
set align(right)
right_content
}
),
{
set align(left)
set strong(delta: SMALL_STRONG)
details
}
)
}
// Entry for work.
#let work_entry(role, company, tasks: none, start_date: none, end_date: none, location: none, one_line: true) = {
let task_list = if tasks != none {
let list = []
for task in tasks {
list += [- #task]
}
list
} else {
none
}
cv_entry(
left_content: {
text(1em)[*#role*, ]
text[#emph[#company]]
if location != none {
text[_, #location _]
}
},
right_content: {
[*#start_date -- #end_date*]
},
details: task_list
)
}
#let project(title, repo_link, tools) = {
set strong(delta: DEFAULT_STRONG)
link(repo_link)[#text(1em)[*#title* #fa(github)]] + [ | _ #tools _]
}
// Set name and contact data and format headings
#let template(name, contact_data, color, doc) = {
set page(margin: PAGE_MARGINS, paper: "us-letter")
set list(indent: 1.25em, marker: [•])
set text(font: (BODY_FONT), BODY_FONT_SIZE)
set par(justify: true, leading: BODY_LINE_HEIGHT)
let header = {
align(center)[
#text(size: TITLE_FONT_SIZE, font: TITLE_FONT)[*#name*]
#block(above: 0em, below: 0.6em)
#set text(fill: rgb("#444"))
#{
if contact_data != none and contact_data.len() > 0 {
let elements = for el in contact_data {
(link(el.link)[#{el.service + " " + el.display}],)
}
// we love hacks
elements.slice(0, 2).join(" | ")
"\n"
elements.slice(2).join(" | ")
}
}
#v(3pt)
]
}
show heading.where(level: 1): i => {
set align(left + horizon)
let title = upper(i.body)
set block(above: 1em, below: 0.75em)
set text(size: BODY_FONT_SIZE, fill: color, font: HEADING_FONT)
stack(
dir: ttb,
spacing: HEADING_LINE_GAP,
title,
line(length: 100%, stroke: (paint: color, thickness: 0.5pt))
)
}
block(
stroke: (paint: color, thickness: 3pt),
inset: 1.5em,
{
header
doc
}
)
}