Skip to content

Commit

Permalink
fix: minor issues with accent color, switch to kebab-case
Browse files Browse the repository at this point in the history
Fixed minor issue with accent color and switch (fully) to using kebab case.

Fixes DeveloperPaul123#17
Fixes DeveloperPaul123#19
  • Loading branch information
DeveloperPaul123 committed Apr 6, 2024
1 parent de76f08 commit 2dc1e86
Showing 1 changed file with 41 additions and 33 deletions.
74 changes: 41 additions & 33 deletions lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,22 @@
/// Show a link with an icon, specifically for Github projects
/// *Example*
/// #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
#let github-link(github_path) = {
#let github-link(github-path) = {
set box(height: 11pt)

align(right + horizon)[
#fa-icon("github", fa-set: "Brands", fill: color-darkgray) #link(
"https://github.com/" + github_path,
github_path,
"https://github.com/" + github-path,
github-path,
)
]
}

/// Right section for the justified headers
/// - 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, accent_color: default-accent-color) = {
#let secondary-right-header(body) = {
set text(
size: 11pt,
weight: "medium",
Expand Down Expand Up @@ -125,17 +124,21 @@
///
/// - author (content): Structure that takes in all the author's information
/// - date (string): The date the resume was created
/// - accent_color (color): The accent color of the resume
/// - colored_headers (boolean): Whether the headers should be colored or not
/// - accent-color (color): The accent color of the resume
/// - colored-headers (boolean): Whether the headers should be colored or not
/// - body (content): The body of the resume
/// -> none
#let resume(
author: (:),
date: datetime.today().display("[month repr:long] [day], [year]"),
accent_color: default-accent-color,
colored_headers: true,
accent-color: default-accent-color,
colored-headers: true,
body,
) = {
if type(accent-color) == "string" {
accent-color = rgb(accent-color)
}

set document(
author: author.firstname + " " + author.lastname,
title: "resume",
Expand Down Expand Up @@ -196,8 +199,8 @@
)

#align(left)[
#let color = if colored_headers {
accent_color
#let color = if colored-headers {
accent-color
} else {
color-darkgray
}
Expand Down Expand Up @@ -233,7 +236,7 @@
style: "normal",
font: ("Roboto"),
)
#text(accent_color, weight: "thin")[#author.firstname]
#text(fill: accent-color, weight: "thin")[#author.firstname]
#text(weight: "bold")[#author.lastname]
]
]
Expand All @@ -242,7 +245,7 @@

let positions = {
set text(
accent_color,
accent-color,
size: 9pt,
weight: "regular",
)
Expand Down Expand Up @@ -335,6 +338,7 @@
location: "",
date: "",
description: "",
accent-color: default-accent-color,
) = {
pad[
#justified-header(title, location)
Expand Down Expand Up @@ -397,17 +401,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.
/// This coverletter template is designed to be used with the resume template.
/// - 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
/// - 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
#let coverletter(
author: (:),
profile_picture: image,
profile-picture: image,
date: datetime.today().display("[month repr:long] [day], [year]"),
accent_color: default-accent-color,
accent-color: default-accent-color,
body,
) = {
if type(accent-color) == "string" {
accent-color = rgb(accent-color)
}

set document(
author: author.firstname + " " + author.lastname,
title: "resume",
Expand Down Expand Up @@ -468,7 +476,7 @@
)

#align(left)[
#text[#strong[#text(accent_color)[#it.body.text]]]
#text[#strong[#text(accent-color)[#it.body.text]]]
#box(width: 1fr, line(length: 100%))
]
]
Expand All @@ -482,7 +490,7 @@
style: "normal",
font: ("Roboto"),
)
#text(accent_color, weight: "thin")[#author.firstname]
#text(accent-color, weight: "thin")[#author.firstname]
#text(weight: "bold")[#author.lastname]
]
]
Expand All @@ -491,7 +499,7 @@

let positions = {
set text(
accent_color,
accent-color,
size: 9pt,
weight: "regular",
)
Expand Down Expand Up @@ -561,7 +569,7 @@
radius: 2cm,
width: 4cm,
height: 4cm,
profile_picture,
profile-picture,
)
],
[
Expand All @@ -573,7 +581,7 @@
)
}

let letter_conclusion = {
let letter-conclusion = {
align(bottom)[
#pad(bottom: 2em)[
#text(weight: "light")[Sincerely,] \
Expand All @@ -587,41 +595,41 @@
letter-heading
body
linebreak()
letter_conclusion
letter-conclusion
}

/// 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)
#let hiring-entity-info(
entity_info: (:),
entity-info: (:),
date: datetime.today().display("[month repr:long] [day], [year]"),
) = {
set par(leading: 1em)
pad(top: 1.5em, bottom: 1.5em)[
#__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]
]

#pad(top: 0.65em, bottom: 0.65em)[
#text(weight: "regular", fill: color-gray, size: 9pt)[
#smallcaps[#entity_info.name] \
#entity_info.street_address \
#entity_info.city \
#smallcaps[#entity-info.name] \
#entity-info.street-address \
#entity-info.city \
]
]
]
}

/// 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
#let letter-heading(job_position: "", addressee: "") = {
#let letter-heading(job-position: "", addressee: "") = {
// TODO: Make this adaptable to content
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)[
#text(weight: "light", fill: color-gray)[
Expand Down

0 comments on commit 2dc1e86

Please sign in to comment.