commit 22740805bdd9c37e257aa4fb327e3e4548f6a9b1 Author: Annwan Date: Thu Oct 17 03:34:58 2024 +0200 Template diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f0de8a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +main.pdf diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0a85c1f --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +main.pdf: annwan-grammar.typ main.typ + typst c main.typ diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/annwan-grammar.typ b/annwan-grammar.typ new file mode 100644 index 0000000..86d0a90 --- /dev/null +++ b/annwan-grammar.typ @@ -0,0 +1,64 @@ +#let conf( + clong-title: "", + title: "", + author: "Annwan", + date: datetime.today().display(), + main-font: (font: "Andika", stylistic-set: 13), + clong-font: it => text(font: "Charis SIL", it), + doc +) = { + set text(..main-font) + set par(justify: true) + set heading(numbering: "I.1.1.1") + show heading.where(level: 1): it => align(center, it) + align(horizon, { + align(center, text(20pt)[*#title*]) + if clong-title != "" { + align(center, clong-font(text(18pt)[*#clong-title*])) + } + align(center, author) + align(center, date) + }) + + pagebreak() + outline( + fill: repeat([#h(1em).]) + ) + pagebreak(weak: true) + set page( + footer: [ + #h(1fr) + #context counter(page).get().at(0) + #h(1fr) + ] + ) + counter(page).update(1) + doc +} +#let dict( + data: (), + key: it => it.at("w"), + wformat: it => [*#it*] +) = { + pagebreak(weak: true) + set page( + footer: [ + #h(1fr) + #context numbering("i", counter(page).get().at(0)) + #h(1fr) + ] + ) + counter(page).update(1) + set heading( + numbering: none, outlined: false + ) + [= Dictionary] + + columns(2, { + let sorted_data = data.sorted(key: key) + for word in sorted_data [ + #wformat(word.at("w")) /#word.at("i")/ _#word.at("p")_ #eval(word.at("n"), mode: "markup") \ + ] + }) +} + diff --git a/dictionnary.yml b/dictionnary.yml new file mode 100644 index 0000000..e3b2ea8 --- /dev/null +++ b/dictionnary.yml @@ -0,0 +1,4 @@ +- w: Word In Language Goes Here + i: Pronounciation Goes Here + p: Part Of Speech Goes Here + n: Definition Goes Here diff --git a/main.typ b/main.typ new file mode 100644 index 0000000..31d871e --- /dev/null +++ b/main.typ @@ -0,0 +1,4 @@ +#import "annwan-grammar.typ": * +#show: it => conf(title: "", clong-title: "",clong-font: it => text(font: "Charis SIL", it), it) + +#dict(data: yaml("dictionnary.yml"), wformat: it => text(font: "Charis SIL", [*#it*]))