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

View File

@ -1,13 +1,15 @@
#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()),
experience: yaml(("data/", "en", "/experience.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 = (
headingfont: "Roboto",
@ -16,7 +18,7 @@
linespacing: 6pt,
showAddress: true, // true/false show address in contact info
showNumber: true, // true/false show phone number in contact info
headingsmallcaps: false
headingsmallcaps: false,
)
#let customrules(doc) = {
@ -41,8 +43,9 @@
#show: doc => cvinit(doc)
#cvheading(cvdata, uservars)
#cvheading(language, cvdata, uservars)
#cvwork(language, cvdata)
// #cveducation(cvdata)
// #cvskills(cvdata)
#cveducation(language, cvdata)
#cvlanguages(language, cvdata)
#cvskills(language, cvdata)
#endnote()