-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.typ
More file actions
40 lines (38 loc) · 826 Bytes
/
template.typ
File metadata and controls
40 lines (38 loc) · 826 Bytes
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
// any styles go into here
#let get_directory_name() = {
if "directory_name" not in sys.inputs.keys() {
panic("Please specify 'directory_name' with '--input=directory_name=example'")
}
sys.inputs.at("directory_name")
}
#let get_info_dict(
directory_name: get_directory_name(),
info_filename: "/info.toml"
) = {
// import info from directory
let info = toml(directory_name + info_filename)
info
}
#let show_info_table(
info_dict: get_info_dict()
) = {
// showing the info from info.toml
let cells = ()
for (i, k) in info_dict.keys().enumerate() {
cells.push(
table.cell(x: 0, str(k))
)
cells.push(
table.cell(x: 1, str(info_dict.at(k)))
)
cells.push(
table.hline(y: i+1)
)
}
table(
columns: 2,
stroke: none,
align: left,
..cells
)
}