Initial commit

This commit is contained in:
Kristofers Solo 2024-10-28 17:42:37 +02:00
commit ec62a044cc
39 changed files with 556 additions and 0 deletions

38
.github/workflows/typst.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
inputs:
version:
description: 'Version number in the format `v1.2.3`'
required: true
type: string
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Typst
uses: lvignoli/typst-action@main
with:
source_file: |
main.typ
- name: Upload PDF file
uses: actions/upload-artifact@v3
with:
name: PDF
path: "*.pdf"
- name: Get current date
id: date
run: echo "DATE=$(date +%Y-%m-%d-%H:%M)" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
if: github.ref_type == 'tag'
with:
name: "${{ github.ref_name }} — ${{ env.DATE }}"
files: main.pdf

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target
/files

36
abstract.typ Normal file
View File

@ -0,0 +1,36 @@
#pagebreak()
#heading(
level: 1,
outlined: false,
numbering: none,
"Anotācija",
)
#lorem(100)
#par(
first-line-indent: 0cm,
[*Atslēgvārdi:*],
)
#lorem(50)
#text(
hyphenate: auto,
lang: "en",
[
#pagebreak()
#heading(
level: 1,
outlined: false,
numbering: none,
"Abstract",
)
#lorem(100)
#par(
first-line-indent: 0cm,
[*Keywords:*],
)
#lorem(50)
],
)

Binary file not shown.

BIN
assets/fonts/cmu/cmunbi.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunbl.otf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/fonts/cmu/cmunbx.otf Normal file

Binary file not shown.

Binary file not shown.

BIN
assets/fonts/cmu/cmunci.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunit.otf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/fonts/cmu/cmunrb.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunrm.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunsi.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunsl.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunso.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunss.otf Normal file

Binary file not shown.

Binary file not shown.

BIN
assets/fonts/cmu/cmunst.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunsx.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmuntb.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunti.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmuntt.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmuntx.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunui.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunvi.otf Normal file

Binary file not shown.

BIN
assets/fonts/cmu/cmunvt.otf Normal file

Binary file not shown.

204
layout.typ Normal file
View File

@ -0,0 +1,204 @@
#import "@preview/i-figured:0.2.4"
#import "@preview/big-todo:0.2.0": *
#import "@preview/tablex:0.0.9": tablex
#let indent = 1cm
#let project(
university: "",
faculty: "",
title: [],
authors: (),
advisor: "",
date: "",
body,
) = {
set document(author: authors)
set page(
margin: (
left: 30mm,
right: 20mm,
top: 20mm,
bottom: 20mm,
),
number-align: center,
paper: "a4",
)
set text(
//font: "New Computer Modern",
font: "CMU", size: 12pt, hyphenate: auto, lang: "lv", region: "LV",
)
show raw: set text(font: "New Computer Modern Mono")
show math.equation: set text(weight: 400)
// Formatting for regular text
set par(
justify: true,
leading: 1.5em,
first-line-indent: indent,
)
show par: set block(spacing: 1.5em) // Set 1.5em gap between paragraphs
show heading: set block(spacing: 1.5em)
set terms(separator: [ -- ])
// Headings
set heading(numbering: "1.1.")
show heading: it => {
if it.level == 1 {
pagebreak(weak: true)
text(
14pt,
align(
center,
upper(it),
),
)
} else {
it
}
""
v(-indent)
}
/* Title page config start */
align(
center,
upper(
text(
size: 16pt,
[
#university\
#faculty
],
),
),
)
v(1fr)
align(
center,
text(
20pt,
weight: "bold",
title,
),
)
v(1fr)
// Author information
align(
right,
[
#if authors.len() > 1 {
text(
weight: "bold",
"Darba autori:",
)
} else {
text(
weight: "bold",
"Darba autors:",
)
}\
#authors.join("\n")
#v(2em)
#if advisor != "" {
text(
weight: "bold",
"Darba vadītājs:\n",
)
advisor
}
],
)
v(0.5fr)
align(
center,
upper(
text(date),
),
)
/* Title page config end */
// WARNING: remove before sending
todo_outline
/* --- Figure/Table config start --- */
show heading: i-figured.reset-counters
show figure: i-figured.show-figure.with(numbering: "1.1.")
show figure.where(kind: "i-figured-table"): set block(breakable: true)
show figure.where(kind: "i-figured-table"): set figure.caption(position: top)
show figure: set par(justify: false) // disable justify for figures (tables)
show figure.caption: it => {
if it.kind == "i-figured-table" {
align(
end,
emph(it.counter.display(it.numbering) + " tabula ") + text(
weight: "bold",
it.body,
),
)
} else if it.kind == "i-figured-image" {
align(
start,
emph(it.counter.display(it.numbering) + " att. ") + text(
weight: "bold",
it.body,
),
)
} else {
it
}
}
set ref(supplement: it => { }) // disable default reference suppliments
/* --- Figure/Table config end --- */
set list(marker: (
[•],
[--],
[\*],
[·],
))
set enum(numbering: "1aiA)") // TODO: make the same style as LaTeX: 1. | (a) | i. | A.
// Abstract
include "abstract.typ"
/* ToC config start */
// Uppercase 1st level headings in ToC
show outline.entry.where(level: 1): it => {
upper(it)
}
pagebreak()
outline(
depth: 3,
indent: 1cm,
title: text(
size: 14pt,
"SATURS",
),
)
/* ToC config end */
// Start page numbering
set page(
numbering: "1",
number-align: center,
)
// Main body
body
}

71
main.typ Normal file
View File

