reimplement appendices

This commit is contained in:
2025-02-21 15:06:28 +02:00
parent a761f36a02
commit 09fc15a8c9
3 changed files with 43 additions and 43 deletions

Binary file not shown.

View File

@ -77,20 +77,14 @@
], ],
) )
#let appendices = ( #let appendices = [
( = Приклад звіту 1
title: "Приклад звіту 1", test
content: [test], = Приклад звіту 2
), test
( = Приклад звіту 3
title: "Приклад звіту 2", test
content: [test], ]
),
(
title: "Приклад звіту 3",
content: [test],
),
)
#show: cw-template.with( #show: cw-template.with(
title: "Інформаційна система «Помічник класного керівника». Керування класом", title: "Інформаційна система «Помічник класного керівника». Керування класом",

View File

@ -88,6 +88,8 @@
} }
// Styling {{{1 // Styling {{{1
/// NOTE: may be wrong
#let ua_alpha_numbering = "абвгдежиклмнпрстуфхцшщюя".split("") // 0 = "", 1 = "а"
// general outlook {{{2 // general outlook {{{2
// spacing between lines // spacing between lines
@ -115,16 +117,7 @@
set par(leading: spacing) set par(leading: spacing)
// enums and lists {{{2 // enums and lists {{{2
let ua_alph_numbering() = { set enum(numbering: i => { ua_alpha_numbering.at(i) + ")" }, indent: 1.25cm, body-indent: 0.5cm)
// INFO: This alphabet is not full, maybe it should be extended or maybe not.
// I cant remember nor find proper formatting rules.
// "абвгґдеєжзиіїйклмнопрстуфхцчшщьюя" (full alphabet)
let alphabet = "абвгдежиклмнпрстуфхцшщюя".split("")
i => { alphabet.at(i) + ")" }
}
set enum(numbering: ua_alph_numbering(), indent: 1.25cm, body-indent: 0.5cm)
show enum: it => { show enum: it => {
set enum(indent: 0em, numbering: "1)") set enum(indent: 0em, numbering: "1)")
it it
@ -237,7 +230,7 @@
/// - calendar_plan ( plan_table: (content | str), approval_date: datetime): Calendar plan object. /// - calendar_plan ( plan_table: (content | str), approval_date: datetime): Calendar plan object.
/// - abstract (keywords: (str, ), text: (content | str)): Abstract object. /// - abstract (keywords: (str, ), text: (content | str)): Abstract object.
/// - bib_path path: Path to the bibliography yaml file. /// - bib_path path: Path to the bibliography yaml file.
/// - appendices ((title: str, content: content, ): List of appendices objects. /// - appendices (content): Content with appendices.
#let cw-template( #let cw-template(
doc, doc,
title: "NONE", title: "NONE",
@ -579,26 +572,39 @@
{ {
counter(heading).update(0) counter(heading).update(0)
for (i, appendix) in appendices.enumerate() [ set heading(
#set heading( numbering: (i, ..nums) => {
numbering: i => [ let char = upper(ua_alpha_numbering.at(i))
Додаток #"АБВГДЕЖИКЛМНПРСТУФХЦШЩЮЯ".split("").at(i) if nums.pos().len() == 0 { char } else {
], char + "." + nums.pos().map(str).join(".")
}
},
) )
#show heading: it => { show heading.where(level: 1): it => {
set align(center) set align(center)
set text(size: 14pt, weight: "regular") set text(size: 14pt, weight: "regular")
pagebreak(weak: true) pagebreak(weak: true)
bold(upper(counter(heading).display(it.numbering))) bold("ДОДАТОК " + counter(heading).display()) // TODO: should it.numbering be passed?
linebreak() linebreak()
it.body it.body
v(spacing * 2, weak: true) v(spacing * 2, weak: true)
} }
#heading(appendix.title)
#appendix.content show heading.where(level: 2): it => {
set text(size: 14pt, weight: "regular")
v(spacing * 2, weak: true)
block(width: 100%, spacing: 0em)[
#h(1.25cm)
#counter(heading).display() // TODO: should it.numbering be passed?
#it.body
] ]
v(spacing * 2, weak: true)
}
appendices
} }
} }