59 lines
1.2 KiB
Typst
59 lines
1.2 KiB
Typst
#let rfc-document(
|
|
title: "Untitled Report",
|
|
short_title: "",
|
|
number: 0000,
|
|
status: "Informational",
|
|
category: "General",
|
|
authors: (),
|
|
date: datetime.today(),
|
|
frontmatter: content,
|
|
) = {
|
|
set text(font: "DejaVu Sans Mono")
|
|
show heading: set text(size: 12pt )
|
|
show heading: set block(below: 1em)
|
|
|
|
set page( header: context{
|
|
if counter(page).get().first() == 1 {
|
|
let author_str = ""
|
|
for author in authors {
|
|
author_str += author
|
|
}
|
|
|
|
grid(
|
|
columns: (1fr, 1fr),
|
|
align: (left, right),
|
|
[NVIAM Non Serviam\ Request for Comments: #number \ Category: #category ], [ #for author in authors {[#author \ ]} #date.display()],
|
|
)
|
|
} else {
|
|
let s_title = short_title
|
|
|
|
if s_title.len() == 0 {
|
|
s_title = title
|
|
}
|
|
|
|
grid(
|
|
columns: (1fr, 1fr, 1fr),
|
|
align: (left, center, right),
|
|
[NVIAM #number], [*#s_title*], [#date.display()],
|
|
)
|
|
}
|
|
})
|
|
|
|
set page( footer: context{
|
|
if counter(page).get().first() > 1 {
|
|
grid(
|
|
columns: (1fr, 1fr, 1fr),
|
|
align: (left, center, right),
|
|
[#authors.first()], [#status], [Page #counter(page).display()],
|
|
)
|
|
}
|
|
})
|
|
|
|
context {if counter(page).get().first() == 1 {
|
|
align(center)[*#title*]
|
|
outline()
|
|
pagebreak()
|
|
}}
|
|
|
|
}
|