-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathchicv.typ
103 lines (94 loc) · 2.08 KB
/
chicv.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
#import "fontawesome.typ": *
#let chiline() = {
v(-8pt);
line(length: 100%, stroke: gray);
v(-8pt)
}
#let iconlink(
uri, text: "", icon: link-icon
) = {
if text != "" {
link(uri)[#fa[#icon] #text]
} else {
link(uri)[#fa[#icon]]
}
}
#let ghrepo(
repo, add_link: true, icon: true
) = {
if add_link {
if icon {
iconlink("https://github.com/" + repo, text: repo, icon: github)
} else {
link("https://github.com/" + repo)[#repo]
}
} else {
[#fa[#icon] #repo]
}
}
#let cventry(
tl: lorem(2),
tl_comments: "",
tr: "",
bl: "",
br: "",
content
) = {
block(
inset: (left: 0pt),
text(weight: "bold", size: 11pt)[#tl] + text(font: ("Palatino", "Kaiti SC"))[#tl_comments] + h(1fr) + tr +
linebreak() +
if bl != "" or br != "" {
bl + h(1fr) + br + linebreak()
} +
content
)
}
// submit, post
#let redact(alter: none, mark: false, color: black, body) = {
let level = sys.inputs.at("level", default: none);
if level == "submit" {
body
} else if level == "post" {
if alter == none and mark {
box(hide(body), fill: color)
} else if alter == none and not mark {
box(fill: color)[(missing)]
} else {
alter
}
} else {
box(fill: color)[(missing)]
}
}
#let chicv(body) = {
let fonts = (
"Palatino",
"Source Han Serif SC",
"Source Han Serif",
)
show heading.where(
level: 1
): set text(
size: 23pt,
font: fonts,
weight: "light",
)
show heading.where(
level: 2
): it => text(
size: 12pt,
font: fonts,
weight: "bold",
block(
chiline() + it,
)
)
set list(indent: 2pt)
show link: it => underline(offset: 1.8pt, it)
set page(margin: (x: 0.5cm, y: 0.75cm),)
set par(justify: true, leading: 0.8em)
set text(font: fonts, size: 9.5pt)
set block(spacing: 0.9em)
body
}