aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-01-12 20:04:13 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2026-01-15 23:01:29 +0100
commitb6677f5d15ea05b3c7410c8a9cff01f5e426fd39 (patch)
treede40d0179b8e0e3625438c48e7483d95bdb76369
parent27703f70d907a78b2b0341ecc77bf4e8ed9fe6c1 (diff)
feat(typst): template file
-rw-r--r--README.md35
-rw-r--r--typst/README.md29
-rw-r--r--typst/template.typ124
3 files changed, 186 insertions, 2 deletions
diff --git a/README.md b/README.md
index 4e27d02..7cc0bbd 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,40 @@
# dotfiles
-My personnal dotfiles of my workstation powered by Void, Sway, niri, nvim and fish.
+My dotfiles of my workstation powered by Void, ~~Sway,~~ niri, nvim and fish.
+
+Detailled information available [on my website](https://anhgelus.world/setup) (in French).
+
+## nvim
+
+You can install my nvim config with:
+> [!WARNING]
+> This command will override your NeoVim config.
+> Proceed with caution!
+
+> [!INFO]
+> It will download the AppImage of NeoVim, put it in your home, and clone my config in your `.config/nvim`.
-You can install my nvim config with
```bash
curl -L https://git.anhgelus.world/anhgelus/dotfiles/raw/branch/main/setup.sh | bash
```
+## typst
+
+I write simple packages for typst that are not published on their repository.
+You can find their documentation in the `typst` folder.
+
+You can install these scripts to your local repo with:
+> [!WARNING]
+> This command may overrides scripts installed in your local repository.
+> Proceed with caution!
+
+> [!INFO]
+> These will be available under `@local/<package>:<version>`.
+> See [`typst/README.md`](./typst/README.md) for more information.
+>
+> If you want, you can set `@anhgelus` (or anything else) instead of `@local` by modifying `packages/local/` into
+> `packages/anhgelus`.
+
+```bash
+cp -r typst/* ${XDG_DATA_HOME:-$HOME/.local/share}/typst/packages/local/
+```
diff --git a/typst/README.md b/typst/README.md
new file mode 100644
index 0000000..2f8dd4c
--- /dev/null
+++ b/typst/README.md
@@ -0,0 +1,29 @@
+# typst scripts
+
+The version of these scripts will always be `1.0.0`, because using anything else looks like to be too complicated for
+anything.
+
+## `template.typ`
+
+This template requires:
+- `Inter` as the sans-serif font;
+- `PT Astra Serif` as the serif font;
+- `FiraCode Nerd Font Mono` as the monospace font.
+
+These can be freely used.
+I may add an option to modify this.
+
+Import it and load it with:
+```typ
+// import the script from the local repo
+// if you have modified the repo name, replace `@local` with their name
+#import "@local/template:1.0.0": *
+
+// initialize template
+#show: doc.with(
+ authors: (
+ (name: "Your Name", affiliation: "Your affiliation", email: "Your email"),
+ ),
+ page_title: "Page title :D",
+)
+```
diff --git a/typst/template.typ b/typst/template.typ
new file mode 100644
index 0000000..4d7bc4c
--- /dev/null
+++ b/typst/template.typ
@@ -0,0 +1,124 @@
+#let doc(authors: (), page_title: [], doc) = {
+ // style
+ set text(
+ font: "Inter",
+ size: 11pt,
+ )
+ set par(
+ leading: 1em,
+ first-line-indent: 1em,
+ spacing: 2em,
+ )
+ set heading(numbering: "1.")
+
+ set page(
+ header: align(
+ right + horizon,
+ // Retrieve the document
+ // element's title property.
+ context document.title,
+ ),
+ numbering: "1",
+ margin: (x: 2.85cm),
+ )
+
+ show heading: set par(leading: 0.75em)
+ show heading: set text(font: "PT Astra Serif")
+ show heading.where(level: 1): set block(below: 1em)
+ show heading.where(level: 1): set text(size: 1.2em)
+ show heading.where(level: 1, numbering: "1."): it => {
+ pagebreak(weak: true)
+ it
+ }
+ show heading.where(level: 2): set block(above: 3em, below: 1em)
+ show heading.where(level: 2): set text(size: 1.1em)
+
+ show title: set text(size: 1.25em, font: "PT Astra Serif")
+ show title: set align(center)
+ show title: set block(above: 5em, below: 1em)
+ show title: set par(leading: 0.5em)
+
+ show enum: set par(leading: 0.9em)
+ show list: set par(leading: 0.9em)
+
+ show raw: set text(font: "FiraCode Nerd Font Mono")
+ show raw.where(block: false): set text(weight: 500, size: 1.1em)
+
+ // style
+ set text(
+ font: "Inter",
+ size: 11pt,
+ )
+ set par(
+ leading: 1em,
+ first-line-indent: 1em,
+ spacing: 2em,
+ )
+ set heading(numbering: "1.")
+
+ set page(
+ header: align(
+ right + horizon,
+ // Retrieve the document
+ // element's title property.
+ context {
+ emph([
+ #document.title - #authors.first().name
+ ])
+ }
+ ),
+ numbering: "1",
+ margin: (x: 2.85cm),
+ )
+
+ show heading: set par(leading: 0.75em)
+ show heading: set text(font: "PT Astra Serif")
+ show heading.where(level: 1): set block(below: 1em)
+ show heading.where(level: 1): set text(size: 1.2em)
+ show heading.where(level: 2): set block(above: 3em, below: 1em)
+ show heading.where(level: 2): set text(size: 1.1em)
+
+ show title: set text(size: 1.25em, font: "PT Astra Serif")
+ show title: set align(center)
+ show title: set block(above: 5em, below: 1em)
+ show title: set par(leading: 0.5em)
+ show outline: it => {
+ it
+ pagebreak()
+ }
+
+ show enum: set par(leading: 0.9em)
+ show list: set par(leading: 0.9em)
+
+ show raw: set text(font: "FiraCode Nerd Font Mono")
+ show raw.where(block: false): set text(weight: 500, size: 1.1em)
+ set document(title: page_title)
+ let ncols = calc.min(authors.len(), 3)
+
+ title()
+
+ block(below: 5em, context {
+ grid(
+ columns: (1fr,) * ncols,
+ gutter: 2em,
+ align: center,
+ ..authors.map(author => {
+ par(leading: 0.75em)[
+ #author.name \
+ #author.affiliation \
+ #link("mailto:" + author.email)
+ ]
+ })
+ )
+ })
+
+
+ outline(title: "Table des matières")
+
+ show heading.where(level: 1): it => {
+ pagebreak(weak: true)
+ it
+ }
+
+ doc
+}