10 Commits

Author SHA1 Message Date
41dcbeb1ec feat!: bump version to 0.1.0
fix: adjust templates
style: reformat lib.typ w/ 120 column width
2025-03-13 12:37:58 +02:00
429f632841 fix!: remove unnecessary gender key in cw_template
fix: add more subjects
docs: unify comments with pz_lb_template
2025-03-13 12:35:12 +02:00
b3214e2150 feat!: rename some parametes to avoid redundancy
fix: avoid hard-coded defaults
docs(readme): add more detail
2025-03-13 12:12:57 +02:00
d60d3a9c89 misc: change .gitignore to ignore all pdf files 2025-03-12 23:21:33 +02:00
63dbd82e4d docs(readme): update structure 2025-03-12 23:15:40 +02:00
0b8ceda4f1 feat!: rename "lab-pz-template" to "pz-lb-template"
feat!: make authors.*.edu_program optional, derive it from edu_program_short instead
docs: minor changes to readme and lab template
2025-03-12 23:02:32 +02:00
cf10e0fbdc style: format in 120 column width 2025-03-12 20:42:17 +02:00
33d067b67e feat!: move department_gen to edu_programs
feat!: rename "shorthand" variables to "short"
WIP: feat!: derive group name from edu_program
docs(template): adjust templates accordingly
style: format with typstyle
2025-03-12 20:24:48 +02:00
0e0dc20e9b fix: remove unnecessary variable 2025-03-12 19:11:06 +02:00
b8a309ad2c feat!: change mentor to mentors for lab-pz
feat: implement plural mentor referral
fix: added subject and edu_program
style: format with typstyle
2025-03-12 19:08:41 +02:00
6 changed files with 175 additions and 96 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
template.pdf
*.pdf

View File

