From 28f93156cbc41bf95be8b9f7b19fb87fbb7ed899 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Fri, 22 Aug 2025 21:48:12 +0300 Subject: [PATCH] feat: add documantation page --- examples/qualification-thesis/main.typ | 13 +++++- src/lib.typ | 16 ++++--- src/utils.typ | 65 +++++++++++++++++++++++++- template/main.typ | 6 ++- 4 files changed, 89 insertions(+), 11 deletions(-) diff --git a/examples/qualification-thesis/main.typ b/examples/qualification-thesis/main.typ index 3036e6b..08364c8 100644 --- a/examples/qualification-thesis/main.typ +++ b/examples/qualification-thesis/main.typ @@ -21,8 +21,19 @@ email: "zk67890@edu.lu.lv", ), ), - date: ( + advisors: ( + ( + title: "Mg. dat.", + name: "Ivars Ozoliņš", + ), + ), + reviewer: ( + name: "Jānis Ozols", + ), + date: datetime( year: 2025, + month: 1, + day: 1, ), place: "Rīga", bibliography: bibliography("bibliography.yml"), diff --git a/src/lib.typ b/src/lib.typ index 9024f75..0b7ff03 100644 --- a/src/lib.typ +++ b/src/lib.typ @@ -11,6 +11,7 @@ // location, and email. Everything but but the `name` and `code` is optional. authors: (), advisors: (), + reviewer: (), // The paper's abstract. Can be omitted if you don't have one. abstract: ( primary: ( @@ -33,11 +34,7 @@ university: "Latvijas Universitāte", faculty: [Eksakto zinātņu un tehnoloģiju fakultāte\ Datorikas nodaļa], thesis-type: "Bakalaura darbs", - date: ( - year: none, - month: none, - day: none, - ), + date: datetime.today(), place: none, logo: none, outline-title: "SATURS", @@ -253,5 +250,12 @@ // Display bibliography. bibliography - make-documentary-page() + make-documentary-page( + title, + authors, + advisors, + reviewer, + thesis-type, + date, + ) } diff --git a/src/utils.typ b/src/utils.typ index 8ed5898..bfe2a8c 100644 --- a/src/utils.typ +++ b/src/utils.typ @@ -92,7 +92,68 @@ v(0.5fr) - align(center, upper([#place #date.year])) + align(center, upper([#place #date.year()])) } -#let make-documentary-page() = {} +#let make-documentary-page( + title, + authors, + advisors, + reviewer, + thesis-type, + date, +) = { + let vspace = 1fr + set page(numbering: none) + + let formatted-date = strong(date.display("[day].[month].[year].")) + + heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa") + [ + #thesis-type "*#title*" ir + izstrādāts Latvijas Universitātes Eksakto zinātņu un tehnoloģiju fakultātē, + Datorikas nodaļā. + + #v(vspace / 3) + Ar savu parakstu apliecinu, ka darbs izstrādāts patstāvīgi, izmantoti tikai tajā + norādītie informācijas avoti un iesniegtā darba elektroniskā kopija atbilst + izdrukai un/vai recenzentam uzrādītajai darba versijai. + ] + + context { + set par( + first-line-indent: 1cm, + hanging-indent: 1cm, + ) + + v(vspace / 2) + + [ + #if authors.len() > 1 { "Autori: " } else { "Autors: " } + #authors.map(author => [*#author.name, #author.code*]).join(", ") + ~ #formatted-date + ] + + v(vspace) + [ + Rekomendēju darbu aizstāvēšanai\ + #if advisors.len() > 0 [ + Darba #if advisors.len() > 1 { "vadītāji:" } else { "vadītājs:" } + #advisors.map(advisor => [*#advisor.title #advisor.name*]).join("\n") + ~ #formatted-date + ] + ] + + v(vspace) + [Recenzents: *#reviewer.name*] + + + v(vspace) + [ + Darbs iesniegs #formatted-date\ + Kvalifikācijas darbu pārbaudījumu komisijas sekretārs (elektronisks paraksts) + ] + + v(vspace) + } +} diff --git a/template/main.typ b/template/main.typ index 10ef921..5a6e289 100644 --- a/template/main.typ +++ b/template/main.typ @@ -22,9 +22,11 @@ name: "Ivars Ozoliņš", ), ), - date: ( + date: datetime( year: 2025, - ), + month: 1, + day: 1, + ), // defaults to datetime.today() place: "Rīga", bibliography: bibliography("bibliography.yml"), abstract: (