Skip to content

Commit fc63051

Browse files
committed
✨ Finish the entry functions
1 parent d9919df commit fc63051

File tree

3 files changed

+169
-26
lines changed

3 files changed

+169
-26
lines changed

themes/hereford/colors.typ

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
#let dark-red = rgb("#e05c4a")
2+
#let light-dark-red = rgb("#f86f5d")
13
#let red = rgb("#e06666")
4+
#let light-red = rgb("#ea9999")
25
#let orange = rgb("#f6b26b")
36
#let light-orange = rgb("#fce5cd")
47
#let yellow = rgb("#ffd966")
58
#let light-yellow = rgb("#fff2cc")
6-
#let green = rgb("#44a176")
7-
#let light-green = rgb("#e1ffda")
9+
#let green = rgb("#93c47d")
10+
#let light-green = rgb("#d9ead3")
811
#let blue = rgb("#6d9eeb")
912
#let light-blue = rgb("#c9daf8")
1013
#let purple = rgb("#c4b0ff")

themes/hereford/entries.typ

Lines changed: 149 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,163 @@
1-
#let cover(ctx: (:)) = {}
1+
#import "./colors.typ": *
22

3-
#let frontmatter-entry(ctx: (:), body) = {
3+
#let entry-type-metadata = (
4+
identify: (
5+
color: red,
6+
text: "Identify",
7+
),
8+
brainstorm: (
9+
color: orange,
10+
text: "Brainstorm",
11+
),
12+
decide: (
13+
color: yellow,
14+
text: "Solution",
15+
),
16+
build: (
17+
color: green,
18+
text: "Build",
19+
),
20+
program: (
21+
color: blue,
22+
text: "Program",
23+
),
24+
test: (
25+
color: purple,
26+
text: "Test",
27+
),
28+
reflection: (
29+
color: pink,
30+
text: "Reflection",
31+
),
32+
management: (
33+
color: brown,
34+
text: "Management",
35+
),
36+
strategy: (
37+
color: gray,
38+
text: "Strategy",
39+
),
40+
)
41+
42+
#let heading-text-size = 14pt
43+
44+
#let cover(
45+
ctx: (:),
46+
) = { }
47+
48+
#let frontmatter-entry(
49+
ctx: (:),
50+
body,
51+
) = {
452
show: page.with(
5-
margin: (
6-
top: 5em,
7-
),
8-
header: {
9-
place(top + right, dx: 100pt, box(width: 250%, height: 100%, fill: gray))
10-
set align(center + horizon)
11-
box(radius: 0.3em, width: 200pt, outset: 9pt, fill: gray.darken(20%), [*#ctx.title*])
12-
}
53+
margin: (
54+
top: 5em,
55+
),
56+
header: {
57+
// background bar
58+
place(
59+
top + right,
60+
dx: 100pt,
61+
box(
62+
width: 250%,
63+
height: 100%,
64+
fill: surface-0,
65+
),
66+
)
67+
// the other thing
68+
set align(center + horizon)
69+
box(
70+
radius: 0.3em,
71+
width: 200pt,
72+
outset: 9pt,
73+
fill: surface-1,
74+
text(
75+
size: heading-text-size,
76+
weight: "bold",
77+
ctx.title,
78+
),
79+
)
80+
},
1381
)
1482

1583
body
1684
}
1785

18-
#let body-entry(ctx: (:), body) = {
86+
#let body-entry(
87+
ctx: (:),
88+
body,
89+
) = {
90+
let metadata = entry-type-metadata.at(ctx.type)
1991
show: page.with(
20-
header: [ = #ctx.title
21-
#box(width: 1fr, line(length: 100%)) ],
22-
footer: align(center, counter(page).display()),
92+
header: {
93+
// background bar
94+
place(
95+
top + left,
96+
dx: -100pt,
97+
box(
98+
width: 250%,
99+
height: 100%,
100+
fill: metadata.color.lighten(60%),
101+
),
102+
)
103+
// edp box
104+
place(
105+
horizon + left,
106+
box(
107+
radius: 0.3em,
108+
outset: 9pt,
109+
width: 90pt,
110+
fill: metadata.color,
111+
align(
112+
center,
113+
text(
114+
size: 14pt,
115+
weight: "bold",
116+
metadata.text,
117+
),
118+
),
119+
),
120+
)
121+
// title
122+
set align(center + horizon)
123+
text(
124+
weight: "bold",
125+
size: 14pt,
126+
ctx.title,
127+
)
128+
},
129+
footer: {
130+
place(
131+
dx: -50pt,
132+
box(
133+
fill: surface-0,
134+
width: 200%,
135+
height: 100%,
136+
),
137+
)
138+
set align(horizon + center)
139+
grid(
140+
columns: (
141+
1fr,
142+
1fr,
143+
1fr,
144+
),
145+
[*Name* #h(5pt) #ctx.author],
146+
[*Date* #h(5pt) #ctx.date.display("[month]/[day]/[year]")],
147+
[*Page* #h(5pt) #context counter(page).display()],
148+
)
149+
},
23150
)
24151

25152
body
26153
}
27-
#let appendix-entry(ctx: (:), body) = {
28-
show: page.with(
29-
header: [ = #ctx.title
30-
#box(width: 1fr, line(length: 100%)) ],
31-
footer: align(center, counter(page).display()),
32-
)
33154

34-
body
155+
#let appendix-entry(
156+
ctx: (:),
157+
body,
158+
) = {
159+
frontmatter-entry(
160+
ctx: ctx,
161+
body,
162+
)
35163
}

themes/hereford/format.typ

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
#let rules(doc) = {
2-
set page("us-letter")
3-
set text(font: "Roboto", size: 11pt)
1+
#let rules(
2+
doc,
3+
) = {
4+
set page(
5+
"us-letter",
6+
margin: (
7+
top: 2cm,
8+
x: 1.5cm,
9+
bottom: 1.5cm,
10+
),
11+
)
12+
set text(
13+
font: "Roboto",
14+
size: 11pt,
15+
)
416
doc
517
}

0 commit comments

Comments
 (0)