From dc0eb7a6485029891e85a99c5a0d5642ed4aac76 Mon Sep 17 00:00:00 2001 From: elagil Date: Fri, 1 Aug 2025 18:22:57 +0200 Subject: [PATCH] chore: remove coloring --- lib.typ | 292 +++++++++++++++++++++++++++----------------------------- 1 file changed, 142 insertions(+), 150 deletions(-) diff --git a/lib.typ b/lib.typ index f147f2c..e54afe9 100644 --- a/lib.typ +++ b/lib.typ @@ -1,27 +1,20 @@ #import "@preview/fontawesome:0.5.0": * #import "@preview/linguify:0.4.2": * -// const color -#let color-darknight = rgb("#131A28") -#let color-darkgray = rgb("#333333") -#let color-gray = rgb("#5d5d5d") -#let default-accent-color = rgb("#262F99") -#let default-location-color = rgb("#333333") - // const icons -#let linkedin-icon = box(fa-icon("linkedin", fill: color-darknight)) -#let github-icon = box(fa-icon("github", fill: color-darknight)) -#let gitlab-icon = box(fa-icon("gitlab", fill: color-darknight)) -#let bitbucket-icon = box(fa-icon("bitbucket", fill: color-darknight)) -#let twitter-icon = box(fa-icon("twitter", fill: color-darknight)) -#let google-scholar-icon = box(fa-icon("google-scholar", fill: color-darknight)) -#let orcid-icon = box(fa-icon("orcid", fill: color-darknight)) -#let phone-icon = box(fa-icon("square-phone", fill: color-darknight)) -#let email-icon = box(fa-icon("envelope", fill: color-darknight)) -#let birth-icon = box(fa-icon("cake", fill: color-darknight)) -#let homepage-icon = box(fa-icon("home", fill: color-darknight)) -#let website-icon = box(fa-icon("globe", fill: color-darknight)) -#let address-icon = box(fa-icon("location-crosshairs", fill: color-darknight)) +#let linkedin-icon = box(fa-icon("linkedin")) +#let github-icon = box(fa-icon("github")) +#let gitlab-icon = box(fa-icon("gitlab")) +#let bitbucket-icon = box(fa-icon("bitbucket")) +#let twitter-icon = box(fa-icon("twitter")) +#let google-scholar-icon = box(fa-icon("google-scholar")) +#let orcid-icon = box(fa-icon("orcid")) +#let phone-icon = box(fa-icon("square-phone")) +#let email-icon = box(fa-icon("envelope")) +#let birth-icon = box(fa-icon("cake")) +#let homepage-icon = box(fa-icon("home")) +#let website-icon = box(fa-icon("globe")) +#let address-icon = box(fa-icon("location-crosshairs")) /// Helpers @@ -81,7 +74,7 @@ lang_data, use-smallcaps: true, ) = { - set text(fill: gray, size: 8pt) + set text(size: 8pt) __justify_align_3[ #__apply_smallcaps(date, use-smallcaps) ][ @@ -100,7 +93,7 @@ } #let __resume_footer(author, language, lang_data, date, use-smallcaps: true) = { - set text(fill: gray, size: 8pt) + set text(size: 8pt) __justify_align_3[ #__apply_smallcaps(date, use-smallcaps) ][ @@ -127,7 +120,7 @@ set box(height: 11pt) align(right + horizon)[ - #fa-icon("github", fill: color-darkgray) #link( + #fa-icon("github") #link( "https://github.com/" + github-path, github-path, ) @@ -183,7 +176,6 @@ /// - 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. /// - 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 /// - language (string): The language of the resume, defaults to "en". See lang.toml for available languages /// - use-smallcaps (boolean): Whether to use small caps formatting throughout the template @@ -193,21 +185,16 @@ author: (:), profile-picture: image, date: datetime.today().display("[month repr:long] [day], [year]"), - accent-color: default-accent-color, colored-headers: true, show-footer: true, language: "en", font: ("Source Sans Pro", "Source Sans 3"), - header-font: "Roboto", + header-font: ("Source Sans Pro", "Source Sans 3"), paper-size: "a4", use-smallcaps: true, show-address-icon: false, body, ) = { - if type(accent-color) == str { - accent-color = rgb(accent-color) - } - let lang_data = toml("lang.toml") show: body => context { @@ -222,7 +209,6 @@ font: font, lang: language, size: 11pt, - fill: color-darkgray, fallback: true, ) @@ -248,17 +234,12 @@ #set text(size: 16pt, weight: "regular") #set align(left) #set block(above: 1em) - #let color = if colored-headers { - accent-color - } else { - color-darkgray - } - #text[#strong[#text(color)[#it.body]]] + #text[#strong[#text()[#it.body]]] #box(width: 1fr, line(length: 100%)) ] show heading.where(level: 2): it => { - set text(color-darkgray, size: 12pt, style: "normal", weight: "bold") + set text(size: 12pt, style: "normal", weight: "bold") it.body } @@ -273,10 +254,10 @@ #block[ #set text(size: 32pt, style: "normal", font: header-font) #if language == "zh" or language == "ja" [ - #text(accent-color, weight: "thin")[#author.firstname]#text(weight: "bold")[#author.lastname] + #text(weight: "thin")[#author.firstname]#text(weight: "thin")[#author.lastname] ] else [ - #text(accent-color, weight: "thin")[#author.firstname] - #text(weight: "bold")[#author.lastname] + #text(weight: "thin")[#author.firstname] + #text(weight: "thin")[#author.lastname] ] ] ] @@ -284,7 +265,7 @@ } let positions = { - set text(accent-color, size: 9pt, weight: "regular") + set text(size: 9pt, weight: "regular") align(center)[ #__apply_smallcaps( author.positions.join(text[#" "#sym.dot.c#" "]), @@ -383,7 +364,7 @@ #if ("text" in item) [ #separator #if ("icon" in item) [ - #box(fa-icon(item.icon, fill: color-darknight)) + #box(fa-icon(item.icon)) ] #box[ #if ("link" in item) [ @@ -436,7 +417,7 @@ /// This formats the item for the resume entries. Typically your body would be a bullet list of items. Could be your responsibilities at a company or your academic achievements in an educational background section. /// - body (content): The body of the resume entry #let resume-item(body) = { - set text(size: 10pt, style: "normal", weight: "light", fill: color-darknight) + set text(size: 10pt, style: "normal", weight: "light") set block(above: 0.75em, below: 1.25em) set par(leading: 0.65em) block(above: 0.5em)[ @@ -450,16 +431,12 @@ /// - date (string): The date of the resume entry, this can be a range (e.g. "Jan 2020 - Dec 2020") /// - description (content): The body of the resume entry /// - title-link (string): The link to use for the title (can be none) -/// - accent-color (color): Override the accent color of the resume-entry -/// - location-color (color): Override the default color of the "location" for a resume entry. #let resume-entry( title: none, location: "", date: "", description: "", title-link: none, - accent-color: default-accent-color, - location-color: default-location-color, ) = { let title-content if type(title-link) == str { @@ -569,7 +546,6 @@ /// - author (content): Structure that takes in all the author's information. The following fields are required: firstname, lastname, positions. The following fields are used if available: email, phone, github, linkedin, orcid, address, website, custom. The `custom` field is an array of additional entries with the following fields: text (string, required), icon (string, optional Font Awesome icon name), link (string, optional). /// - profile-picture (image): The profile picture of the author. This will be cropped to a circle and should be square in nature. /// - date (datetime): The date the cover letter was created. This will default to the current date. -/// - accent-color (color): The accent color of the cover letter /// - language (string): The language of the cover letter, defaults to "en". See lang.toml for available languages /// - font (array): The font families of the cover letter /// - header-font (array): The font families of the cover letter header @@ -581,10 +557,9 @@ author: (:), profile-picture: image, date: datetime.today().display("[month repr:long] [day], [year]"), - accent-color: default-accent-color, language: "en", font: ("Source Sans Pro", "Source Sans 3"), - header-font: "Roboto", + header-font: ("Source Sans Pro", "Source Sans 3"), show-footer: true, closing: none, paper-size: "a4", @@ -592,10 +567,6 @@ show-address-icon: false, body, ) = { - if type(accent-color) == str { - accent-color = rgb(accent-color) - } - // language data let lang_data = toml("lang.toml") @@ -615,7 +586,6 @@ font: font, lang: language, size: 11pt, - fill: color-darkgray, fallback: true, ) @@ -642,7 +612,7 @@ #set text(size: 16pt, weight: "regular") #align(left)[ - #text[#strong[#text(accent-color)[#it.body]]] + #text[#strong[#text()[#it.body]]] #box(width: 1fr, line(length: 100%)) ] ] @@ -653,10 +623,10 @@ #block[ #set text(size: 32pt, style: "normal", font: header-font) #if language == "zh" or language == "ja" [ - #text(accent-color, weight: "thin")[#author.firstname]#text(weight: "bold")[#author.lastname] + #text(weight: "thin")[#author.firstname]#text(weight: "thin")[#author.lastname] ] else [ - #text(accent-color, weight: "thin")[#author.firstname] - #text(weight: "bold")[#author.lastname] + #text(weight: "thin")[#author.firstname] + #text(weight: "thin")[#author.lastname] ] ] @@ -665,7 +635,7 @@ } let positions = { - set text(accent-color, size: 9pt, weight: "regular") + set text(size: 9pt, weight: "regular") align(right)[ #__apply_smallcaps( author.positions.join(text[#" "#sym.dot.c#" "]), @@ -675,7 +645,7 @@ } let address = { - set text(size: 9pt, weight: "bold", fill: color-gray) + set text(size: 9pt, weight: "regular") align(right)[ #if ("address" in author) [ #if show-address-icon [ @@ -691,71 +661,93 @@ let contacts = { set box(height: 9pt) - let separator = [ #box(sym.bar.v) ] - let author_list = () + let separator = box(width: 5pt) - if ("phone" in author) { - author_list.push[ - #phone-icon - #box[#link("tel:" + author.phone)[#author.phone]] - ] - } - if ("email" in author) { - author_list.push[ - #email-icon - #box[#link("mailto:" + author.email)[#author.email]] - ] - } - if ("github" in author) { - author_list.push[ - #github-icon - #box[#link("https://github.com/" + author.github)[#author.github]] - ] - } - if ("linkedin" in author) { - author_list.push[ - #linkedin-icon - #box[ - #link("https://www.linkedin.com/in/" + author.linkedin)[#author.firstname #author.lastname] - ] - ] - } - if ("orcid" in author) { - author_list.push[ - #orcid-icon - #box[#link("https://orcid.org/" + author.orcid)[#author.orcid]] - ] - } - if ("website" in author) { - author_list.push[ - #website-icon - #box[#link(author.website)[#author.website]] - ] - } - - if ("custom" in author and type(author.custom) == array) { - for item in author.custom { - if ("text" in item) { - author_list.push[ - #if ("icon" in item) [ - #box(fa-icon(item.icon, fill: color-darknight)) - ] + align(right)[ + #set text(size: 9pt, weight: "regular", style: "normal") + #block[ + #align(horizon)[ + #if ("birth" in author) [ + #birth-icon + #box[#text(author.birth)] + #separator + ] + #if ("phone" in author) [ + #phone-icon + #box[#link("tel:" + author.phone)[#author.phone]] + #separator + ] + #if ("email" in author) [ + #email-icon + #box[#link("mailto:" + author.email)[#author.email]] + ] + #if ("homepage" in author) [ + #separator + #homepage-icon + #box[#link(author.homepage)[#author.homepage]] + ] + #if ("github" in author) [ + #separator + #github-icon + #box[#link("https://github.com/" + author.github)[#author.github]] + ] + #if ("gitlab" in author) [ + #separator + #gitlab-icon + #box[#link("https://gitlab.com/" + author.gitlab)[#author.gitlab]] + ] + #if ("bitbucket" in author) [ + #separator + #bitbucket-icon + #box[#link("https://bitbucket.org/" + author.bitbucket)[#author.bitbucket]] + ] + #if ("linkedin" in author) [ + #separator + #linkedin-icon #box[ - #if ("link" in item) [ - #link(item.link)[#item.text] - ] else [ - #item.text + #link("https://www.linkedin.com/in/" + author.linkedin)[#author.firstname #author.lastname] + ] + ] + #if ("twitter" in author) [ + #separator + #twitter-icon + #box[#link("https://twitter.com/" + author.twitter)[\@#author.twitter]] + ] + #if ("scholar" in author) [ + #let fullname = str(author.firstname + " " + author.lastname) + #separator + #google-scholar-icon + #box[#link("https://scholar.google.com/citations?user=" + author.scholar)[#fullname]] + ] + #if ("orcid" in author) [ + #separator + #orcid-icon + #box[#link("https://orcid.org/" + author.orcid)[#author.orcid]] + ] + #if ("website" in author) [ + #separator + #website-icon + #box[#link(author.website)[#author.website]] + ] + #if ("custom" in author and type(author.custom) == array) [ + #for item in author.custom [ + #if ("text" in item) [ + #separator + #if ("icon" in item) [ + #box(fa-icon(item.icon)) + ] + #box[ + #if ("link" in item) [ + #link(item.link)[#item.text] + ] else [ + #item.text + ] + ] ] ] ] - } - } - } - - - align(right)[ - #set text(size: 8pt, weight: "light", style: "normal") - #author_list.join(separator) + ] + ] ] } @@ -788,7 +780,33 @@ #text(weight: "light")[#linguify("sincerely", from: lang_data)#if ( language != "de" ) [#sym.comma]] \ - #text(weight: "bold")[#author.firstname #author.lastname] \ \ + #text(weight: "regular")[#author.firstname #author.lastname] \ \ + ] + ] + } + + /// 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 + /// - date (date): The date the letter was written (defaults to the current date) + let hiring-entity-info( + entity-info: (:), + date: datetime.today().display("[month repr:long] [day], [year]"), + use-smallcaps: true, + ) = { + set par(leading: 1em) + pad(top: 1.5em, bottom: 1.5em)[ + #__justify_align[ + #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", size: 9pt)[ + #__apply_smallcaps(entity-info.name, use-smallcaps) \ + #entity-info.street-address \ + #entity-info.city \ + ] ] ] } @@ -801,32 +819,6 @@ closing } -/// 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 -/// - date (date): The date the letter was written (defaults to the current date) -#let hiring-entity-info( - entity-info: (:), - date: datetime.today().display("[month repr:long] [day], [year]"), - use-smallcaps: true, -) = { - set par(leading: 1em) - pad(top: 1.5em, bottom: 1.5em)[ - #__justify_align[ - #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)[ - #__apply_smallcaps(entity-info.name, use-smallcaps) \ - #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 /// - addressee (string): The person you are addressing the letter to @@ -842,7 +834,7 @@ ) #job-position] ] pad(top: 1em, bottom: 1em)[ - #text(weight: "light", fill: color-gray)[ + #text(weight: "light")[ #if dear == "" [ #linguify("dear", from: lang_data) ] else [