forked from GeorgeHoneywood/alta-typst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalta-typst.typ
122 lines (98 loc) · 1.77 KB
/
alta-typst.typ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#let primary_colour = rgb("#3E0C87") // vivid purple
#let link_colour = rgb("#12348e") // blue
#let icon(name, shift: 1.5pt) = {
box(
baseline: shift,
height: 10pt,
image("icons/" + name + ".svg")
)
h(3pt)
}
#let findMe(services) = {
set text(8pt)
let icon = icon.with(shift: 2.5pt)
services.map(service => {
icon(service.name)
if "display" in service.keys() {
link(service.link)[#{service.display}]
} else {
link(service.link)
}
}).join(h(10pt))
[
]
}
#let term(period, location) = {
text(9pt)[#icon("calendar") #period #h(1fr) #icon("location") #location]
}
#let max_rating = 5
#let skill(name, rating) = {
let done = false
let i = 1
name
h(1fr)
while (not done){
let colour = rgb("#c0c0c0") // grey
if (i <= rating){
colour = primary_colour
}
box(circle(
radius: 4pt,
fill: colour
))
if (max_rating == i){
done = true
} else {
// no spacing on last
h(2pt)
}
i += 1
}
[\ ]
}
#let styled-link(dest, content) = emph(text(
fill: link_colour,
link(dest, content)
))
#let alta(
name: "",
links: (),
tagline: [],
content,
) = {
set document(
title: name + "'s CV",
author: name,
)
set text(9.8pt, font: "IBM Plex Sans")
set page(
margin: (x: 54pt, y: 52pt),
)
show heading.where(
level: 2
): it => text(
fill: primary_colour,
[
#{it.body}
#v(-7pt)
#line(length: 100%, stroke: 1pt + primary_colour)
]
)
show heading.where(
level: 3
): it => text(it.body)
show heading.where(
level: 4
): it => text(
fill: primary_colour,
it.body
)
[= #name]
findMe(links)
tagline
columns(
2,
gutter: 15pt,
content,
)
}