From 6d462c0b0c56522e5f7d48b6ceaefd219966f547 Mon Sep 17 00:00:00 2001 From: Conlanging & Worldbuilding <> Date: Thu, 17 Oct 2024 03:37:23 +0200 Subject: [PATCH] Initial commit --- .gitignore | 1 + Makefile | 2 ++ README | 0 annwan-grammar.typ | 64 ++++++++++++++++++++++++++++++++++++++++++++++ dictionnary.yml | 4 +++ main.typ | 4 +++ 6 files changed, 75 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README create mode 100644 annwan-grammar.typ create mode 100644 dictionnary.yml create mode 100644 main.typ 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*]))