Remove test file
parent
ae155ccfe5
commit
4e4c8c72b8
72
test.typ
72
test.typ
|
|
@ -1,72 +0,0 @@
|
||||||
#let language = "en"
|
|
||||||
|
|
||||||
#let cvdata = (
|
|
||||||
personal: yaml("data/en/personal.yaml"),
|
|
||||||
experience: yaml("data/en/experience.yaml"),
|
|
||||||
education: yaml("data/en/education.yaml")
|
|
||||||
// skills: yaml("data/en/skills.yaml")
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
#let w = cvdata.experience
|
|
||||||
|
|
||||||
#let getWithLang(lang, data) = {
|
|
||||||
if type(data) == dictionary {
|
|
||||||
data.at(lang)
|
|
||||||
} else {
|
|
||||||
data
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#(regex("\d{4}-\d{2}-\d{2}") in "2023-04-12")
|
|
||||||
|
|
||||||
#let myarr = (2, 1, 3, 4,)
|
|
||||||
|
|
||||||
// #myarr.sorted(key: a => getWithLang(a.gt))
|
|
||||||
|
|
||||||
|
|
||||||
#let filterLanguage(lang, data) = {
|
|
||||||
if type(data) == dictionary {
|
|
||||||
if data.at(lang, default: none) == none {
|
|
||||||
data = data
|
|
||||||
.pairs()
|
|
||||||
.map(xs => (xs.first(), filterLanguage(lang, xs.last())))
|
|
||||||
.fold((:), (acc, xs) => {
|
|
||||||
acc.insert(xs.first(), xs.last())
|
|
||||||
acc
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
data = filterLanguage(lang, data.at(lang))
|
|
||||||
}
|
|
||||||
} else if type(data) == array {
|
|
||||||
data = data.map(v => filterLanguage(lang, v))
|
|
||||||
}
|
|
||||||
|
|
||||||
data
|
|
||||||
}
|
|
||||||
|
|
||||||
#filterLanguage("fr", cvdata)
|
|
||||||
|
|
||||||
|
|
||||||
#let dict = (
|
|
||||||
name: "myName",
|
|
||||||
address: "myAddress"
|
|
||||||
)
|
|
||||||
|
|
||||||
#let a = (a: 1, b: 2)
|
|
||||||
|
|
||||||
#let f(data) = {
|
|
||||||
data
|
|
||||||
.pairs()
|
|
||||||
.map(xs => (xs.first(), xs.last()))
|
|
||||||
.fold((:), (acc, xs) => {
|
|
||||||
acc.insert(xs.first(), xs.last())
|
|
||||||
acc
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
#f(dict)
|
|
||||||
|
|
||||||
#let a = (:)
|
|
||||||
#type(a)
|
|
||||||
Loading…
Reference in New Issue