diff --git a/template/avatar.png b/avatar.png similarity index 100% rename from template/avatar.png rename to avatar.png diff --git a/lib.typ b/lib.typ index 9e739e3..d6e6670 100644 --- a/lib.typ +++ b/lib.typ @@ -90,18 +90,19 @@ ) } -#let header(data) = { +#let header(author, job-title, bio: none, avatar: none, contact-options: ()) = { + let avatarImagePath = "" + if avatar != none { + avatarImagePath = avatar + } grid( columns: 1, rows: (auto, auto), headerRibbon( colors.primary, - headline(data.name, data.jobTitle, data.at("bio", default: ""), imagepath: data.at("avatarImagePath", default: "")) + headline(author, job-title, bio, imagepath: avatarImagePath) ), - headerRibbon( - colors.secondary, - contactDetails(data.at("contactOptions", default: ())) - ) + headerRibbon(colors.secondary, contactDetails(contact-options)) ) } @@ -171,8 +172,31 @@ } -#let modern-resume(data, body) = { - // Configuration +#let modern-resume( + // The person's full name as a string. + author: "John Doe", + + // A short description of your profession. + job-title: [Data Scientist], + + // A short description about your background/experience/skills, or none. + bio: none, + // A avatar that is pictures in the top-right corner of the resume, or none. + avatar: none, + + // A list of contact options. + contact-options: (), + + // The resume's content. + body +) = { + // Set document metadata. + set document(title: "Resume of " + author, author: author) + + // Set the body font. + set text(font: "Roboto", size: textSize.normal) + + // Configure the page. set page( paper: "a4", margin: ( @@ -182,12 +206,11 @@ bottom: 1cm, ), ) - set text( - font: "Roboto", - size: textSize.normal, - ) + + // Set the marker color for lists. set list(marker: (text(colors.accentColor)[•], text(colors.accentColor)[--])) + // Set the heading. show heading: it => { set text(colors.accentColor) pad(bottom: 0.5em)[ @@ -202,8 +225,9 @@ show link: it => [ #it #linkIcon("arrow-up-right-from-square") ] - header(data) + header(author, job-title, bio: bio, avatar: avatar, contact-options: contact-options) } + // Main content { show link: it => [ diff --git a/main.typ b/main.typ index 3bca9d3..3757809 100644 --- a/main.typ +++ b/main.typ @@ -1,11 +1,11 @@ -#import "modern-resume.typ": modern-resume, workExperience, educationalExperience, project, pill - -#let data = ( - name: "John Doe", - jobTitle: "Data Scientist", - bio: lorem(5), // Optional parameter - avatarImagePath: "template/avatar.png", // Optional parameter - contactOptions: ( // Optional parameter, all entries are optional +#import "lib.typ": modern-resume, workExperience, educationalExperience, project, pill + +#show: modern-resume.with( + author: "John Doe", + job-title: "Data Scientist", + bio: lorem(5), + avatar: "avatar.png", + contact-options: ( email: link("mailto:john.doe@gmail.com")[john.doe\@gmail.com], mobile: "+43 1234 5678", location: "Austria", @@ -15,8 +15,6 @@ ), ) -#show: doc => modern-resume(data, doc) - == Education #educationalExperience( diff --git a/template/main.typ b/template/main.typ index 712858e..40988b3 100644 --- a/template/main.typ +++ b/template/main.typ @@ -1,11 +1,9 @@ -#import "@preview/modern-resume:0.1.0": modern-resume, workExperience, educationalExperience, project, pill - -#let data = ( - name: "John Doe", - jobTitle: "Data Scientist", - bio: lorem(5), // Optional parameter - avatarImagePath: "avatar.png", // Optional parameter - contactOptions: ( // Optional parameter, all entries are optional +#show: modern-resume.with( + author: "John Doe", + job-title: "Data Scientist", + bio: lorem(5), + avatar: "avatar.png", + contact-options: ( email: link("mailto:john.doe@gmail.com")[john.doe\@gmail.com], mobile: "+43 1234 5678", location: "Austria", @@ -15,8 +13,6 @@ ), ) -#show: doc => modern-resume(data, doc) - == Education #educationalExperience(