commit ec62a044cc1fa56da79bdedc7eb377d24e55410d Author: Kristofers Solo Date: Mon Oct 28 17:42:37 2024 +0200 Initial commit diff --git a/.github/workflows/typst.yml b/.github/workflows/typst.yml new file mode 100644 index 0000000..768d0a3 --- /dev/null +++ b/.github/workflows/typst.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51124b9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +/files diff --git a/abstract.typ b/abstract.typ new file mode 100644 index 0000000..1136454 --- /dev/null +++ b/abstract.typ @@ -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) + ], +) diff --git a/assets/fonts/cmu/cmunbbx.otf b/assets/fonts/cmu/cmunbbx.otf new file mode 100644 index 0000000..4becf1b Binary files /dev/null and b/assets/fonts/cmu/cmunbbx.otf differ diff --git a/assets/fonts/cmu/cmunbi.otf b/assets/fonts/cmu/cmunbi.otf new file mode 100644 index 0000000..5cd8a12 Binary files /dev/null and b/assets/fonts/cmu/cmunbi.otf differ diff --git a/assets/fonts/cmu/cmunbl.otf b/assets/fonts/cmu/cmunbl.otf new file mode 100644 index 0000000..e594b5e Binary files /dev/null and b/assets/fonts/cmu/cmunbl.otf differ diff --git a/assets/fonts/cmu/cmunbmo.otf b/assets/fonts/cmu/cmunbmo.otf new file mode 100644 index 0000000..4bf308f Binary files /dev/null and b/assets/fonts/cmu/cmunbmo.otf differ diff --git a/assets/fonts/cmu/cmunbmr.otf b/assets/fonts/cmu/cmunbmr.otf new file mode 100644 index 0000000..886bff1 Binary files /dev/null and b/assets/fonts/cmu/cmunbmr.otf differ diff --git a/assets/fonts/cmu/cmunbso.otf b/assets/fonts/cmu/cmunbso.otf new file mode 100644 index 0000000..f1013a1 Binary files /dev/null and b/assets/fonts/cmu/cmunbso.otf differ diff --git a/assets/fonts/cmu/cmunbsr.otf b/assets/fonts/cmu/cmunbsr.otf new file mode 100644 index 0000000..a9fd5c4 Binary files /dev/null and b/assets/fonts/cmu/cmunbsr.otf differ diff --git a/assets/fonts/cmu/cmunbtl.otf b/assets/fonts/cmu/cmunbtl.otf new file mode 100644 index 0000000..d6d2784 Binary files /dev/null and b/assets/fonts/cmu/cmunbtl.otf differ diff --git a/assets/fonts/cmu/cmunbto.otf b/assets/fonts/cmu/cmunbto.otf new file mode 100644 index 0000000..d726505 Binary files /dev/null and b/assets/fonts/cmu/cmunbto.otf differ diff --git a/assets/fonts/cmu/cmunbx.otf b/assets/fonts/cmu/cmunbx.otf new file mode 100644 index 0000000..fc32d6d Binary files /dev/null and b/assets/fonts/cmu/cmunbx.otf differ diff --git a/assets/fonts/cmu/cmunbxo.otf b/assets/fonts/cmu/cmunbxo.otf new file mode 100644 index 0000000..d6c902b Binary files /dev/null and b/assets/fonts/cmu/cmunbxo.otf differ diff --git a/assets/fonts/cmu/cmunci.otf b/assets/fonts/cmu/cmunci.otf new file mode 100644 index 0000000..99e8e03 Binary files /dev/null and b/assets/fonts/cmu/cmunci.otf differ diff --git a/assets/fonts/cmu/cmunit.otf b/assets/fonts/cmu/cmunit.otf new file mode 100644 index 0000000..daba644 Binary files /dev/null and b/assets/fonts/cmu/cmunit.otf differ diff --git a/assets/fonts/cmu/cmunobi.otf b/assets/fonts/cmu/cmunobi.otf new file mode 100644 index 0000000..31fc8e3 Binary files /dev/null and b/assets/fonts/cmu/cmunobi.otf differ diff --git a/assets/fonts/cmu/cmunobx.otf b/assets/fonts/cmu/cmunobx.otf new file mode 100644 index 0000000..244bac9 Binary files /dev/null and b/assets/fonts/cmu/cmunobx.otf differ diff --git a/assets/fonts/cmu/cmunorm.otf b/assets/fonts/cmu/cmunorm.otf new file mode 100644 index 0000000..d7310da Binary files /dev/null and b/assets/fonts/cmu/cmunorm.otf differ diff --git a/assets/fonts/cmu/cmunoti.otf b/assets/fonts/cmu/cmunoti.otf new file mode 100644 index 0000000..bc43e49 Binary files /dev/null and b/assets/fonts/cmu/cmunoti.otf differ diff --git a/assets/fonts/cmu/cmunrb.otf b/assets/fonts/cmu/cmunrb.otf new file mode 100644 index 0000000..dda7ceb Binary files /dev/null and b/assets/fonts/cmu/cmunrb.otf differ diff --git a/assets/fonts/cmu/cmunrm.otf b/assets/fonts/cmu/cmunrm.otf new file mode 100644 index 0000000..b449df0 Binary files /dev/null and b/assets/fonts/cmu/cmunrm.otf differ diff --git a/assets/fonts/cmu/cmunsi.otf b/assets/fonts/cmu/cmunsi.otf new file mode 100644 index 0000000..3705fc6 Binary files /dev/null and b/assets/fonts/cmu/cmunsi.otf differ diff --git a/assets/fonts/cmu/cmunsl.otf b/assets/fonts/cmu/cmunsl.otf new file mode 100644 index 0000000..05608b2 Binary files /dev/null and b/assets/fonts/cmu/cmunsl.otf differ diff --git a/assets/fonts/cmu/cmunso.otf b/assets/fonts/cmu/cmunso.otf new file mode 100644 index 0000000..23fd4ad Binary files /dev/null and b/assets/fonts/cmu/cmunso.otf differ diff --git a/assets/fonts/cmu/cmunss.otf b/assets/fonts/cmu/cmunss.otf new file mode 100644 index 0000000..49fecee Binary files /dev/null and b/assets/fonts/cmu/cmunss.otf differ diff --git a/assets/fonts/cmu/cmunssdc.otf b/assets/fonts/cmu/cmunssdc.otf new file mode 100644 index 0000000..f7d33bc Binary files /dev/null and b/assets/fonts/cmu/cmunssdc.otf differ diff --git a/assets/fonts/cmu/cmunst.otf b/assets/fonts/cmu/cmunst.otf new file mode 100644 index 0000000..e56babe Binary files /dev/null and b/assets/fonts/cmu/cmunst.otf differ diff --git a/assets/fonts/cmu/cmunsx.otf b/assets/fonts/cmu/cmunsx.otf new file mode 100644 index 0000000..b1fc68e Binary files /dev/null and b/assets/fonts/cmu/cmunsx.otf differ diff --git a/assets/fonts/cmu/cmuntb.otf b/assets/fonts/cmu/cmuntb.otf new file mode 100644 index 0000000..d6772ca Binary files /dev/null and b/assets/fonts/cmu/cmuntb.otf differ diff --git a/assets/fonts/cmu/cmunti.otf b/assets/fonts/cmu/cmunti.otf new file mode 100644 index 0000000..5739e9d Binary files /dev/null and b/assets/fonts/cmu/cmunti.otf differ diff --git a/assets/fonts/cmu/cmuntt.otf b/assets/fonts/cmu/cmuntt.otf new file mode 100644 index 0000000..a564385 Binary files /dev/null and b/assets/fonts/cmu/cmuntt.otf differ diff --git a/assets/fonts/cmu/cmuntx.otf b/assets/fonts/cmu/cmuntx.otf new file mode 100644 index 0000000..8fadd9a Binary files /dev/null and b/assets/fonts/cmu/cmuntx.otf differ diff --git a/assets/fonts/cmu/cmunui.otf b/assets/fonts/cmu/cmunui.otf new file mode 100644 index 0000000..d744777 Binary files /dev/null and b/assets/fonts/cmu/cmunui.otf differ diff --git a/assets/fonts/cmu/cmunvi.otf b/assets/fonts/cmu/cmunvi.otf new file mode 100644 index 0000000..3403b51 Binary files /dev/null and b/assets/fonts/cmu/cmunvi.otf differ diff --git a/assets/fonts/cmu/cmunvt.otf b/assets/fonts/cmu/cmunvt.otf new file mode 100644 index 0000000..a3cdd44 Binary files /dev/null and b/assets/fonts/cmu/cmunvt.otf differ diff --git a/layout.typ b/layout.typ new file mode 100644 index 0000000..2075230 --- /dev/null +++ b/layout.typ @@ -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 +} diff --git a/main.typ b/main.typ new file mode 100644 index 0000000..5aa5f7d --- /dev/null +++ b/main.typ @@ -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, + ), + ) + diff --git a/utils.typ b/utils.typ new file mode 100644 index 0000000..18ee9bb --- /dev/null +++ b/utils.typ @@ -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]")] + } +}