@ -0,0 +1,71 @@
#import "layout.typ": project
#import "@preview/i-figured:0.2.4"
#import "@preview/tablex:0.0.9": tablex, rowspanx, colspanx, cellx
#import "utils.typ": *
#show: project.with(
university: "Latvijas Universitāte",
faculty: "Eksakto zinātņu un tehnoloģiju fakultāte",
title: [Spēles izstrāde, izmantojot Bevy spēļu dzinēju],
authors: ("Kristiāns Francis Cagulis, kc22015",),
advisor: "prof. Mg. dat. Jānis Iljins",
date: "Rīga 2025",
)
#set heading(numbering: none)
= Apzīmējumu saraksts
= Ievads
== Nolūks
== Saistība ar citiem dokumentiem
== Pārskats
#set heading(numbering: "1.1.")
= Vispārējais apraksts
== Esošā stāvokļa apraksts
== Pasūtītājs
== Produkta perspektīva
== Darījumprasības
== Sistēmas lietotāji
== Vispārējie ierobežojumi
== Pieņēmumi un atkarības
= Programmatūras prasību specifikācija
== Konceptuālais datu bāzes apraksts
== Funkcionālās prasības
== Nefunkcionālās prasības
=== Veiktspējas prasības
==== Statiskā veiktspēja
==== Dinamiskā veiktspēja
=== Atribūti
==== Izmantojamība
==== Mērogojamība
==== Drošība
==== Uzturamība
==== Pārnesamība
=== Projekta ierobežojumi
==== Intelektuālā īpašuma tiesības
==== Aparatūras ierobežojumi
===== Atbalstītās ierīces
===== Serveris un mitināšana
=== Ārējās saskarnes prasības
==== Lietotāja saskarne
==== Sakaru saskarne
= Programmatūras projektējuma apraksts
== Daļējs funkciju projektējums
/* Apraksta svarīgākās, sarežģītākās funkcijas vai sistēmas darbības aspektus; obligāti jālieto vismaz 4 dažādi diagrammu veidi, izņemot DPD un lietošanas piemēru (use case) diagrammas */
== Daļējs lietotāju saskarņu projektējums
/* 5-7 lietotāja saskarnes un to apraksts */
=== Navigācija
=== Ekrānskati
#heading(numbering: none, "Izmantotā literatūra un avoti")
+ #hyperlink-source(
"Eiropas Parlaments.",
"Vispārēja datu aizsardzības regula (angl. GDPR). 2016, aprīlis.",
"https://eur-lex.europa.eu/legal-content/LV/TXT/PDF/?uri=CELEX:32016R0679",
datetime(
year: 2023,
month: 11,
day: 20,
),
)

205
utils.typ Normal file
View File

@ -0,0 +1,205 @@
#import "@preview/tablex:0.0.9": tablex
#import "@preview/big-todo:0.2.0": todo as TODO
#let custom-block(
item,
) = {
set align(start)
block(
inset: 8pt,
stroke: black,
width: 100%,
spacing: 0pt,
breakable: true,
item,
)
}
#let longtable(
title: "",
titles: (),
caption: "",
..items,
) = {
set par(first-line-indent: 0pt)
figure(
gap: 1.5em,
kind: table,
caption: if caption != "" {
caption
} else {
if titles.len() == 0 {
title
} else {
titles.first()
}
},
[
#if titles.len() == 0 {
custom-block(
text(
weight: "bold",
title,
),
)
}
#for i in range(
items.pos().len(),
) {
if titles.len() > 0 {
custom-block(
text(
weight: "bold",
titles.at(i),
),
)
}
custom-block(
items.pos().at(i),
)
}
],
)
linebreak()
}
#let parameter-table(
caption: "",
..items,
) = {
if caption == "" {
caption = items.pos().first()
}
longtable(
titles: (
"Parametra nosaukums",
"Parametra identifikators",
"Parametra apraksts",
"Parametra prasības",
"Parametra piemērs (/-i)",
),
caption: caption,
..items,
)
}
#let procedure-table(
caption: "",
..items,
) = {
if caption == "" {
caption = items.pos().first()
}
longtable(
titles: (
"Procedūras nosaukums",
"Procedūras identifikators",
"Procedūras apraksts",
"Ievade",
"Apstrāde",
"Izvade",
),
caption: caption,
..items,
)
}
#let function-table(
caption: "",
..items,
) = {
if caption == "" {
caption = items.pos().first()
}
longtable(
titles: (
"Funkcijas nosaukums",
"Funkcijas identifikators",
"Ievads",
"Ievade",
"Apstrāde",
"Izvade",
"Paziņojumi",
),
caption: caption,
..items,
)
}
#let entity-table-row(
..items,
) = {
(
items.pos().at(0),
upper(
raw(
items.pos().at(1),
block: false,
),
),
upper(
raw(
items.pos().at(2),
block: false,
),
),
items.pos().at(3),
)
}
#let entity-table(
caption: "",
id: (),
..items,
) = {
if id == () {
id = (
"id",
"serial8",
"primary key, not null",
"Unikālais identifikators",
)
}
figure(
caption: caption,
kind: table,
tablex(
columns: (4cm, 3cm, auto, auto),
repeat-header: true,
/* Header */
[*Lauks*], [*Datu tips*], [*Lauka atribūti*], [*Apraksts*],
..entity-table-row(..id), // id row
..for i in range(items.pos().len(), step:4){
entity-table-row(..items.pos().slice(i, i+4))
},
),
)
}
#let todo(
..body,
) = {
TODO(
..body,
inline: true,
big_text: 14pt,
small_text: 12pt,
)
}
#let hyperlink-source(
author,
title,
link_str,
date,
) = {
if link_str == "" {
[#author #title Aplūkots #date.display("[day].[month].[year]")]
} else {
[#author #title Pieejams: #link(link_str) aplūkots #date.display("[day].[month].[year]")]
}
}