Compare commits

8 Commits

23 changed files with 463 additions and 96 deletions

63
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,63 @@
name: Bug Report
description: Something isn't working as expected
labels: ["bug"]
assignees: [kristoferssolo]
body:
- type: markdown
attributes:
value: |
Before submitting, check [existing issues](../../issues) to avoid duplicates.
- type: input
id: typst-version
attributes:
label: Typst Version
description: Run `typst --version`
placeholder: "e.g. typst 0.14.0"
validations:
required: true
- type: input
id: template-version
attributes:
label: Template Version
description: Release tag or commit hash
placeholder: "e.g. v1.0.0 or a3f5c2d"
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: Clear and concise description of the bug.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Minimal Reproduction
description: >
A minimal `.typ` snippet that reproduces the issue. Remove everything not necessary to trigger the bug.
render: typst
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behavior
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual Behavior
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional Context
description: >
Screenshots, PDF output snippets, compiler errors, or anything else relevant.
validations:
required: false

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: true

View File

@@ -0,0 +1,27 @@
name: Documentation
description: Missing, incorrect, or unclear documentation
labels: ["documentation"]
assignees: [kristoferssolo]
body:
- type: input
id: location
attributes:
label: Location
description: File, section, or page where the issue is.
placeholder: "e.g. README.md > Usage, or docs/structure.md"
validations:
required: true
- type: textarea
id: description
attributes:
label: What's Wrong
description: What is missing, incorrect, or unclear?
validations:
required: true
- type: textarea
id: suggestion
attributes:
label: Suggested Improvement
description: How should it read or what should be added?
validations:
required: false

View File

@@ -0,0 +1,39 @@
name: Feature Request
description: Suggest new functionality or an enhancement
labels: ["feature"]
assignees: [kristoferssolo]
body:
- type: markdown
attributes:
value: |
Before submitting, check [existing issues](../../issues) to avoid duplicates.
- type: textarea
id: problem
attributes:
label: Problem / Motivation
description: What problem does this solve? Why is it needed?
validations:
required: true
- type: textarea
id: solution
attributes:
label: Proposed Solution
description: Describe the feature and how it should work.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: Any workarounds or other approaches you've considered.
validations:
required: false
- type: checkboxes
id: lu-scope
attributes:
label: Scope
options:
- label: >
This is required or implied by University of Latvia thesis guidelines
- label: This is a general usability or quality-of-life improvement

33
.github/ISSUE_TEMPLATE/question.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Question
description: Ask a question about using the template
labels: ["question"]
assignees: [kristoferssolo]
body:
- type: markdown
attributes:
value: |
Check the [README](../../blob/main/README.md) and
[existing issues](../../issues) first.
- type: textarea
id: question
attributes:
label: Question
validations:
required: true
- type: textarea
id: context
attributes:
label: Context
description: >
What are you trying to achieve? What have you already tried?
validations:
required: false
- type: input
id: typst-version
attributes:
label: Typst Version
description: If relevant, run `typst --version`
placeholder: "e.g. typst 0.14.0"
validations:
required: false

View File

