-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmanual.typ
291 lines (245 loc) · 6.61 KB
/
manual.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
#import "@preview/mantys:0.1.4": *
#import "timeliney.typ": *
#show: mantys.with(
..toml("typst.toml").package,
examples-scope: (
group: group,
headerline: headerline,
milestone: milestone,
task: task,
taskgroup: taskgroup,
timeline: timeline,
)
)
#command(
"timeline",
arg[body],
arg(spacing: 5pt),
arg(show-grid: false),
arg(grid-style: (stroke: (dash: "dashed", thickness: .5pt, paint: gray))),
arg(task-vline: true),
arg(line-style: (stroke: 3pt)),
arg(milestone-overhang: 5pt),
arg(milestone-layout: "in-place"),
arg(box-milestones: true),
arg(milestone-line-style: ()),
arg(offset: 0),
)[
#argument("spacing", types: ("length",), default: 5pt)[
Spacing between lines
]
#argument("show-grid", types: ("boolean",), default: true)[
Show a grid behind the timeline
]
#argument(
"grid-style",
types: ("dictionary",),
default: (stroke: (dash: "dashed", thickness: .5pt, paint: gray)),
)[
The style to use for the grid (has no effect if `show-grid` is false)
]
#argument("task-vline", types: ("boolean",), default: true)[
Show a vertical line next to the task names
]
#argument("line-style", types: ("dictionary",), default: (stroke: 3pt))[
The style to use for the lines in the timelines
]
#argument(
"milestone-overhang",
types: ("length",),
default: 5pt,
)[
How far the milestone lines should extend past the end of the timeline (only has
an effect if `milestone-layout` is `in-place`)
]
#argument(
"milestone-layout",
types: ("string",),
default: "in-place",
)[
How to lay out the milestone lines. Can be `in-place` or `aligned`.
`in-place` displays the milestones directly below the timeline, and tries to lay
them out as well as possible to avoid colisions.
`aligned` displays the milestones in a separate box, aligned with the task
titles.
]
#argument("box-milestones", types: ("boolean",), default: true)[
Whether to draw a box around the milestones (only has an effect if
`milestone-layout` is `aligned`)
]
#argument("milestone-line-style", types: ("dictionary",), default: ())[
The style to use for the milestone lines
]
#argument("offset", types: ("float",), default: 0)[
Offset to be automatically added to all the timespans
]
#example[```
#timeline(
show-grid: true,
{
headerline(group(([*2023*], 4)), group(([*2024*], 4)))
headerline(
group(..range(4).map(n => strong("Q" + str(n + 1)))),
group(..range(4).map(n => strong("Q" + str(n + 1)))),
)
taskgroup(title: [*Research*], {
task("Research the market", (0, 2), style: (stroke: 2pt + gray))
task("Conduct user surveys", (1, 3), style: (stroke: 2pt + gray))
})
taskgroup(title: [*Development*], {
task("Create mock-ups", (2, 3), style: (stroke: 2pt + gray))
task("Develop application", (3, 5), style: (stroke: 2pt + gray))
task("QA", (3.5, 6), style: (stroke: 2pt + gray))
})
taskgroup(title: [*Marketing*], {
task("Press demos", (3.5, 7), style: (stroke: 2pt + gray))
task("Social media advertising", (6, 7.5), style: (stroke: 2pt + gray))
})
milestone(
at: 3.75,
style: (stroke: (dash: "dashed")),
align(center, [
*Conference demo*\
Dec 2023
])
)
milestone(
at: 6.5,
style: (stroke: (dash: "dashed")),
align(center, [
*App store launch*\
Aug 2024
])
)
}
)
```]
]
#command("headerline", arg("..titles", is-sink: true))[
#argument("titles", types: ("array",), is-sink: true)[
The titles to display in the header line.
Can be specified in several different formats:
#example[```
// One column per title
#headerline("Title 1", "Title 2", "Title 3")
```]
#example[```
// Each title occupies 2 columns
#headerline(("Title 1", 2), ("Title 2", 2))
```]
#example[```
// Two groups of titles
#headerline(
group("Q1", "Q2", "Q3", "Q4"),
group("Q1", "Q2", "Q3", "Q4"),
)
```]
#example[```
// Two lines of headers
#headerline(
group(("2023", 4), ("2024", 4))
)
#headerline(
group("Q1", "Q2", "Q3", "Q4"),
group("Q1", "Q2", "Q3", "Q4"),
)
```]
]
]
#command("group", arg("..titles", is-sink: true))[
Defines a group of titles in a header line.
Takes the same options as `#headerline`.
]
#command(
"task",
arg([name]),
arg([style], default: none),
arg("..lines", is-sink: true),
)[
Defines a task
#argument("name", types: ("content",))[
The name of the task
]
#argument(
"style",
types: ("dictionary",),
default: none,
)[
The style to use for the task line. If not specified, the default style will be
used.
]
#argument(
"..lines",
types: ("array",)
)[
The lines to display in the task. Can be specified in several different formats:
#example[```
// Spans 1 month, starting at the first month of the timeline
#task("Task", (0, 1))
```]
#example[```
// One red line at month 1, and a line spanning 2 months starting at month 4
#task("Task", (from: 0, to: 1, style: (stroke: red)), (3, 5))
```]
]
]
#command("taskgroup", arg("title", default: none), arg("tasks"))[
Groups tasks together in a box. If `title` is specified, a title will be
displayed, with a line spanning all the inner tasks.
#argument("title", types: ("content",), default: none)[
The title of the task group
]
#argument("tasks", types: ("content",))[
The tasks to display in the group
]
#example[```
#taskgroup(title: "Research", {
task("Task 1", (0, 1))
task("Task 2", (3, 5))
})
```]
]
#command(
"milestone",
arg("body"),
arg("at"),
arg("style"),
arg("overhang"),
arg("spacing"),
arg(anchor: "top"),
)[
Defines a milestone. The way it's displayed depends on the `milestone-layout`
option of the `#timeline` command.
#argument(
"at",
types: ("float",),
)[
The month at which the milestone should be displayed. Can be fractional.
]
#argument("style", types: ("dictionary",), default: ())[
Style for the milestone line. Defaults to `milestone-line-style`.
]
#argument(
"overhang",
types: ("length",),
default: 5pt,
)[
How far the milestone line should extend past the end of the timeline. Defaults
to `milestone-overhang`.
]
#argument("spacing", types: ("length",), default: 5pt)[
Spacing between the milestone line and the text. Defaults to `spacing`.
]
#argument(
"anchor",
types: ("string",),
default: "top",
)[
The anchor point for the milestone text. Can be `top`, `bottom`, `left`,
`right`, `top-left`, `top-right`, `bottom-left`, `bottom-right`, `center`,
`center-left`, `center-right`, `center-top`, `center-bottom`. Defaults to `top`.
]
#argument("body", types: ("content",))[
The text to display next to the milestone line
]
]