forked from The-Notebookinator/notebookinator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.typ
More file actions
48 lines (44 loc) · 1.38 KB
/
Copy pathlib.typ
File metadata and controls
48 lines (44 loc) · 1.38 KB
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
#import "./internals.typ": *
#import "./entries.typ": *
#import "./utils.typ"
#import "./themes/themes.typ"
#import "./glossary.typ"
/// The base notebook template. This function is meant to be applied to your entire document as a show rule.
///
/// *Example Usage:*
///
/// ```typ
/// #import themes.default: default-theme
///
/// #show: notebook.with(
/// theme: default-theme
/// )
/// ```
/// - team-name (string): The name of your team.
/// - season (string): The name of the current season.
/// - year (string): The years in which the notebook is being written.
/// - theme (theme): The theme that will be applied to all of the entries. If no theme is specified, it will fall back on the default theme.
/// - cover (content): The title page of the notebook.
/// - body (content): The content of the notebook. This will be ignored. Use the create-entry functions instead.
/// -> content
#let notebook(
team-name: none,
season: none,
year: none,
cover: none,
theme: (:),
body,
) = {
let rules = theme.rules
show: doc => rules(doc)
let cover-content = if cover == none {
let ctx = (team-name: team-name, season: season, year: year)
print-cover(ctx: ctx, theme: theme)
} else {
cover
}
page(margin: 0pt, cover-content)
page[] // Filler page
print-entries(theme: theme)
body // FIXME: this should be ignored, but the document doesn't properly render without it.
}