Add Languages

master
Félix Desmaretz 2024-01-26 00:06:26 +01:00
parent 6863eda281
commit 3bfa1222e4
2 changed files with 331 additions and 285 deletions

167
cv/cv.typ
View File

@ -2,20 +2,11 @@
// set rules // set rules
#let setrules(uservars, doc) = { #let setrules(uservars, doc) = {
set text( set text(font: uservars.bodyfont, size: uservars.fontsize, hyphenate: false)
font: uservars.bodyfont,
size: uservars.fontsize,
hyphenate: false,
)
set list( set list(spacing: uservars.linespacing)
spacing: uservars.linespacing
)
set par( set par(leading: uservars.linespacing, justify: true)
leading: uservars.linespacing,
justify: true,
)
doc doc
} }
@ -23,9 +14,7 @@
// show rules // show rules
#let showrules(uservars, doc) = { #let showrules(uservars, doc) = {
// uppercase section headings // uppercase section headings
show heading.where( show heading.where(level: 2): it => block(width: 100%)[
level: 2,
): it => block(width: 100%)[
#set align(left) #set align(left)
#set text(font: uservars.headingfont, size: 1em, weight: "bold") #set text(font: uservars.headingfont, size: 1em, weight: "bold")
#if (uservars.at("headingsmallcaps", default: false)) { #if (uservars.at("headingsmallcaps", default: false)) {
@ -37,9 +26,7 @@
] ]
// name title // name title
show heading.where( show heading.where(level: 1): it => block(width: 100%)[
level: 1,
): it => block(width: 100%)[
#set text(font: uservars.headingfont, size: 2em, weight: "bold") #set text(font: uservars.headingfont, size: 2em, weight: "bold")
#if (uservars.at("headingsmallcaps", default: false)) { #if (uservars.at("headingsmallcaps", default: false)) {
smallcaps(it.body) smallcaps(it.body)
@ -64,7 +51,9 @@
// address // address
#let addresstext(lang, info, uservars) = { #let addresstext(lang, info, uservars) = {
if uservars.showAddress { if uservars.showAddress {
block(width: 100%)[ block(
width: 100%,
)[
#info.personal.location.city, #info.personal.location.region, #info.personal.location.country #info.personal.location.city, #info.personal.location.region, #info.personal.location.country
#v(-4pt) #v(-4pt)
] ]
@ -76,21 +65,22 @@
[#body] [#body]
} }
#let contacttext(lang, info, uservars) = block(
#let contacttext(lang, info, uservars) = block(width: 100%)[ width: 100%,
)[
#let profiles = ( #let profiles = (
box(link("mailto:" + info.personal.email)[#fa(" ") #info.personal.email]), box(link("mailto:" + info.personal.email)[#fa(" ") #info.personal.email]),
if uservars.showNumber { box(link("tel:" + info.personal.phone)[#fa("") #info.personal.phone]) } else { none }, if uservars.showNumber { box(link("tel:" + info.personal.phone)[#fa("") #info.personal.phone]) } else { none },
if info.personal.at("url", default: none) != none { if info.personal.at("url", default: none) != none {
box(link(info.personal.url)[#fa(" ") #info.personal.url.split("//").at(1)]) box(
} link(info.personal.url)[#fa(" ") #info.personal.url.split("//").at(1)],
)
},
).filter(it => it != none) // filter out none elements from the profile array ).filter(it => it != none) // filter out none elements from the profile array
#if info.personal.profiles.len() > 0 { #if info.personal.profiles.len() > 0 {
for profile in info.personal.profiles { for profile in info.personal.profiles {
profiles.push( profiles.push(box(link(profile.url)[#profile.username]))
box(link(profile.url)[#profile.username])
)
} }
} }
@ -109,7 +99,8 @@
} }
#let cvwork(lang, info, isbreakable: true) = { #let cvwork(lang, info, isbreakable: true) = {
if info.experience != none {block[ if info.experience != none {
block[
== #info.experience.title == #info.experience.title
#for w in info.experience.content { #for w in info.experience.content {
block(width: 100%, breakable: isbreakable)[ block(width: 100%, breakable: isbreakable)[
@ -123,27 +114,33 @@
let index = 0 let index = 0
for p in w.what { for p in w.what {
if index != 0 { v(0.6em) } if index != 0 { v(0.6em) }
block(width: 100%, breakable: isbreakable, above: 0.6em)[ block(
width: 100%,
breakable: isbreakable,
above: 0.6em,
)[
// parse ISO date strings into datetime objects // parse ISO date strings into datetime objects
#let start = utils.strpdate(lang, p.startDate) #let start = utils.strpdate(lang, p.startDate)
#let end = utils.strpdate(lang, p.endDate) #let end = utils.strpdate(lang, p.endDate)
// line 2: position and date range // line 2: position and date range
#text(style: "italic")[#p.what] #h(1fr) #text(weight: "semibold", size: 9.0pt, fill: luma(30.6%))[#p.what #h(1fr)
#start #sym.dash.en #end \ #start #sym.dash.en #end] \
// highlights or description // highlights or description
#for hi in p.why [ #for hi in p.why [
- #eval(hi, mode: "markup") - #text(weight: "light")[#eval(hi, mode: "markup")]
] ]
] ]
index = index + 1 index = index + 1
} }
} }
]} ]
}
} }
#let cveducation(lang, info, isbreakable: true) = { #let cveducation(lang, info, isbreakable: true) = {
let education = info.education let education = info.education
if education != none {block[ if education != none {
block[
== #education.title == #education.title
#for edu in education.content { #for edu in education.content {
let start = utils.strpdate(lang, edu.startDate) let start = utils.strpdate(lang, edu.startDate)
@ -151,27 +148,36 @@
let eduurl = edu.at("url", default: none) let eduurl = edu.at("url", default: none)
// create a block layout for each education entry // create a block layout for each education entry
block(width: 100%, breakable: isbreakable)[ block(
width: 100%,
breakable: isbreakable,
)[
// line 1: institution and location // line 1: institution and location
#if eduurl != none [ #if eduurl != none {
*#link(eduurl)[#edu.with]* #h(1fr) *#edu.where* \ text(weight: "extrabold")[
] else [ #link(eduurl)[#edu.with] #h(1fr) #edu.where \
*#edu.with* #h(1fr) *#edu.where* \
] ]
} else {
text(weight: "extrabold")[
#edu.with #h(1fr) #edu.where \
]
}
// line 2: degree and date // line 2: degree and date
#text(style: "italic")[#edu.what] #h(1fr) #text(weight: "semibold", size: 9.0pt, fill: luma(30.6%))[#edu.what #h(1fr)
#start #sym.dash.en #end \ #start #sym.dash.en #end] \
#for hi in edu.why [ #for hi in edu.why [
- #eval(hi, mode: "markup") - #text(weight: "light")[#eval(hi, mode: "markup")]
] ]
] ]
} }
]} ]
}
} }
#let cvaffiliations(lang, info, isbreakable: true) = { #let cvaffiliations(lang, info, isbreakable: true) = {
if info.affiliations != none {block[ if info.affiliations != none {
block[
== Leadership & Activities == Leadership & Activities
#for org in info.affiliations { #for org in info.affiliations {
// parse ISO date strings into datetime objects // parse ISO date strings into datetime objects
@ -197,18 +203,23 @@
} else {} } else {}
] ]
} }
]} ]
}
} }
#let cvprojects(lang, info, isbreakable: true) = { #let cvprojects(lang, info, isbreakable: true) = {
if info.projects != none {block[ if info.projects != none {
block[
== Projects == Projects
#for project in info.projects { #for project in info.projects {
// parse ISO date strings into datetime objects // parse ISO date strings into datetime objects
let start = utils.strpdate(lang, project.startDate) let start = utils.strpdate(lang, project.startDate)
let end = utils.strpdate(lang, project.endDate) let end = utils.strpdate(lang, project.endDate)
// create a block layout for each project entry // create a block layout for each project entry
block(width: 100%, breakable: isbreakable)[ block(
width: 100%,
breakable: isbreakable,
)[
// line 1: project name // line 1: project name
#if project.url != none [ #if project.url != none [
*#link(project.url)[#project.name]* \ *#link(project.url)[#project.name]* \
@ -223,11 +234,13 @@
] ]
] ]
} }
]} ]
}
} }
#let cvawards(lang, info, isbreakable: true) = { #let cvawards(lang, info, isbreakable: true) = {
if info.awards != none {block[ if info.awards != none {
block[
== Honors & Awards == Honors & Awards
#for award in info.awards { #for award in info.awards {
// parse ISO date strings into datetime objects // parse ISO date strings into datetime objects
@ -250,11 +263,13 @@
} else {} } else {}
] ]
} }
]} ]
}
} }
#let cvcertificates(lang, info, isbreakable: true) = { #let cvcertificates(lang, info, isbreakable: true) = {
if info.certificates != none {block[ if info.certificates != none {
block[
== Licenses & Certifications == Licenses & Certifications
#for cert in info.certificates { #for cert in info.certificates {
@ -272,11 +287,13 @@
Issued by #text(style: "italic")[#cert.issuer] #h(1fr) #date \ Issued by #text(style: "italic")[#cert.issuer] #h(1fr) #date \
] ]
} }
]} ]
}
} }
#let cvpublications(lang, info, isbreakable: true) = { #let cvpublications(lang, info, isbreakable: true) = {
if info.publications != none {block[ if info.publications != none {
block[
== Research & Publications == Research & Publications
#for pub in info.publications { #for pub in info.publications {
// parse ISO date strings into datetime objects // parse ISO date strings into datetime objects
@ -293,21 +310,49 @@
Published on #text(style: "italic")[#pub.publisher] #h(1fr) #date \ Published on #text(style: "italic")[#pub.publisher] #h(1fr) #date \
] ]
} }
]} ]
}
}
#let cvlanguages(lang, info, isbreakable: true) = {
block(breakable: isbreakable)[
== #info.languages.title
#for lang in info.languages.content {
[- *#lang.title*#text(weight: "light")[: #lang.content]]
}
]
} }
#let cvskills(lang, info, isbreakable: true) = { #let cvskills(lang, info, isbreakable: true) = {
block(breakable: isbreakable)[ block(
breakable: isbreakable,
)[
== #info.skills.title == #info.skills.title
#for skill in info.skills.content { #for skill in info.skills.content {
[- *#skill.title*] let skillContent = skill.content.sorted(key: x => {
if type(x) == dictionary {
x.keys().first()
} else { x }
}).map(
x => {
if type(x) == dictionary {
[#x.keys().first() (#text(style: "italic")[#x.values().first().sorted().join(", ")])]
} else {
[#x]
}
},
).join(", ")
[- *#skill.title*#text(weight: "light")[: #skillContent]]
} }
] ]
} }
#let cvreferences(info, isbreakable: true) = { #let cvreferences(info, isbreakable: true) = {
if info.references != none {block[ if info.references != none {
block[
== References == References
#for ref in info.references { #for ref in info.references {
block(width: 100%, breakable: isbreakable)[ block(width: 100%, breakable: isbreakable)[
@ -318,15 +363,13 @@
] ]
] ]
} }
]} else {} ]
} else {}
} }
#let endnote() = { #let endnote() = {
place( place(bottom + right, block[
bottom + right,
block[
#set text(size: 5pt, font: "Consolas", fill: silver) #set text(size: 5pt, font: "Consolas", fill: silver)
Félix Desmaretz #datetime.today().display("[year]-[month]-[day]") Félix Desmaretz #datetime.today().display("[year]-[month]-[day]")
] ])
)
} }

