fix: minor issues with accent color, switch to kebab-case

Fixed minor issue with accent color and switch (fully) to using kebab case.

Fixes #17
Fixes #19
This commit is contained in:
Paul T
2024-04-05 20:41:04 -04:00
committed by Paul T
parent 9654d6ef7c
commit d2482e1198

74
lib.typ
View File

@@ -54,23 +54,22 @@
/// Show a link with an icon, specifically for Github projects /// Show a link with an icon, specifically for Github projects
/// *Example* /// *Example*
/// #example(`resume.github-link("DeveloperPaul123/awesome-resume")`) /// #example(`resume.github-link("DeveloperPaul123/awesome-resume")`)
/// - github_path (string): The path to the Github project (e.g. "DeveloperPaul123/awesome-resume") /// - github-path (string): The path to the Github project (e.g. "DeveloperPaul123/awesome-resume")
/// -> none /// -> none
#let github-link(github_path) = { #let github-link(github-path) = {
set box(height: 11pt) set box(height: 11pt)
align(right + horizon)[ align(right + horizon)[
#fa-icon("github", fa-set: "Brands", fill: color-darkgray) #link( #fa-icon("github", fa-set: "Brands", fill: color-darkgray) #link(
"https://github.com/" + github_path, "https://github.com/" + github-path,
github_path, github-path,
) )
] ]
} }
/// Right section for the justified headers /// Right section for the justified headers
/// - body (content): The body of the right header /// - body (content): The body of the right header
/// - accent_color (color): The accent color to color the text with. This defaults to the default-accent-color #let secondary-right-header(body) = {
#let secondary-right-header(body, accent_color: default-accent-color) = {
set text( set text(
size: 11pt, size: 11pt,
weight: "medium", weight: "medium",
@@ -125,17 +124,21 @@
/// ///
/// - author (content): Structure that takes in all the author's information /// - author (content): Structure that takes in all the author's information
/// - date (string): The date the resume was created /// - date (string): The date the resume was created
/// - accent_color (color): The accent color of the resume /// - accent-color (color): The accent color of the resume
/// - colored_headers (boolean): Whether the headers should be colored or not /// - colored-headers (boolean): Whether the headers should be colored or not
/// - body (content): The body of the resume /// - body (content): The body of the resume
/// -> none /// -> none
#let resume( #let resume(
author: (:), author: (:),
date: datetime.today().display("[month repr:long] [day], [year]"), date: datetime.today().display("[month repr:long] [day], [year]"),
accent_color: default-accent-color, accent-color: default-accent-color,
colored_headers: true, colored-headers: true,
body, body,
) = { ) = {
if type(accent-color) == "string" {
accent-color = rgb(accent-color)
}
set document( set document(
author: author.firstname + " " + author.lastname, author: author.firstname + " " + author.lastname,
title: "resume", title: "resume",
@@ -196,8 +199,8 @@
) )
#align(left)[ #align(left)[
#let color = if colored_headers { #let color = if colored-headers {
accent_color accent-color
} else { } else {
color-darkgray color-darkgray
} }
@@ -233,7 +236,7 @@
style: "normal", style: "normal",
font: ("Roboto"), font: ("Roboto"),
) )
#text(accent_color, weight: "thin")[#author.firstname] #text(fill: accent-color, weight: "thin")[#author.firstname]
#text(weight: "bold")[#author.lastname] #text(weight: "bold")[#author.lastname]
] ]
] ]
@@ -242,7 +245,7 @@
let positions = { let positions = {
set text( set text(
accent_color, accent-color,
size: 9pt, size: 9pt,
weight: "regular", weight: "regular",
) )
@@ -327,6 +330,7 @@
location: "", location: "",
date: "", date: "",
description: "", description: "",
accent-color: default-accent-color,
) = { ) = {
pad[ pad[
#justified-header(title, location) #justified-header(title, location)
@@ -389,17 +393,21 @@
/// Cover letter template that is inspired by the Awesome CV Latex template by posquit0. This template can loosely be considered a port of the original Latex template. /// Cover letter template that is inspired by the Awesome CV Latex template by posquit0. This template can loosely be considered a port of the original Latex template.
/// This coverletter template is designed to be used with the resume template. /// This coverletter template is designed to be used with the resume template.
/// - author (content): Structure that takes in all the author's information /// - author (content): Structure that takes in all the author's information
/// - profile_picture (image): The profile picture of the author. This will be cropped to a circle and should be square in nature. /// - profile-picture (image): The profile picture of the author. This will be cropped to a circle and should be square in nature.
/// - date (date): The date the cover letter was created /// - date (date): The date the cover letter was created
/// - accent_color (color): The accent color of the cover letter /// - accent-color (color): The accent color of the cover letter
/// - body (content): The body of the cover letter /// - body (content): The body of the cover letter
#let coverletter( #let coverletter(
author: (:), author: (:),
profile_picture: image, profile-picture: image,
date: datetime.today().display("[month repr:long] [day], [year]"), date: datetime.today().display("[month repr:long] [day], [year]"),
accent_color: default-accent-color, accent-color: default-accent-color,
body, body,
) = { ) = {
if type(accent-color) == "string" {
accent-color = rgb(accent-color)
}
set document( set document(
author: author.firstname + " " + author.lastname, author: author.firstname + " " + author.lastname,
title: "resume", title: "resume",
@@ -460,7 +468,7 @@
) )
#align(left)[ #align(left)[
#text[#strong[#text(accent_color)[#it.body.text]]] #text[#strong[#text(accent-color)[#it.body.text]]]
#box(width: 1fr, line(length: 100%)) #box(width: 1fr, line(length: 100%))
] ]
] ]
@@ -474,7 +482,7 @@
style: "normal", style: "normal",
font: ("Roboto"), font: ("Roboto"),
) )
#text(accent_color, weight: "thin")[#author.firstname] #text(accent-color, weight: "thin")[#author.firstname]
#text(weight: "bold")[#author.lastname] #text(weight: "bold")[#author.lastname]
] ]
] ]
@@ -483,7 +491,7 @@
let positions = { let positions = {
set text( set text(
accent_color, accent-color,
size: 9pt, size: 9pt,
weight: "regular", weight: "regular",
) )
@@ -553,7 +561,7 @@
radius: 2cm, radius: 2cm,
width: 4cm, width: 4cm,
height: 4cm, height: 4cm,
profile_picture, profile-picture,
) )
], ],
[ [
@@ -565,7 +573,7 @@
) )
} }
let letter_conclusion = { let letter-conclusion = {
align(bottom)[ align(bottom)[
#pad(bottom: 2em)[ #pad(bottom: 2em)[
#text(weight: "light")[Sincerely,] \ #text(weight: "light")[Sincerely,] \
@@ -579,41 +587,41 @@
letter-heading letter-heading
body body
linebreak() linebreak()
letter_conclusion letter-conclusion
} }
/// Cover letter heading that takes in the information for the hiring company and formats it properly. /// Cover letter heading that takes in the information for the hiring company and formats it properly.
/// - entity_info (content): The information of the hiring entity including the company name, the target (who's attention to), street address, and city /// - entity-info (content): The information of the hiring entity including the company name, the target (who's attention to), street address, and city
/// - date (date): The date the letter was written (defaults to the current date) /// - date (date): The date the letter was written (defaults to the current date)
#let hiring-entity-info( #let hiring-entity-info(
entity_info: (:), entity-info: (:),
date: datetime.today().display("[month repr:long] [day], [year]"), date: datetime.today().display("[month repr:long] [day], [year]"),
) = { ) = {
set par(leading: 1em) set par(leading: 1em)
pad(top: 1.5em, bottom: 1.5em)[ pad(top: 1.5em, bottom: 1.5em)[
#__justify_align[ #__justify_align[
#text(weight: "bold", size: 12pt)[#entity_info.target] #text(weight: "bold", size: 12pt)[#entity-info.target]
][ ][
#text(weight: "light", style: "italic", size: 9pt)[#date] #text(weight: "light", style: "italic", size: 9pt)[#date]
] ]
#pad(top: 0.65em, bottom: 0.65em)[ #pad(top: 0.65em, bottom: 0.65em)[
#text(weight: "regular", fill: color-gray, size: 9pt)[ #text(weight: "regular", fill: color-gray, size: 9pt)[
#smallcaps[#entity_info.name] \ #smallcaps[#entity-info.name] \
#entity_info.street_address \ #entity-info.street-address \
#entity_info.city \ #entity-info.city \
] ]
] ]
] ]
} }
/// Letter heading for a given job position and addressee. /// Letter heading for a given job position and addressee.
/// - job_position (string): The job position you are applying for /// - job-position (string): The job position you are applying for
/// - addressee (string): The person you are addressing the letter to /// - addressee (string): The person you are addressing the letter to
#let letter-heading(job_position: "", addressee: "") = { #let letter-heading(job-position: "", addressee: "") = {
// TODO: Make this adaptable to content // TODO: Make this adaptable to content
underline(evade: false, stroke: 0.5pt, offset: 0.3em)[ underline(evade: false, stroke: 0.5pt, offset: 0.3em)[
#text(weight: "bold", size: 12pt)[Job Application for #job_position] #text(weight: "bold", size: 12pt)[Job Application for #job-position]
] ]
pad(top: 1em, bottom: 1em)[ pad(top: 1em, bottom: 1em)[
#text(weight: "light", fill: color-gray)[ #text(weight: "light", fill: color-gray)[