mirror of
https://github.com/jorenchik/mdemory.git
synced 2026-03-22 00:26:21 +00:00
started documentation
This commit is contained in:
49
docs/abstract.typst
Normal file
49
docs/abstract.typst
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
#import "layout.typst": indent-par
|
||||||
|
#pagebreak()
|
||||||
|
#heading(
|
||||||
|
level: 1,
|
||||||
|
outlined: false,
|
||||||
|
numbering: none,
|
||||||
|
"Anotācija",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#indent-par([
|
||||||
|
|
||||||
|
// LV abstract
|
||||||
|
|
||||||
|
])
|
||||||
|
|
||||||
|
#par(
|
||||||
|
first-line-indent: 0cm,
|
||||||
|
[*Atslēgvārdi:*],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
// LV keywords
|
||||||
|
|
||||||
|
#text(
|
||||||
|
hyphenate: auto,
|
||||||
|
lang: "en",
|
||||||
|
[
|
||||||
|
#pagebreak()
|
||||||
|
#heading(
|
||||||
|
level: 1,
|
||||||
|
outlined: false,
|
||||||
|
numbering: none,
|
||||||
|
"Abstract",
|
||||||
|
)
|
||||||
|
#indent-par([
|
||||||
|
|
||||||
|
// EN abstract
|
||||||
|
|
||||||
|
])
|
||||||
|
#par(
|
||||||
|
first-line-indent: 0cm,
|
||||||
|
[*Keywords:*],
|
||||||
|
)
|
||||||
|
|
||||||
|
// EN keywords
|
||||||
|
|
||||||
|
],
|
||||||
|
)
|
||||||
205
docs/layout.typst
Normal file
205
docs/layout.typst
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
#import "@preview/i-figured:0.1.0"
|
||||||
|
#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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 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: 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,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
} 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 conf end --- */
|
||||||
|
|
||||||
|
set list(marker: (
|
||||||
|
[•],
|
||||||
|
[--],
|
||||||
|
[\*],
|
||||||
|
[·],
|
||||||
|
))
|
||||||
|
set enum(numbering: "1aiA)") // TODO: make the same style as LaTeX: 1. | (a) | i. | A.
|
||||||
|
|
||||||
|
// Abstract
|
||||||
|
include "abstract.typst"
|
||||||
|
|
||||||
|
/* 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 numering
|
||||||
|
set page(
|
||||||
|
numbering: "1",
|
||||||
|
number-align: center,
|
||||||
|
)
|
||||||
|
|
||||||
|
// Main bdy.
|
||||||
|
body
|
||||||
|
}
|
||||||
BIN
docs/main.pdf
Normal file
BIN
docs/main.pdf
Normal file
Binary file not shown.
69
docs/main.typst
Normal file
69
docs/main.typst
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
#import "layout.typst": project, indent-par
|
||||||
|
#import "@preview/i-figured:0.1.0"
|
||||||
|
#import "@preview/tablex:0.0.6": tablex, rowspanx, colspanx, cellx
|
||||||
|
#import "utils.typst": *
|
||||||
|
|
||||||
|
#show: project.with(
|
||||||
|
university: "Latvijas Universitāte",
|
||||||
|
faculty: "Eksakto zinātņu un tehnoloģiju fakultāte",
|
||||||
|
title: [Atmiņas kartīšu lietotne ar domēna specifiskās valodas izmantošanu\ Kvalifikācijas darbs],
|
||||||
|
authors: ( "Jorens Štekeļs, js21283", ),
|
||||||
|
advisor: "prof. Dr. sc. comp. Laila Niedrīte",
|
||||||
|
date: "Rīga 2025",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#set heading(numbering: none)
|
||||||
|
|
||||||
|
#pagebreak(weak: true)
|
||||||
|
= Apzīmējumu saraksts
|
||||||
|
|
||||||
|
#par(
|
||||||
|
first-line-indent: 0cm,
|
||||||
|
[
|
||||||
|
/ API: lietojumprogrammu saskarne (angl. Application Program Interface);
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#pagebreak(weak: true)
|
||||||
|
|
||||||
|
= Ievads
|
||||||
|
|
||||||
|
== Nolūks
|
||||||
|
|
||||||
|
#indent-par([
|
||||||
|
Šī darba nolūks ir specificēt lietotnes programmatūras prasības un
|
||||||
|
aprakstīt tās projektējumu, kas tiek aprakstīta un izstrādāta
|
||||||
|
kvalifikācijas darba ietvaros.
|
||||||
|
])
|
||||||
|
|
||||||
|
== Darbības sfēra
|
||||||
|
|
||||||
|
#indent-par([
|
||||||
|
Atmiņas kartītes (Angl. flashcards) ir izplatīts veids, kā skolēni, studenti un
|
||||||
|
citi macošies cilvēki iegaumē materiālu. Šādu kartīšu pamatā parasti ir priekša
|
||||||
|
un aizmugura. Priekšā atrodas jautājums vai uzdevums vai cita informācija, kas
|
||||||
|
uzstāda mentālu vai praktisku uzdevumu, iespējams iekļaujot arī mājieni.
|
||||||
|
Aizmugurā atrodas atbildes teksts, kas ar sevi atbild vai parāda pareizu
|
||||||
|
atbildi uz priekšā uzstādītu jautājumu vai uzdevumu.
|
||||||
|
])
|
||||||
|
|
||||||
|
Tiek veidotas vairākas atmiņas kartītes uz līdzīgu tēmu, veidojas kartīšu kaudzes.
|
||||||
|
Mācīšanas seansā, tiek vērtēts, cik grūti vai viegli jautājumi vai uzdevumi ir
|
||||||
|
atbildāmi vai atrisināmi attiecīgi. Balstoties uz grūtību vai iespēju atbildēt,
|
||||||
|
kartītes tiek grupētas noteiktās grupās, kas, savukārt, nosaka intervālu, pēc kura
|
||||||
|
kartīte figurēs nākamā mācīšanās seansā. Piemēram, grupas - ļoti viegli, vidēji,
|
||||||
|
grūti, neizdevās -, kam atbilst 5 dienas, 3 dienas, 1 diena, 0 dienas attiecīgi.
|
||||||
|
Jo lielāka ir subjektīva piepūle, atbildējot uz jautājumu vai risinot uzdevumu,
|
||||||
|
jo TK.
|
||||||
|
|
||||||
|
Veidojot atmiņas kartītes manuāli, var rasties grūtības, kā nozaudēšana,
|
||||||
|
kļūdas sagatavojot tekstu, mācīšanās algoritma uzstādīšanas sarežģītība.
|
||||||
|
|
||||||
|
#pagebreak(weak: true)
|
||||||
|
#set heading(numbering: "1.1.")
|
||||||
|
|
||||||
|
= Vispārējais apraksts
|
||||||
|
|
||||||
|
|
||||||
205
docs/utils.typst
Normal file
205
docs/utils.typst
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
#import "@preview/tablex:0.0.6": 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]")]
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user