View File

@ -1,13 +1,15 @@
#import "cv/cv.typ": * #import "cv/cv.typ": *
#import "cv/utils.typ"
#let language = "en" #let language = "fr"
#let cvdata = ( #let cvdata = utils.filterLanguage(language, (
personal: yaml(("data/", "en", "/personal.yaml").join()), personal: yaml(("data/", "en", "/personal.yaml").join()),
experience: yaml(("data/", "en", "/experience.yaml").join()), experience: yaml(("data/", "en", "/experience.yaml").join()),
education: yaml(("data/", "en", "/education.yaml").join()), education: yaml(("data/", "en", "/education.yaml").join()),
skills: yaml(("data/", "en", "/skills.yaml").join()) skills: yaml(("data/", "en", "/skills.yaml").join()),
) languages: yaml("data/en/languages.yaml"),
))
#let uservars = ( #let uservars = (
headingfont: "Roboto", headingfont: "Roboto",
@ -16,7 +18,7 @@
linespacing: 6pt, linespacing: 6pt,
showAddress: true, // true/false show address in contact info showAddress: true, // true/false show address in contact info
showNumber: true, // true/false show phone number in contact info showNumber: true, // true/false show phone number in contact info
headingsmallcaps: false headingsmallcaps: false,
) )
#let customrules(doc) = { #let customrules(doc) = {
@ -41,8 +43,9 @@
#show: doc => cvinit(doc) #show: doc => cvinit(doc)
#cvheading(cvdata, uservars) #cvheading(language, cvdata, uservars)
#cvwork(language, cvdata) #cvwork(language, cvdata)
// #cveducation(cvdata) #cveducation(language, cvdata)
// #cvskills(cvdata) #cvlanguages(language, cvdata)
#cvskills(language, cvdata)
#endnote() #endnote()