Compare commits

...

3 Commits

Author SHA1 Message Date
eggy
1dcb33ffc3 feat: test one-line 2023-10-23 23:42:00 -04:00
eggy
987f255a87 chore: refactor 2 2023-10-21 22:36:52 -04:00
eggy
19a5af8798 chore: refactor 2023-10-21 22:27:41 -04:00
2 changed files with 41 additions and 75 deletions

View File

@@ -1,14 +1,7 @@
#import "fontawesome.typ": fa, globe, github, linkedin, envelope #import "fontawesome.typ": fa, globe, github, linkedin, envelope
#import "lib.typ": template, education_entry, work_entry, project, indent, SMALL_STRONG, DEFAULT_STRONG #import "lib.typ": template, work_entry, project, indent, SMALL_STRONG, DEFAULT_STRONG
#set page(margin: 1.75in) // orange!!
#set par(leading: 0.5em, first-line-indent: 1.8em, justify: true)
#show par: set block(spacing: 0.55em)
#show heading: set block(above: 2em, below: 1em)
#set list(indent: 1em)
// Change the theme color of the cv.
#let color = rgb("#ff983e") #let color = rgb("#ff983e")
#let name = "Daniel Chen" #let name = "Daniel Chen"
@@ -39,11 +32,6 @@
// MAIN CONTENT STARTS here // MAIN CONTENT STARTS here
// TODO: make lines more impactful
// introduce some bolding (a lighter gray) to highlight things
// improve readability / ideally increase line height
// rn it looks like a wall of text
= Skills = Skills
#indent[ #indent[
@@ -120,10 +108,13 @@
= Education = Education
#indent[ #indent[
#education_entry( #work_entry(
"University of Waterloo", "B.A.Sc. in Computer Engineering", start_date: "Sep 2022", end_date: "Apr 2027 (expected)", [B.A.Sc. in Computer Engineering],
location: "Waterloo, ON", [University of Waterloo],
details: ( start_date: "Sep 2022", end_date: "Apr 2027 (expected)",
tasks: (
[Courses: Object-oriented programming, data structures & algorithms, digital computers & circuits], [Courses: Object-oriented programming, data structures & algorithms, digital computers & circuits],
)) ),
one_line_mode: true
)
] ]

87
lib.typ
View File

@@ -3,20 +3,19 @@
#let DEFAULT_STRONG = 300; #let DEFAULT_STRONG = 300;
#let SMALL_STRONG = 200; #let SMALL_STRONG = 200;
// Format start and end dates. #let TITLE_FONT = "Bitter"
#let format_date(start_date: none, end_date: none) = { #let HEADING_FONT = TITLE_FONT
let date = { #let BODY_FONT = "Open Sans"
if end_date == none {
start_date
} else if start_date == none {
end_date
} else {
[#start_date -- #end_date]
}
}
[*#date*] #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. // Format locations.
#let format_location(location) = { #let format_location(location) = {
@@ -34,11 +33,12 @@
#let cv_entry(left_content: none, right_content: none, details: none) = { #let cv_entry(left_content: none, right_content: none, details: none) = {
stack( stack(
dir: ttb, dir: ttb,
spacing: 0.75em, spacing: 0.9em,
grid( grid(
columns: (11fr, 6fr), columns: (11fr, 6fr),
column-gutter: 1cm, column-gutter: 1cm,
{ {
set strong(delta: DEFAULT_STRONG)
set align(left) set align(left)
left_content left_content
}, },
@@ -56,35 +56,8 @@
) )
} }
// Entry for education.
#let education_entry(university, degree, start_date: none, end_date: none, location: none, details: none) = {
let details_list = if details != none {
let list = []
for detail in details {
list += [- #detail]
}
list
} else {
none
}
cv_entry(
left_content: {
set strong(delta: DEFAULT_STRONG)
text(1.2em)[*#university*] + "\n" + emph[#degree]
},
right_content: {
format_date(start_date: start_date, end_date: end_date)
if location != none {
"\n" + format_location(location)
}
},
details: details_list
)
}
// Entry for work. // Entry for work.
#let work_entry(role, company, tasks: none, start_date: none, end_date: none, location: none) = { #let work_entry(role, company, tasks: none, start_date: none, end_date: none, location: none, one_line_mode: false) = {
let task_list = if tasks != none { let task_list = if tasks != none {
let list = [] let list = []
for task in tasks { for task in tasks {
@@ -96,10 +69,17 @@
} }
cv_entry( cv_entry(
left_content: { left_content: {
text(1.1em)[*#role*] + "\n" + text[#emph[#company]]
if one_line_mode {
text(1.1em)[*#role*, #company]
} else {
text(1.1em)[*#role*]
"\n"
text[#emph[#company]]
}
}, },
right_content: { right_content: {
format_date(start_date: start_date, end_date: end_date) [*#start_date -- #end_date*]
if location != none { if location != none {
"\n" + format_location(location) "\n" + format_location(location)
@@ -116,15 +96,12 @@
// Set name and contact data and format headings // Set name and contact data and format headings
#let template(name, contact_data, color, doc) = { #let template(name, contact_data, color, doc) = {
let TITLE_FONT = "Bitter" set page(margin: PAGE_MARGINS, paper: "us-letter")
let HEADING_FONT = "Bitter"
let BODY_FONT = "Open Sans"
set page(margin: (rest: 0.5in, top: 0.4in), paper: "us-letter")
set list(indent: 1.25em, marker: []) set list(indent: 1.25em, marker: [])
set text(font: (BODY_FONT), 10pt) set text(font: (BODY_FONT), BODY_FONT_SIZE)
set par(justify: true, leading: 0.85em) set par(justify: true, leading: BODY_LINE_HEIGHT)
align(center)[ align(center)[
#text(size: 2em, font: TITLE_FONT, fill: color)[*#name*] #text(size: TITLE_FONT_SIZE, font: TITLE_FONT, fill: color)[*#name*]
#block(above: 0em, below: 1em) #block(above: 0em, below: 1em)
#{ #{
if contact_data != none and contact_data.len() > 0 { if contact_data != none and contact_data.len() > 0 {
@@ -139,20 +116,19 @@
show heading.where(level: 1): i => { show heading.where(level: 1): i => {
set align(left + horizon) set align(left + horizon)
let title = smallcaps(i.body) let title = smallcaps(i.body)
let colored_line(header_text) = style(styles => { let colored_line(header_text) = style(styles => {
let size = measure(header_text, styles) let size = measure(header_text, styles)
// 100% - spacing - width of text // 100% - spacing - width of text
line(length: 100% - 3mm - size.width, stroke: (paint: color, thickness: 2pt, cap: "round")) line(length: 100% - HEADING_LINE_GAP - size.width, stroke: (paint: color, thickness: 2pt, cap: "round"))
}) })
// add line to right of heading
set block(above: 0.9em, below: 0.75em) set block(above: 0.9em, below: 0.75em)
set text(size: 1em, fill: color, font: HEADING_FONT) set text(size: 1em, fill: color, font: HEADING_FONT)
stack( stack(
dir: ltr, dir: ltr,
spacing: 3mm, spacing: HEADING_LINE_GAP,
title, title,
box( box(
height: 2pt, height: 2pt,
@@ -162,6 +138,5 @@
) )
} }
doc doc
} }