43 lines
946 B
Typst
43 lines
946 B
Typst
#let tb-start-date = datetime(year: 2026, month: 5, day: 11)
|
|
|
|
#let dates = state("dates")
|
|
|
|
#let week(
|
|
num: 1,
|
|
doc
|
|
) = {
|
|
set text(font: "Source Sans 3")
|
|
|
|
let start-date = tb-start-date + duration(days: (num - 1) * 7)
|
|
let end-date = start-date + duration(days: 6)
|
|
|
|
set document(
|
|
title: "TB Journal - Week " + str(num),
|
|
description: "Short logs of what happened during week " + str(num) + " of my TB",
|
|
author: "Louis Heredero",
|
|
date: start-date
|
|
)
|
|
|
|
set page(
|
|
header: context if counter(page).get().first() != 1 [TB Journal],
|
|
footer: context grid(
|
|
columns: (1fr, auto, 1fr),
|
|
[_Louis Heredero_],
|
|
counter(page).display("1 / 1")
|
|
)
|
|
)
|
|
|
|
dates.update((start: start-date, end: end-date))
|
|
|
|
align(
|
|
center,
|
|
title()
|
|
)
|
|
|
|
doc
|
|
}
|
|
|
|
#let day(num) = context {
|
|
let date = dates.get().start + duration(days: num - 1)
|
|
[= #date.display("[weekday]") (#date.display("[day].[month].[year]"))]
|
|
} |