Student Card
A compact student information card, suitable for printing or digital display.
Template
templates/student/student-card.typ
typst
#let data = json.decode(sys.inputs.at("data"))
#set page(
width: 8cm,
height: 12cm,
margin: 0.5cm,
)
#rect(
width: 100%,
height: 100%,
fill: white,
stroke: 1pt + gray,
)[
#v(0.3cm)
#align(center, text(size: 14pt, weight: "bold")[#data.name])
#v(0.1cm)
#align(center, text(size: 10pt, fill: gray)[#data.course])
#v(0.5cm)
#line(length: 100%, stroke: 0.5pt + gray)
#v(0.3cm)
#grid(
columns: (1fr, 1fr),
[Student ID:], [#data.studentId],
[Grade:], [#data.grade],
[Status:], [#data.status],
)
#v(0.5cm)
#line(length: 100%, stroke: 0.5pt + gray)
#v(0.3cm)
#text(size: 8pt, fill: gray)[Issued: #data.date]
]Metadata
templates/student/student-card.json
json
{
"title": "Student Card",
"description": "Compact student information card",
"exampleData": {
"name": "Alice Johnson",
"course": "Mathematics",
"studentId": "STU-2024-0042",
"grade": "A",
"status": "Active",
"date": "2024-03-15"
}
}Usage
bash
curl -X POST http://localhost:3000/api/report \
-H "Content-Type: application/json" \
-d '{
"template": "student/student-card",
"data": {
"name": "Alice Johnson",
"course": "Mathematics",
"studentId": "STU-2024-0042",
"grade": "A",
"status": "Active",
"date": "2024-03-15"
}
}' \
-o student-card.pdf