@@ -26,7 +26,7 @@ configure the whole document and `attachment` helper function. Important argumen
`code` and may include `location` and `email`.
- `advisors`: Array of advisor dictionaries with `title` and `name`.
- `reviewer`: Reviewer dictionary with `name`.
- `thesis-type`: Type of thesis - `"bachelor"`, `"course"`, or `"qualification"`. The documentary page adapts its content based on this value.
- `thesis-type`: Type of thesis - `"bachelor"`, `"master"`, `"course"`, or `"qualification"`. The documentary page adapts its content based on this value.
- `date`: `datetime(...)` value for the thesis date. Defaults to `today`.
- `place`: Place string (e.g., `"Rīga"`).
- `abstract`: A record with `primary` and `secondary` abstracts. Each has
@@ -48,7 +48,7 @@ function in a show rule. If you want to change an existing project to use this
template, you can add a show rule like this at the top of your file:
```typst
#import "@preview/solo-lu-df:1.1.0": *
#import "@preview/solo-lu-df:1.1.2": *
#show: ludf.with(
title: "Darba Nosaukums",
@@ -85,11 +85,12 @@ template, you can add a show rule like this at the top of your file:
Ready-to-edit examples for different thesis types are included:
- **Bachelor thesis**: [`examples/bachelor-thesis/`](https://github.com/kristoferssolo/LU-DF-Typst-Template/tree/main/examples/bachelor-thesis)
- **Course work**: [`examples/course-work/`](https://github.com/kristoferssolo/LU-DF-Typst-Template/tree/main/examples/course-work)
- **Qualification thesis**: [`examples/qualification-thesis/`](https://github.com/kristoferssolo/LU-DF-Typst-Template/tree/main/examples/qualification-thesis)
- **Qualification thesis**: [`examples/qualification-thesis/`](https://github.com/kristoferssolo/LU-DF-Typst-Template/tree/v1.1.2/examples/qualification-thesis)
- **Course work**: [`examples/course-work/`](https://github.com/kristoferssolo/LU-DF-Typst-Template/tree/v1.1.2/examples/course-work)
- **Bachelor thesis**: [`examples/bachelor-thesis/`](https://github.com/kristoferssolo/LU-DF-Typst-Template/tree/v1.1.2/examples/bachelor-thesis)
- **Master thesis**: [`examples/master-thesis/`](https://github.com/kristoferssolo/LU-DF-Typst-Template/tree/v1.1.2/examples/master-thesis)
View the examples on GitHub: <https://github.com/kristoferssolo/LU-DF-Typst-Template/tree/main/examples>
Browse all examples on GitHub: <https://github.com/kristoferssolo/LU-DF-Typst-Template/tree/v1.1.2/examples>
The qualification thesis example contains `main.typ`, `bibliography.yml` and small helpers under
`utils/`. Use it as a starting point or copy it into a new project.

View File

@@ -3,8 +3,8 @@ Bachelor thesis example (solo-lu-df)
This folder contains a ready-to-edit bachelor thesis example built with
the `solo-lu-df` Typst template:
- `main.typ` Typst source (the example document).
- `bibliography.yml` example bibliography entries (create as needed).
- `main.typ` Typst source (the example document).
- `bibliography.yml` example bibliography entries (create as needed).
## How to edit
@@ -23,4 +23,4 @@ documentary page for bachelor theses.
## License
This project is licensed under the MIT-0 License - see the [LICENSE](./../../LICENSE) file for details.
This project is licensed under the MIT-0 License see the [LICENSE](./../../LICENSE) file for details.

View File

@@ -7,7 +7,9 @@ typst:
- Haug
- Martin
- Typst Projekta Izstrādātāji
url: {value: "https://typst.app/", date: 2025-01-01}
url:
value: "https://typst.app/"
date: 2025-01-01
lvs_68:
type: Book
title: Programmatūras prasību specifikācijas ceļvedis

View File

@@ -1,4 +1,4 @@
#import "@preview/solo-lu-df:1.1.0": *
#import "@preview/solo-lu-df:1.1.2": *
#show: ludf.with(
title: "Bakalaura Darba Nosaukums",

View File

@@ -3,8 +3,8 @@ Course work example (solo-lu-df)
This folder contains a ready-to-edit course work example built with
the `solo-lu-df` Typst template:
- `main.typ` Typst source (the example document).
- `bibliography.yml` example bibliography entries (create as needed).
- `main.typ` Typst source (the example document).
- `bibliography.yml` example bibliography entries (create as needed).
## How to edit
@@ -22,4 +22,4 @@ documentary page for course works.
## License
This project is licensed under the MIT-0 License - see the [LICENSE](./../../LICENSE) file for details.
This project is licensed under the MIT-0 License see the [LICENSE](./../../LICENSE) file for details.

View File

@@ -7,7 +7,9 @@ typst:
- Haug
- Martin
- Typst Projekta Izstrādātāji
url: {value: "https://typst.app/", date: 2025-01-01}
url:
value: "https://typst.app/"
date: 2025-01-01
lvs_68:
type: Book
title: Programmatūras prasību specifikācijas ceļvedis

View File

@@ -1,4 +1,4 @@
#import "@preview/solo-lu-df:1.1.0": *
#import "@preview/solo-lu-df:1.1.2": *
#show: ludf.with(
title: "Kursa Darba Nosaukums",

View File

@@ -0,0 +1,28 @@
Master thesis example (solo-lu-df)
This folder contains a ready-to-edit master thesis example built with
the `solo-lu-df` Typst template:
- `main.typ` Typst source (the example document).
- `bibliography.yml` example bibliography entries (create as needed).
## How to edit
Open `examples/master-thesis/main.typ` and modify the `ludf.with(...)`
call to change title, authors, advisors, reviewer, date, place, abstract,
and bibliography. The example demonstrates:
- Title/author/advisor metadata
- Multiple advisors for master thesis
- Reviewer for master thesis
- Primary and secondary abstracts with keywords
## Thesis type
This example uses `thesis-type: "master"` which generates the appropriate
documentary page for master theses (similar to bachelor, but with "maģistra"
instead of "bakalaura" in the footer).
## License
This project is licensed under the MIT-0 License see the [LICENSE](./../../LICENSE) file for details.

View File

@@ -0,0 +1,28 @@
typst:
type: Web
title: Typst
author:
- Mädje
- Laurenz
- Haug
- Martin
- Typst Projekta Izstrādātāji
url:
value: "https://typst.app/"
date: 2025-01-01
lvs_68:
type: Book
title: Programmatūras prasību specifikācijas ceļvedis
author: Institūcija SIA "Latvijas standarts"
issue: 68
date: 1996-03-27
organization: Latvijas Nacionālais standartizācijas un metroloģijas centrs
page-total: 22
lvs_72:
type: Book
title: Ieteicamā prakse programmatūras projektējuma aprakstīšanai
author: Institūcija SIA "Latvijas standarts"
issue: 72
date: 1996-03-27
organization: Latvijas Nacionālais standartizācijas un metroloģijas centrs
page-total: 13

View File

@@ -0,0 +1,113 @@
#import "@preview/solo-lu-df:1.1.2": *
#show: ludf.with(
title: "Maģistra Darba Nosaukums",
thesis-type: "master",
authors: (
(
name: "Jānis Bērziņš",
code: "jb12345",
location: [Riga, Latvia],
email: "jb12345@edu.lu.lv",
),
),
advisors: (
(
title: "Dr. phys.",
name: "Ivars Ozoliņš",
),
(
title: "Mg. dat.",
name: "Anna Zariņa",
),
),
reviewer: (
title: "Prof. Dr. Phys.",
name: "Anna Liepa",
),
date: datetime(
year: 2025,
month: 6,
day: 15,
),
place: "Rīga",
bibliography: bibliography("bibliography.yml"),
abstract: (
primary: (
text: [
#lorem(50)
#lorem(30)
#lorem(20)
],
keywords: (
"Foo",
"Bar",
"Baz",
),
),
secondary: (
text: [
#lorem(20)
#lorem(30)
#lorem(50)
],
keywords: (
"foo",
"bar",
"baz",
),
),
),
attachments: (
attachment(
caption: "Attachment table",
label: <table-1>,
table(
columns: (1fr, 1fr),
[foo], [bar],
),
),
attachment(
caption: "Another table",
table(
columns: (1fr, 1fr),
[Column 1], [Column 2],
),
),
),
)
= Ievads
#lorem(120)
= Teorētiskais pamatojums
#lorem(100)
== Pamatjēdzieni
#lorem(80)
== Līdzīgie risinājumi
#lorem(60)
= Izstrāde
#lorem(100)
== Arhitektūra
#lorem(80)
== Implementācija
#lorem(60)
= Testēšana
#lorem(80)
= Rezultāti un analīze
#lorem(100)
= Secinājumi
#lorem(40)

View File

@@ -3,9 +3,9 @@ Qualification thesis example (solo-lu-df)
This folder contains a ready-to-edit qualification-thesis example built with
the `solo-lu-df` Typst template:
- `main.typ` Typst source (the example document).
- `bibliography.yml` example bibliography entries.
- `utils/` helper snippets for diagrams/tables used by the example.
- `main.typ` Typst source (the example document).
- `bibliography.yml` example bibliography entries.
- `utils/` helper snippets for diagrams/tables used by the example.
## How to edit
@@ -25,4 +25,4 @@ documentary page for course works.
## License
This project is licensed under the MIT-0 License - see the [LICENSE](./../../LICENSE) file for details.
This project is licensed under the MIT-0 License see the [LICENSE](./../../LICENSE) file for details.

View File

@@ -7,7 +7,9 @@ typst:
- Haug
- Martin
- Typst Projekta Izstrādātāji
url: {value: "https://typst.app/", date: 2025-01-01}
url:
value: "https://typst.app/"
date: 2025-01-01
lvs_68:
type: Book
title: Programmatūras prasību specifikācijas ceļvedis

View File

@@ -1,5 +1,5 @@
#import "@preview/fletcher:0.5.8" as fletcher: diagram, edge, node
#import "@preview/solo-lu-df:1.1.0": *
#import "@preview/solo-lu-df:1.1.1": *
#import "utils/diagrams.typ": data-store, dpd-database, dpd-edge, process
#import "utils/tables.typ": function-table

View File

@@ -10,19 +10,79 @@
bachelor: (
label: "Bakalaura darbs",
intro-suffix: "",
make-footer: (date, presentation-date) => [
Darbs iesniegts Datorikas nodaļā #date \
Pilnvarotā persona: vecākā metodiķe: Ārija Sproģe ~#signature-line()
#v(1fr)
Darbs aizstāvēts bakalaura gala pārbaudījuma komisijas sēdē ~#signature-line() \
#presentation-date prot. Nr. #signature-line(length: 4em) \
Komisijas sekretārs(-e): #signature-line(length: 15em)
],
),
master: (
label: "Maģistra darbs",
intro-suffix: "",
make-footer: (date, presentation-date) => [
Darbs iesniegts Datorikas nodaļā #date \
Pilnvarotā persona: vecākā metodiķe: Ārija Sproģe ~#signature-line()
#v(1fr)
Darbs aizstāvēts maģistra gala pārbaudījuma komisijas sēdē ~#signature-line() \
#presentation-date prot. Nr. #signature-line(length: 4em) \
Komisijas sekretārs(-e): #signature-line(length: 15em)
],
),
course: (
label: "Kursa darbs",
intro-suffix: " un/vai recenzentam uzrādītajai darba versijai",
intro-suffix: "",
make-footer: (date, _) => [
Darbs iesniegts Datorikas nodaļā #date \
Kursa darbu pārbaudīja komisijas sekretārs (elektronisks paraksts)
],
),
qualification: (
label: "Kvalifikācijas darbs",
intro-suffix: " un/vai recenzentam uzrādītajai darba versijai",
make-footer: (date, _) => [
Darbs iesniegts Datorikas nodaļā #date \
Kvalifikācijas darbu pārbaudījumu komisijas sekretārs (elektronisks paraksts)
],
),
)
#let get-thesis-label(thesis-type) = {
thesis-config.at(thesis-type, default: (label: str(thesis-type))).label
#let get-thesis-label(thesis-type) = (
thesis-config
.at(thesis-type, default: (
label: str(thesis-type),
))
.label
)
#let get-thesis-config(thesis-type) = {
thesis-config.at(thesis-type, default: (
label: str(thesis-type),
intro-suffix: "",
make-footer: (date, _) => [],
))
}
#let make-author-lines(authors, date) = {
if authors.len() > 1 [Autori:\ ] else [Autors: ]
authors.map(it => [*#it.name, #it.code* ~#signature-line()~ #date]).join(", ")
}
#let make-advisor-lines(advisors, date) = {
if advisors.len() > 0 [
#if advisors.len() > 1 [Vadītāji:\ ] else [Vadītājs:]
#(
advisors
.map(it => [*#it.title #it.name* ~#signature-line()~ #date])
.join("\n")
)
]
}
#let make-dokumentary(
@@ -34,75 +94,25 @@
date,
presentation-date,
) = {
let (intro-suffix, footer) = if thesis-type == "bachelor" {
(
"",
[
Darbs iesniegts Datorikas nodaļā #date \
Pilnvarotā persona: vecākā metodiķe: Ārija Sproģe ~#signature-line()
#v(1fr)
Darbs aizstāvēts bakalaura gala pārbaudījuma komisijas sēdē ~#signature-line() \
#presentation-date prot. Nr. #signature-line(length: 4em) \
Komisijas sekretārs(-e): #signature-line(length: 15em)
],
)
} else if thesis-type == "course" {
(
" un/vai recenzentam uzrādītajai darba versijai",
[
Darbs iesniegts Datorikas nodaļā #date \
Kursa darbu pārbaudīja komisijas sekretārs (elektronisks paraksts)
],
)
} else {
(
" un/vai recenzentam uzrādītajai darba versijai",
[
Darbs iesniegts Datorikas nodaļā #date \
Kvalifikācijas darbu pārbaudījumu komisijas sekretārs (elektronisks paraksts)
],
)
}
let work-label = if thesis-type == "bachelor" {
"Bakalaura darbs"
} else if thesis-type == "course" {
"Kursa darbs"
} else {
"Kvalifikācijas darbs"
}
let cfg = get-thesis-config(thesis-type)
[
#work-label "*#title*" #if thesis-type == "bachelor" [izstrādāts] else [ir izstrādāts]
#cfg.label "*#title*" izstrādāts
Latvijas Universitātes Eksakto zinātņu un tehnoloģiju fakultātē.
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#intro-suffix.
atbilst izdrukai#cfg.intro-suffix.
#set par(hanging-indent: 1cm)
#v(0.2fr)
#if authors.len() > 1 [Autori:\ ] else [Autors: ]
#(
authors
.map(it => [*#it.name, #it.code* ~#signature-line()~ #date])
.join(", ")
)
#make-author-lines(authors, date)
#v(1fr)
Rekomendēju/nerekomendēju darbu aizstāvēšanai _(nederīgo svītro vadītājs)_\
#if advisors.len() > 0 [
#if advisors.len() > 1 [Vadītāji:\ ] else [Vadītājs:]
#(
advisors
.map(it => [*#it.title #it.name* ~#signature-line()~ #date])
.join("\n")
)
]
#make-advisor-lines(advisors, date)
#v(1fr)
@@ -111,12 +121,38 @@
#v(1fr)
]
#footer
#(cfg.make-footer)(date, presentation-date)
#v(1fr)
]
}
#let normalize-title(title) = {
if type(title) != content or "children" not in title.fields() {
return title
}
let children = title
.fields()
.children
.filter(it => it.func() != linebreak)
.fold((), (acc, it) => {
if it == [ ] and (acc.len() == 0 or acc.last() == [ ]) {
acc
} else {
acc + (it,)
}
})
let children = if children.len() > 0 and children.last() == [ ] {
children.slice(0, -1)
} else {
children
}
children.join("")
}
#let make-documentary-page(
title,
authors,
@@ -127,11 +163,11 @@
presentation-date,
) = {
set page(numbering: none)
heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa")
set par(spacing: 2em)
heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa")
make-dokumentary(
title,
normalize-title(title),
authors,
advisors,
reviewer,
@@ -140,3 +176,4 @@
fmt-date(presentation-date),
)
}

View File

@@ -295,16 +295,7 @@
if display-documentary {
make-documentary-page(
if type(title) == content {
title
.fields()
.values()
.at(0)
.filter(it => it.func() != linebreak and it != [ ])
.join(" ")
} else {
title
},
title,
authors,
advisors,
reviewer,

View File

@@ -1,6 +1,5 @@
#import "documentary-page.typ": get-thesis-label, make-documentary-page
#let merge(a, b) = {
let result = a
for (k, v) in b { result.at(k) = v }
@@ -63,6 +62,7 @@
place,
logo,
) = {
set par(justify: false)
align(
center,
upper(

View File

@@ -1,4 +1,4 @@
#import "@preview/solo-lu-df:1.1.0": *
#import "@preview/solo-lu-df:1.1.2": *
#show: ludf.with(
title: "Darba Nosaukums",

View File

@@ -1,6 +1,6 @@
[package]
name = "solo-lu-df"
version = "1.1.0"
version = "1.1.2"
entrypoint = "src/lib.typ"
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
license = "MIT-0"