style: update formatting

This commit is contained in:
Kristofers Solo 2024-07-25 15:25:43 +03:00
parent c96e67130c
commit 9b73187481
6 changed files with 1352 additions and 856 deletions

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

@ -0,0 +1,29 @@
name: Build Typst document
on: [push, workflow_dispatch]
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

View File

@ -4,24 +4,26 @@
level: 1,
outlined: false,
numbering: none,
"Anotācija"
"Anotācija",
)
#indent-par([
Sociālā lomu spēle "Mafija" ir plaši pazīstama. Tā ir pieejama vairākos
paveidos un formātos, kā arī piedāvā neierobežotu konfigurāciju un lomu skaitu.
Spēlētāju ērtībai tiek nodrošināts tīmekļa vietnes formāts, kas ietver
norādījumus, informējot lietotāju par pieejamajām iespējām, un skaidrojumus,
aprakstot spēles elementus un saskarni, ar mērķi atvieglot tās lietošanu.
Tirgus izpēte apliecina, ka ir pieejami vairāki, nepilnvērtīgi risinājumi.
Programmatūras prasību specifikācija apraksta sistēmas pamatprasības un
papildus funkcionalitāti, tostarp lomu klāsta papildināšanu, spēles
konfigurāciju izveidi, kā arī priviliģētu lietotāju (maksas lietotāju) izveidošanu,
pielietojot abonementa paveida maksājumu sistēmu.
Sociālā lomu spēle "Mafija" ir plaši pazīstama. Tā ir pieejama vairākos
paveidos un formātos, kā arī piedāvā neierobežotu konfigurāciju un lomu skaitu.
Spēlētāju ērtībai tiek nodrošināts tīmekļa vietnes formāts, kas ietver
norādījumus, informējot lietotāju par pieejamajām iespējām, un skaidrojumus,
aprakstot spēles elementus un saskarni, ar mērķi atvieglot tās lietošanu.
Tirgus izpēte apliecina, ka ir pieejami vairāki, nepilnvērtīgi risinājumi.
Programmatūras prasību specifikācija apraksta sistēmas pamatprasības un
papildus funkcionalitāti, tostarp lomu klāsta papildināšanu, spēles
konfigurāciju izveidi, kā arī priviliģētu lietotāju (maksas lietotāju) izveidošanu,
pielietojot abonementa paveida maksājumu sistēmu.
])
#par(first-line-indent: 0cm, [*Atslēgvārdi:*])
#par(
first-line-indent: 0cm,
[*Atslēgvārdi:*],
)
Mafijas spēle, sistēmas prasības, specifikācijas dokuments, programmatūras
uzlabošana, lomu spēle, vienkāršota spēlēšana, organizatoriski risinājumi,
@ -29,35 +31,36 @@ programmatūras prasību specifikācija, lietotāju veidots saturs, abonements,
maksas lietotājs, maksājumu apstrādātāja lietojumprogrammas saskarni (API).
#text(
hyphenate: auto,
lang: "en",
[
#pagebreak()
#heading(
level: 1,
outlined: false,
numbering: none,
"Abstract"
)
#indent-par([
The social role-playing game "Mafia" is widely known. It is available in
various versions and formats, offering an unlimited number of configurations
and roles. For the convenience of players, the game is made as a web
application that includes instructions, informing the user about available
ptions, and explanations describing the game's elements and interface, to improve user experience. Market research confirms that several mediocre solutions are
available. The software requirements specification describes the system's basic
requirements with additional functionality, including expanding the range of
roles, creating game configurations, and a privileged user (premium user) using
a subscription-based payment system.
])
#par(first-line-indent: 0cm, [*Keywords:*])
Mafia game, system requirements, specification document, software improvement,
role-playing, simplified gameplay, organizational solutions, software
requirements specification, user-generated content, subscription, premium user,
payment processor application program interface (API).
])
hyphenate: auto,
lang: "en",
[
#pagebreak()
#heading(
level: 1,
outlined: false,
numbering: none,
"Abstract",
)
#indent-par([
The social role-playing game "Mafia" is widely known. It is available in
various versions and formats, offering an unlimited number of configurations
and roles. For the convenience of players, the game is made as a web
application that includes instructions, informing the user about available
options, and explanations describing the game's elements and interface, to
improve user experience.
Market research confirms that several mediocre solutions are
available. The software requirements specification describes the system's basic
requirements with additional functionality, including expanding the range of
roles, creating game configurations, and a privileged user (premium user) using
a subscription-based payment system.
])
#par(
first-line-indent: 0cm,
[*Keywords:*],
)
Mafia game, system requirements, specification document, software improvement,
role-playing, simplified gameplay, organizational solutions, software
requirements specification, user-generated content, subscription, premium user,
payment processor application program interface (API).
],
)

View File

