refine coursework v2 task fields

This commit is contained in:
ilyaoc
2026-05-20 12:37:09 +02:00
parent c9c0577ec8
commit cf8c2c8338
4 changed files with 67 additions and 13 deletions
+13 -2
View File
@@ -6,6 +6,7 @@
#import "./utils.typ" #import "./utils.typ"
#let dstu-table = style.dstu-table #let dstu-table = style.dstu-table
#let hfill = utils.hfill
/// Coursework template for NURE /// Coursework template for NURE
/// - university (str): University code, default "ХНУРЕ" /// - university (str): University code, default "ХНУРЕ"
@@ -31,7 +32,8 @@
bib-path: none, bib-path: none,
appendices: (), appendices: (),
) = { ) = {
set document(title: title, author: authors.map(c => c.name)) let doc-title = if type(title) == array { title.join(" ") } else { title }
set document(title: doc-title, author: authors.map(c => c.name))
show: style.dstu.with(skip: 1) show: style.dstu.with(skip: 1)
@@ -66,6 +68,7 @@
/// - task-list (dict): Task metadata /// - task-list (dict): Task metadata
/// - calendar-plan (dict): Calendar plan table /// - calendar-plan (dict): Calendar plan table
/// - abstract (dict): Keywords and abstract text /// - abstract (dict): Keywords and abstract text
/// - abstract-en (dict): Optional English keywords and abstract text
/// - bib-path (str): Path to bibliography file /// - bib-path (str): Path to bibliography file
/// - appendices (content): Appendix content /// - appendices (content): Appendix content
#let coursework-v2( #let coursework-v2(
@@ -77,6 +80,7 @@
task-list: (), task-list: (),
calendar-plan: (), calendar-plan: (),
abstract: (), abstract: (),
abstract-en: none,
bib-path: none, bib-path: none,
appendices: (), appendices: (),
faculty: "комп’ютерних наук", faculty: "комп’ютерних наук",
@@ -87,7 +91,8 @@
assert(authors.len() > 0, message: "At least one author required") assert(authors.len() > 0, message: "At least one author required")
assert(mentors.len() > 0, message: "At least one mentor required") assert(mentors.len() > 0, message: "At least one mentor required")
set document(title: title, author: authors.map(c => c.name)) let doc-title = if type(title) == array { title.join(" ") } else { title }
set document(title: doc-title, author: authors.map(c => c.name))
show: style.dstu.with(skip: 1) show: style.dstu.with(skip: 1)
@@ -97,6 +102,12 @@
bib-count.update(((..c)) => (..c, it.key)) bib-count.update(((..c)) => (..c, it.key))
} }
let abstract = if abstract-en != none {
abstract + (en: abstract-en)
} else {
abstract
}
tp.cw-v2.nure( tp.cw-v2.nure(
university, university,
title, title,
+7 -8
View File
@@ -1,7 +1,7 @@
#import "../../shared.typ": universities #import "../../shared.typ": universities
#import "../../helpers.typ": * #import "../../helpers.typ": *
#import "../../style.typ": spacing #import "../../style.typ": spacing
#import "../../utils.typ": bold, uline #import "../../utils.typ": bold, uline, filled-lines
#let note(content) = block(width: 100%, above: 5pt, below: 0pt)[ #let note(content) = block(width: 100%, above: 5pt, below: 0pt)[
#set text(size: 10pt) #set text(size: 10pt)
@@ -69,7 +69,7 @@
#let task-num(n) = box(str(n) + ".") #let task-num(n) = box(str(n) + ".")
#let title-field(value) = { #let title-field(value) = {
uline(align: center, value) uline(align: center, filled-lines(value))
uline(align: center, []) uline(align: center, [])
note[(тема)] note[(тема)]
} }
@@ -126,7 +126,7 @@
#set align(left) #set align(left)
#inline-label-line( #inline-label-line(
[Факультет], [Факультет],
faculty + " (або центр післядипломної освіти, або навчально-науковий центр заочної форми навчання)", faculty,
) )
#note([(повна назва)]) #note([(повна назва)])
@@ -201,8 +201,7 @@
( (
[Факультет], [Факультет],
( (
faculty + " (або центр післядипломної освіти, або", faculty,
"навчально-науковий центр заочної форми навчання)",
), ),
), ),
([Кафедра], edu-prog.department-gen), ([Кафедра], edu-prog.department-gen),
@@ -234,20 +233,20 @@
#v(1.0em) #v(1.0em)
#task-num(1) Тема роботи #uline(align: left)[#title] #task-num(1) Тема роботи #uline(align: left, filled-lines(title))
#v(0.4em) #v(0.4em)
#task-num(2) Термін здачі студентом закінченої роботи #task-num(2) Термін здачі студентом закінченої роботи
“#underline(task-list.done-date.display("[day]"))” #underline(month-gen(task-list.done-date.month())) #task-list.done-date.display("[year]")р. “#underline(task-list.done-date.display("[day]"))” #underline(month-gen(task-list.done-date.month())) #task-list.done-date.display("[year]")р.
#v(0.4em) #v(0.4em)
#task-num(3) Вихідні дані до проєкту #uline(align: left, task-list.at("source", default: [])) #task-num(3) Вихідні дані до проєкту #uline(align: left, filled-lines(task-list.at("source", default: [])))
#v(0.4em) #v(0.4em)
#uline(align: left, []) #uline(align: left, [])
#v(0.4em) #v(0.4em)
#task-num(4) Перелік питань, що потрібно опрацювати в роботі\ #task-num(4) Перелік питань, що потрібно опрацювати в роботі\
#uline(align: left, task-list.at("content", default: [])) #uline(align: left, filled-lines(task-list.at("content", default: [])))
#v(0.4em) #v(0.4em)
#uline(align: left, []) #uline(align: left, [])
+7
View File
@@ -7,6 +7,13 @@
/// fill horizontal space with a filled box /// fill horizontal space with a filled box
#let hfill(width) = box(width: width, repeat("")) // HAIR SPACE (U+200A) #let hfill(width) = box(width: width, repeat("")) // HAIR SPACE (U+200A)
/// convert an array of lines into filled lines for underlined task fields
#let filled-lines(content) = if type(content) == array {
content.map(line => [#line #hfill(1fr)]).join(linebreak())
} else {
content
}
/// underlined cell with centered content by default /// underlined cell with centered content by default
#let uline(align: center, content) = underline[ #let uline(align: center, content) = underline[
#if align != left { hfill(1fr) } #if align != left { hfill(1fr) }
+40 -3
View File
@@ -23,8 +23,16 @@
#let task-list = ( #let task-list = (
done-date: datetime(year: 2026, month: 12, day: 27), done-date: datetime(year: 2026, month: 12, day: 27),
initial-date: datetime(year: 2026, month: 9, day: 15), initial-date: datetime(year: 2026, month: 9, day: 15),
source: [], source: [
content: [], Узагальнити модель предметної області,
визначити основні сутності та зв'язки між ними.
Підготувати демонстраційний набір технологій для шаблону.
],
content: [
Опис предметної галузі, формування вимог,
архітектурне проєктування, тестування та
перевірка верстки пояснювальної записки.
],
) )
#let calendar-plan = ( #let calendar-plan = (
@@ -67,6 +75,31 @@
], ],
) )
#let abstract_en = (
keywords: (
"WEB APPLICATION",
"INFORMATION SYSTEM",
"COURSEWORK",
"SOFTWARE ENGINEERING",
"DEMO SAMPLE",
),
text: [
The purpose of this work is to demonstrate the formatting of a coursework
explanatory note using the new template variant.
The sample contains a generalized topic, typical pages for the assignment,
calendar plan, abstract, contents, bibliography, and appendices.
The work presents an illustrative structure of a software system that can be
adapted to a specific subject area. The main focus is on checking title-page
fields, assignment-page fields, signature blocks, section numbering, and
appendix handling.
The result is a demonstration document that shows the expected template usage
without being tied to a real student, supervisor, or completed project.
],
)
#let appendices = [ #let appendices = [
= Приклад звіту 1 = Приклад звіту 1
#v(-spacing) #v(-spacing)
@@ -83,12 +116,16 @@
] ]
#show: coursework-v2.with( #show: coursework-v2.with(
title: "Демонстраційна інформаційна система для комплексного курсового проєкту", title: (
"Демонстраційна інформаційна система для комплексного ",
"курсового проєкту",
),
authors: authors, authors: authors,
mentors: mentors, mentors: mentors,
task-list: task-list, task-list: task-list,
calendar-plan: calendar-plan, calendar-plan: calendar-plan,
abstract: abstract, abstract: abstract,
abstract-en: abstract_en,
bib-path: bytes(read("bibl.yml")), bib-path: bytes(read("bibl.yml")),
appendices: appendices, appendices: appendices,
) )