@ -9,7 +9,7 @@ This project contains two template functions and some utilities for writing NURE
#### `pz-lb-template` - For Laboratory and Practical Works
This template:
- Sets up document styles;
- Formats the title page according to NURE guidelines.
- Formats the title page according to NURE/DSTU guidelines.
#### `cw-template` - For Course Works
This template:
@ -29,30 +29,41 @@ This template:
### As a local typst package
1. Clone this repository into ~/.local/share/typst/packages/:
```bash
git clone https://gitea.linerds.us/pencelheimer/typst_nure_template.git ~/.local/share/typst/packages/local/nure/0.0.0
git clone https://gitea.linerds.us/pencelheimer/typst_nure_template.git ~/.local/share/typst/packages/local/nure/0.1.0
```
2. Init your project with Typst:
```bash
typst init @local/nure:0.0.0 project-name
typst init @local/nure:0.1.0 project-name
```
### As a file in your project
Include lib.typ in your project and utilize the provided functions:
### As a standalone file
Copy `lib.typ` to your project's root directory.
### In your project
```typst
// Import the template
#import "lib.typ": *
// Import the template either from a local package...
#import "@local/nure:0.1.0": *
// ...or by importing a lib.typ directly
// #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`
// Write your content
// Write your content...
#v(-spacing) // remove spacing between headings
== Purpose
Some text
// ...or include your modules
// NOTE: you have to import a package or a lib.typ in each module.
#include "src/intro.typ"
#include "src/chapter1.typ"
#include "src/chapter2.typ"
```
### Notes:
@ -60,12 +71,24 @@ Some text
### Example Project Structure
```
project-folder/
├── main.typ
├── template.typ
├── images/
│ ├── figure1.png
│ ├── figure2.png
── ...
├── ...
project/
├── main.typ -- for importing, configuration and boilerplate
├── src/
├── intro.typ
│ ├── chapter1.typ
│ ├── chapter2.typ
── ...
├── figures/
│ ├── chapter1/
│ │ ├── figure1.png
│ │ ├── figure2.png
│ │ ├── figure3.png
│ │ └── ...
│ ├── chapter2/
│ │ ├── figure1.png
│ │ ├── figure2.png
│ │ ├── figure3.png
│ │ └── ...
│ └── ...
└── ...
```

148
lib.typ
View File

@ -4,18 +4,29 @@
/// subject abbreviations to full names
#let subjects = (
"БД": "Бази даних",
"БЖД": "Безпека життєдіяльності",
"ОІМ": "Основи IP-мереж",
"ОПНJ": "Основи програмування на Java",
"ОС": "Операційні системи",
"ОТК": "Основи теорії кіл",
"ПП": "Проектний практикум",
"СПМ": "Скриптові мови програмування",
"УФМ": "Українське фахове мовлення",
"Ф": "Філософія",
"ФІЗ": "Фізика",
)
/// education program abbreviations to name & number
#let edu_programs = (
"ПЗПІ": (
name: "Інженерія програмного забезпечення",
number: 121, // TODO: ПЗПІ is "F2" now
name-long: "Інженерія програмного забезпечення",
department_gen: "Програмної інженерії",
code: 121, // TODO: ПЗПІ is "F2" now
),
"КУІБ": (
name-long: "Управління інформаційною безпекою",
department_gen: "Інфокомунікацій",
code: 125,
),
)
@ -25,7 +36,10 @@
#let nheading(title) = heading(depth: 1, numbering: none, title)
/// fill horizontal space with a box and not an empty space
#let hfill(width) = box(width: width, repeat("")) // NOTE: This is a HAIR SPACE (U+200A), not a regular space
#let hfill(width) = box(
width: width,
repeat(""),
) // NOTE: This is a HAIR SPACE (U+200A), not a regular space
/// make underlined cell with filled value
#let uline(align: center, content) = underline[
@ -68,7 +82,9 @@
#let img(path, caption, ..sink) = {
let parts = path.split(".").first().split("/")
let label_string = if parts.len() <= 2 or parts.at(-1).starts-with(parts.at(-2)) {
let label_string = if (
parts.len() <= 2 or parts.at(-1).starts-with(parts.at(-2))
) {
// ("image",), (_, "image") and (.., "img", "img_image")
parts.last()
} else {
@ -107,7 +123,12 @@
},
)
set text(font: ("Times New Roman", "Liberation Serif"), size: 14pt, hyphenate: false, lang: "uk")
set text(
font: ("Times New Roman", "Liberation Serif"),
size: 14pt,
hyphenate: false,
lang: "uk",
)
set par(justify: true, first-line-indent: (amount: 1.25cm, all: true))
set underline(evade: false)
@ -117,7 +138,11 @@
set par(leading: spacing)
// enums and lists {{{2
set enum(numbering: i => { ua_alpha_numbering.at(i) + ")" }, indent: 1.25cm, body-indent: 0.5cm)
set enum(
numbering: i => { ua_alpha_numbering.at(i) + ")" },
indent: 1.25cm,
body-indent: 0.5cm,
)
show enum: it => {
set enum(indent: 0em, numbering: "1)")
it
@ -144,8 +169,20 @@
counter(figure.where(kind: raw)).update(0)
it
}
set math.equation(numbering: (..num) => numbering("(1.1)", counter(heading).get().at(0), num.pos().first()))
set figure(numbering: (..num) => numbering("1.1", counter(heading).get().at(0), num.pos().first()))
set math.equation(
numbering: (..num) => numbering(
"(1.1)",
counter(heading).get().at(0),
num.pos().first(),
),
)
set figure(
numbering: (..num) => numbering(
"1.1",
counter(heading).get().at(0),
num.pos().first(),
),
)
// appearance of references to images and tables {{{2
set ref(
@ -233,11 +270,10 @@
/// -> content
/// - doc (content): Content to apply the template to.
/// - title (str): Title of the document.
/// - subject_shorthand (str): Subject short name.
/// - department_gen (str): Department name in genitive form.
/// - authors ((name: str, full_name_gen: str, variant: int, group: str, gender: str),): List of Authors dicts.
/// - mentors ((name: str, gender: str, degree: str),): List of mentors dicts.
/// - edu_program_shorthand (str): Education program shorthand.
/// - subject (str): Subject short name.
/// - authors ((name: str, full_name_gen: str, variant: int, group: str, gender: str),): List of authors.
/// - mentors ((name: str, degree: str),): List of mentors.
/// - edu_program (str): Education program shorthand.
/// - task_list (done_date: datetime, initial_date: datetime, source: (content | str), content: (content | str), graphics: (content | str)): Task list object.
/// - calendar_plan ( plan_table: (content | str), approval_date: datetime): Calendar plan object.
/// - abstract (keywords: (str, ), text: (content | str)): Abstract object.
@ -245,12 +281,11 @@
/// - appendices (content): Content with appendices.
#let cw-template(
doc,
title: "NONE",
subject_shorthand: "NONE",
department_gen: "Програмної інженерії",
title: none,
subject: none,
author: (),
mentors: (),
edu_program_shorthand: "ПЗПІ",
edu_program: none,
task_list: (),
calendar_plan: (),
abstract: (),
@ -273,7 +308,7 @@
let head_mentor = mentors.at(0)
let edu_program = edu_programs.at(edu_program_shorthand)
let edu_prog = edu_programs.at(edu_program)
// page 1 {{{2
[
@ -284,7 +319,7 @@
\
Кафедра Програмної інженерії
Кафедра #edu_prog.department_gen
\
@ -292,7 +327,7 @@
ДО КУРСОВОЇ РОБОТИ
з дисципліни: "#subjects.at(subject_shorthand, default: "NONE")"
з дисципліни: "#subjects.at(subject, default: "NONE")"
Тема роботи: "#title"
@ -358,11 +393,11 @@
Спеціальність
],
{
uline(align: left, department_gen)
uline(align: left, edu_prog.department_gen)
linebreak()
uline(align: left, subjects.at(subject_shorthand))
uline(align: left, subjects.at(subject))
linebreak()
uline(align: left, [#edu_program.number #edu_program.name])
uline(align: left, [#edu_prog.code #edu_prog.name-long])
},
)
grid(
@ -495,12 +530,17 @@
for i in range(n) {
for j in range(0, n - i - 1) {
if (
(not is_cyrillic(keywords.at(j)) and is_cyrillic(keywords.at(j + 1)))
(
not is_cyrillic(keywords.at(j)) and is_cyrillic(keywords.at(j + 1))
)
or (
is_cyrillic(keywords.at(j)) == is_cyrillic(keywords.at(j + 1)) and keywords.at(j) > keywords.at(j + 1)
)
) {
(keywords.at(j), keywords.at(j + 1)) = (keywords.at(j + 1), keywords.at(j))
(keywords.at(j), keywords.at(j + 1)) = (
keywords.at(j + 1),
keywords.at(j),
)
}
}
}
@ -626,43 +666,44 @@
/// -> content
/// - doc (content): Content to apply the template to.
/// - doctype ("ЛБ" | "ПЗ"): Document type.
/// - edu_program (str): Education program shorthand.
/// - title (str): Title of the document.
/// - subject_shorthand (str): Subject short name.
/// - department_gen (str): Department name in genitive form.
/// - 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.
/// - mentor (name: str, gender: str, degree: str): Mentors objects.
#let lab-pz-template(
/// - subject (str): Subject shorthand.
/// - authors ((name: str, full_name_gen: str, group: str, gender: str, variant: int or none),): List of authors.
/// - mentors ((name: str, degree: str, gender: str or none),): List of mentors.
/// - worknumber (int or none): Number of the work. Optional.
#let pz-lb-template(
doc,
doctype: "NONE",
title: "NONE",
subject_shorthand: "NONE",
department_gen: "Програмної інженерії",
worknumber: 1,
doctype: none,
edu_program: none,
title: none,
subject: none,
worknumber: none,
authors: (),
mentor: (),
mentors: (),
) = {
set document(title: title, author: authors.at(0).name)
show: style
context counter(heading).update(worknumber - 1)
// page 1 {{{2
align(center)[
МІНІСТЕРСТВО ОСВІТИ І НАУКИ УКРАЇНИ \
ХАРКІВСЬКИЙ НАЦІОНАЛЬНИЙ УНІВЕРСИТЕТ РАДІОЕЛЕКТРОНІКИ
\ \
Кафедра #department_gen
Кафедра #edu_programs.at(edu_program).department_gen
\ \ \
Звіт \
з
#if doctype == "ЛБ" [лабораторної роботи] else [практичної роботи]
#if worknumber != none [ #worknumber]
#if worknumber != none {
context counter(heading).update(worknumber - 1)
[#worknumber]
}
з дисципліни: "#subjects.at(subject_shorthand, default: "UNLNOWN SUBJECT, PLEASE OPEN AN ISSUE")"
з дисципліни: "#subjects.at(subject, default: "UNKNOWN SUBJECT, PLEASE OPEN AN ISSUE")"
з теми: "#title"
@ -675,7 +716,7 @@
let author = authors.at(0)
if author.gender == "m" [Виконав:\ ] else [Виконала:\ ]
[
ст. гр. #author.group\
ст. гр. #edu_program\-#author.group\
#author.name\
]
if author.variant != none [Варіант: #author.variant]
@ -688,9 +729,24 @@
#colbreak()
#set align(right)
#if mentor.gender == "m" { [Перевірив:\ ] } else { [Перевірила:\ ] }
#mentor.degree #if mentor.degree.len() >= 15 [\ ]
#mentor.name\
#if mentors.len() == 1 {
let mentor = mentors.at(0)
if mentor.gender == none [Перевірили:\ ] else if (
mentor.gender == "m"
) [Перевірив:\ ] else [Перевірилa:\ ]
[
#mentor.degree\
#mentor.name\
]
} else [
Перевірили:\
#for mentor in mentors {
[
#mentor.degree\
#mentor.name\
]
}
]
]
#v(1fr)

View File

@ -4,26 +4,14 @@
name: "Ситник Є. С.",
full_name_gen: "Ситника Єгора Сергійовича",
variant: 13,
group: "ПЗПІ-23-2",
group: "23-2",
gender: "m",
)
#let mentors = (
(
name: "Черепанова Ю. Ю.",
gender: "f",
degree: "Ст. викл. каф. ПІ",
),
(
name: "Русакова Н. Є.",
gender: "f",
degree: "Доц. каф. ПІ",
),
(
name: "Широкопетлєва М. С.",
gender: "f",
degree: "Ст. викл. каф. ПІ",
),
(name: "Черепанова Ю. Ю.", degree: "Ст. викл. каф. ПІ"),
(name: "Русакова Н. Є.", degree: "Доц. каф. ПІ"),
(name: "Широкопетлєва М. С.", degree: "Ст. викл. каф. ПІ"),
)
#let task_list = (
@ -69,11 +57,26 @@
"SQL",
),
text: [
Мета даної роботи -- проєктування та розробка інформаційної системи «Помічник класного керівника. Керування класом», яка спрямована на автоматизацію процесів управління класом, облік даних про учнів, планування та аналіз навчального процесу. Основна задача інформаційної системи спростити роботу класного керівника, забезпечити ефективну організацію документації та взаємодію з учасниками освітнього процесу.
Мета даної роботи -- проєктування та розробка інформаційної системи «Помічник
класного керівника. Керування класом», яка спрямована на автоматизацію процесів
управління класом, облік даних про учнів, планування та аналіз навчального
процесу. Основна задача інформаційної системи спростити роботу класного
керівника, забезпечити ефективну організацію документації та взаємодію з
учасниками освітнього процесу.
Для реалізації системи було використано сучасний стек технологій, а саме: Go -- як основна мова програмування для створення серверної логіки, HTMX -- для динамічного оновлення інтерфейсу без використання складних фреймворків, MySQL -- як СУБД для зберігання даних про учнів, їх оцінки та розклад, Neovim -- як середовище для швидкої та ефективної розробки коду, Go Echo -- веб-фреймворк для створення REST API, Go SQLx -- бібліотека для роботи з базою даних, що забезпечує зручність і гнучкість.
Для реалізації системи було використано сучасний стек технологій, а саме: Go --
як основна мова програмування для створення серверної логіки, HTMX -- для
динамічного оновлення інтерфейсу без використання складних фреймворків, MySQL --
як СУБД для зберігання даних про учнів, їх оцінки та розклад, Neovim -- як
середовище для швидкої та ефективної розробки коду, Go Echo -- веб-фреймворк для
створення REST API, Go SQLx -- бібліотека для роботи з базою даних, що
забезпечує зручність і гнучкість.
Результат роботи веб-додаток, який дозволяє обліковувати особисті дані учнів та їхніх опікунів, включаючи інформацію про успішність, відвідуваність та інші показники; планувати розклад занять; генерувати звіти про успішність учнів та переглядати різну статистику. Інтерфейс, створений з використанням HTMX, легко адаптується під потреби користувача.
Результат роботи веб-додаток, який дозволяє обліковувати особисті дані учнів
та їхніх опікунів, включаючи інформацію про успішність, відвідуваність та інші
показники; планувати розклад занять; генерувати звіти про успішність учнів та
переглядати різну статистику. Інтерфейс, створений з використанням HTMX, легко
адаптується під потреби користувача.
],
)
@ -94,9 +97,8 @@
#show: cw-template.with(
title: "Інформаційна система «Помічник класного керівника». Керування класом",
subject_shorthand: "БД",
department_gen: "Програмної інженерії",
edu_program_shorthand: "ПЗПІ",
subject_short: "БД",
edu_program_short: "ПЗПІ",
author: author,
mentors: mentors,
task_list: task_list,

View File

@ -1,10 +1,11 @@
#import "@local/nure:0.0.0": *
#import "@local/nure:0.1.0": *
#show: lab-pz-template.with(
#show: pz-lb-template.with(
doctype: "ЛБ",
edu_program: "ПЗПІ",
subject: "БД",
worknumber: 1,
title: "Інформаційна система «Помічник класного керівника». Керування класом",
subject_shorthand: "БД",
department_gen: "Програмної інженерії",
authors: (
(
name: "Ситник Є. С.",
@ -14,12 +15,9 @@
gender: "m",
),
),
mentor: (
name: "Черепанова Ю. Ю.",
gender: "f",
degree: "Ст. викл. каф. ПІ",
mentors: (
(name: "Черепанова Ю. Ю.", degree: "Ст. викл. каф. ПІ", gender: "f"),
),
worknumber: 1,
)
#v(-spacing)

View File

@ -1,6 +1,6 @@
[package]
name = "nure"
version = "0.0.0"
version = "0.1.0"
entrypoint = "lib.typ"
authors = ["linerds"]
license = "GPL-3.0"