@ -2,10 +2,11 @@
#import "@preview/big-todo:0.2.0": *
#import "@preview/tablex:0.0.6": tablex
#let indent = 1cm
#let indent-par(body) = par(h(indent) + body)
#let indent-par(
body,
) = par(h(indent) + body)
#let project(
university: "",
faculty: "",
@ -13,27 +14,27 @@
authors: (),
advisor: "",
date: "",
body
body,
) = {
set document(author: authors)
set page(
margin: (left: 30mm, right: 20mm, top: 20mm, bottom: 20mm),
margin: (
left: 30mm,
right: 20mm,
top: 20mm,
bottom: 20mm,
),
number-align: center,
paper: "a4"
paper: "a4",
)
set text(
//font: "New Computer Modern",
font: "CMU",
size: 12pt,
hyphenate: auto,
lang: "lv",
region: "LV"
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)
show math.equation: set text(weight: 400)
// Formatting for regular text
set par(
@ -45,19 +46,23 @@
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)))
text(
14pt,
align(
center,
upper(it),
),
)
} else {
it
}
}
/* Title page config start */
align(
center,
@ -67,78 +72,111 @@
[
#university\
#faculty
]
)
))
],
),
),
)
v(1fr)
align(
center,
text(20pt, weight: "bold", title)
center,
text(
20pt,
weight: "bold",
title,
),
)
v(1fr)
// Author information
align(right, [
align(
right,
[
#if authors.len() > 1 {
text(weight: "bold", "Darba autori:")
} else {
text(weight: "bold", "Darba autors:")
}\
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")
text(
weight: "bold",
"Darba vadītājs:\n",
)
advisor
}
])
],
)
v(0.5fr)
align(center,
upper(text(date))
align(
center,
upper(
text(date),
),
)
/* Title page config end */
// WARNING: removove before sending
// todo_outline
/* --- Figure/Table conf 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))
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))
align(
start,
emph(it.counter.display(it.numbering) + " att. ") + text(
weight: "bold",
it.body,
),
)
} else {
it
}
}
set ref(supplement: it => {}) // disable default reference suppliments
set ref(supplement: it => { }) // disable default reference suppliments
/* --- Figure/Table conf end --- */
set list(marker: ([•], [--], [\*], [·]))
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 => {
@ -146,11 +184,21 @@
}
pagebreak()
outline(depth: 3, indent: 1cm, title: text(size: 14pt, "SATURS"))
outline(
depth: 3,
indent: 1cm,
title: text(
size: 14pt,
"SATURS",
),
)
/* ToC config end */
// Start page numering
set page(numbering: "1", number-align: center)
set page(
numbering: "1",
number-align: center,
)
// Main bdy.
body

BIN
main.pdf

Binary file not shown.

1769
main.typ

File diff suppressed because it is too large Load Diff

171
utils.typ
View File

@ -1,15 +1,17 @@
#import "@preview/tablex:0.0.6": tablex
#import "@preview/big-todo:0.2.0": todo as TODO
#let custom-block(item) = {
#let custom-block(
item,
) = {
set align(start)
block(
block(
inset: 8pt,
stroke: black,
width: 100%,
spacing: 0pt,
breakable: true,
item
item,
)
}
@ -17,84 +19,149 @@
title: "",
titles: (),
caption: "",
..items
..items,
) = {
set par(first-line-indent: 0pt)
figure(
gap: 1.5em,
kind: table,
caption: if caption != ""{
caption
caption: if caption != "" {
caption
} else {
if titles.len() == 0 {
title
} else {
if titles.len() == 0 {
title
} else {
titles.first()
}
},
titles.first()
}
},
[
#if titles.len() == 0 {
custom-block(text(weight: "bold", title))
custom-block(
text(
weight: "bold",
title,
),
)
}
#for i in range(items.pos().len()) {
#for i in range(
items.pos().len(),
) {
if titles.len() > 0 {
custom-block(text(weight: "bold", titles.at(i)))
custom-block(
text(
weight: "bold",
titles.at(i),
),
)
}
custom-block(items.pos().at(i))
custom-block(
items.pos().at(i),
)
}
]
],
)
linebreak()
}
#let parameter-table(caption: "", ..items) = {
#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)"),
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
..items,
)
}
#let function-table(caption: "", ..items) = {
#let procedure-table(
caption: "",
..items,
) = {
if caption == "" {
caption = items.pos().first()
}
longtable(
titles: ("Funkcijas nosaukums", "Funkcijas identifikators", "Ievads", "Ievade", "Apstrāde", "Izvade", "Paziņojumi",),
titles: (
"Procedūras nosaukums",
"Procedūras identifikators",
"Procedūras apraksts",
"Ievade",
"Apstrāde",
"Izvade",
),
caption: caption,
..items
..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) = {
#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)
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) = {
#let entity-table(
caption: "",
id: (),
..items,
) = {
if id == () {
id = ("id", "serial8", "primary key, not null", "Unikālais identifikators")
id = (
"id",
"serial8",
"primary key, not null",
"Unikālais identifikators",
)
}
figure(
caption: caption,
kind: table,
@ -102,22 +169,34 @@
columns: (4cm, 3cm, auto, auto),
repeat-header: true,
/* Header */
[*Lauks*], [*Datu tips*], [*Lauka atribūti*], [*Apraksts*],
[*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 todo(
..body,
) = {
TODO(
..body,
inline: true,
big_text: 14pt,
small_text: 12pt,
)
}
#let hyperlink-source(author, title, link_str, date) = {
#let hyperlink-source(
author,
title,
link_str,
date,
) = {
if link_str == "" {
[#author #title Aplūkots #date.display("[day].[month].[year]")]
} else {