diff --git a/README.md b/README.md index 2f33faa..7f4185a 100644 --- a/README.md +++ b/README.md @@ -40,12 +40,16 @@ typst init @local/nure:0.0.0 project-name Include lib.typ in your project and utilize the provided functions: ```typst -// Import the template -#import "lib.typ": * +// Import the template either from a local package... +#import "@local/nure:0.0.0": * +// ...or by importing a lib.typ directly from a project's root directory +// #import "lib.typ": * // Setup the document -#show: lab-pz-template.with( +#show: pz-lb-template.with( title: "Some title", + // etc: "and so on", + // ... ) // this template automatically inserts a `=title` diff --git a/lib.typ b/lib.typ index 4b3775a..7f470b3 100644 --- a/lib.typ +++ b/lib.typ @@ -15,14 +15,16 @@ /// education program abbreviations to name & number #let edu_programs = ( "ПЗПІ": ( + name: "ПЗПІ", // i don't like it + name-long: "Інженерія програмного забезпечення", department_gen: "Програмної інженерії", - name: "Інженерія програмного забезпечення", - number: 121, // TODO: ПЗПІ is "F2" now + code: 121, // TODO: ПЗПІ is "F2" now ), "КУІБ": ( + name: "КУІБ", // i don't like it + name-long: "Управління інформаційною безпекою", department_gen: "Інфокомунікацій", - name: "Управління інформаційною безпекою", - number: 125, + code: 125, ), ) @@ -393,7 +395,7 @@ linebreak() uline(align: left, subjects.at(subject_short)) linebreak() - uline(align: left, [#edu_program.number #edu_program.name]) + uline(align: left, [#edu_program.code #edu_program.name-long]) }, ) grid( @@ -667,16 +669,16 @@ /// - subject_short (str): Subject short name. /// - worknumber (int): Number of the work, can be omitted. /// - authors ((name: str, full_name_gen: str, variant: int, group: str, gender: str),): List of Authors dicts. -/// - mentors (name: str, gender: str or none, degree: str): Mentors objects. -#let lab-pz-template( +/// - mentors ((name: str, degree: str, gender: str or none): Mentors objects. +#let pz-lb-template( doc, - doctype: "NONE", - edu_program_short: "ПЗПІ", - title: "NONE", - subject_short: "NONE", + doctype: none, + edu_program_short: edu_programs.keys().first(), + title: none, + subject_short: none, worknumber: 1, authors: (), - mentors: (gender: none), + mentors: (), ) = { set document(title: title, author: authors.at(0).name) @@ -713,7 +715,7 @@ let author = authors.at(0) if author.gender == "m" [Виконав:\ ] else [Виконала:\ ] [ - ст. гр. #author.edu_program\-#author.group\ + ст. гр. #edu_program.name\-#author.group\ #author.name\ ] if author.variant != none [Варіант: №#author.variant] diff --git a/template/lab.typ b/template/lab.typ index 647af5e..4dabe14 100644 --- a/template/lab.typ +++ b/template/lab.typ @@ -1,6 +1,6 @@ #import "@local/nure:0.0.0": * -#show: lab-pz-template.with( +#show: pz-lb-template.with( doctype: "ЛБ", edu_program_short: "ПЗПІ", title: "Інформаційна система «Помічник класного керівника». Керування класом",