First Commit
This commit is contained in:
35
main.typ
Normal file
35
main.typ
Normal file
@@ -0,0 +1,35 @@
|
||||
#import "rfc.typ": rfc-document
|
||||
|
||||
#rfc-document(
|
||||
title: "A Structured Report on Typst Integration",
|
||||
number: 9999,
|
||||
status: "Informational",
|
||||
category: "General",
|
||||
authors: ("Jane Doe", "John Smith"),
|
||||
date: datetime(year: 2026, month: 5, day: 5),
|
||||
)[
|
||||
= 1. Introduction
|
||||
This document demonstrates the `rfc-typst` package. It provides a clean,
|
||||
RFC-compliant layout with automatic headers, footers, and structured headings.
|
||||
|
||||
= 2. Architecture
|
||||
The system follows a modular design. Below is a simplified component diagram:
|
||||
|
||||
/*
|
||||
#rfc-ascii[
|
||||
+----------+ +----------+ +----------+
|
||||
| Client |---->| Proxy |---->| Server |
|
||||
+----------+ +----------+ +----------+
|
||||
]
|
||||
*/
|
||||
== 2.1. Data Flow
|
||||
1. Client sends request
|
||||
2. Proxy validates & forwards
|
||||
3. Server processes & responds
|
||||
|
||||
= 3. Security Considerations
|
||||
All communication is encrypted using TLS 1.3. Refer to RFC 8446 for details.
|
||||
|
||||
= 4. References
|
||||
#link("https://datatracker.ietf.org/doc/html/rfc8446")[RFC 8446]
|
||||
]
|
||||
60
rfc.typ
Normal file
60
rfc.typ
Normal file
@@ -0,0 +1,60 @@
|
||||
#let rfc-document(
|
||||
title: "Untitled Report",
|
||||
short_title: "",
|
||||
number: 0000,
|
||||
status: "Informational",
|
||||
category: "General",
|
||||
authors: (),
|
||||
date: datetime.today(),
|
||||
frontmatter: content,
|
||||
body
|
||||
) = {
|
||||
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()
|
||||
}}
|
||||
|
||||
body
|
||||
}
|
||||
11
typst.toml
Normal file
11
typst.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
[package]
|
||||
name = "nviam-rfc"
|
||||
version = "0.1.0"
|
||||
entrypoint = "rfc.typ"
|
||||
compiler = "0.11.0"
|
||||
description = "A Typst package for writing structured technical reports in RFC style."
|
||||
keywords = ["rfc", "report", "technical", "documentation", "template"]
|
||||
categories = ["report", "template"]
|
||||
license = "MIT"
|
||||
repository = "https://git.nviam.dev/typst/rfc"
|
||||
authors = ["Pedro E. Díaz <ppedroediaz@gmail.com>"]
|
||||
Reference in New Issue
Block a user