diff options
| author | hachem <im@hachem.wtf> | 2026-09-18 18:29:59 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-18 18:29:59 +0200 |
| commit | 8075871a5b364d41f59a8153bb632cd9c893f895 (patch) | |
| tree | 04343c6574d15d8b9ae8ceb555070b764e46b266 /README.md | |
| parent | 5ecd3773b5a6f40b2c83687180d6f674959f46a3 (diff) | |
chore: docs
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 67 |
1 files changed, 67 insertions, 0 deletions
@@ -2,6 +2,73 @@ Just a couple of dumb Typst templates so I stop rewriting the same document setup every fucking time. +```sh +$ mktypst rapport +$ typst watch rapport.typ +``` + +## Templates +`paper` is a two-column academic article; `letter` is a French formal letter. Both are French by default (`lang: "fr"`), so you get guillemets, the spacing before `; : ! ?`, `Résumé`, `Tableau`, all of it — pass `lang: "en"` for English. + +You apply one with a `#show` rule at the top of the document and start writing: + +```typ +#import "@local/hachem:0.1.0": paper + +#show: paper.with( + title: "Les Origines de YHWH", + date: "mars 2026", + authors: ((name: "Hachem H.", location: [Paris, France]),), + abstract: [Un paragraphe.], +) + += Introduction +Du texte. +``` + +The `letter` works the same way. There are full examples in `samples/`, and `make samples` compiles them. + +## Usage + +```text +$ mktypst --help +mktypst 0.1.0 - dumb typst document generator + +generates a typst document that imports and applies an mktypst +template, so you can start writing instead of pasting a preamble. + +usage: mktypst [-t template] [-T title] [-a author] [-d date] [-f] <name> + mktypst [-v | -h] + +options: + -t, --template NAME template to apply (default paper) + -T, --title TITLE document title (default: the name) + -a, --author NAME author name (default: git config user.name) + -d, --date DATE document date (default: current month) + -f, --force overwrite an existing file + --stdout write to stdout instead of a .typ file + -v, --version print version and bail + -h, --help print this and bail + +by hachem <im@hachem.wtf> +``` + +```sh +$ mktypst rapport # paper, the default +$ mktypst -t letter -T "candidature" x # a letter instead +$ mktypst --stdout note # print it, don't write a file +``` + +## Install + +```sh +$ git clone https://git.hachem.wtf/mktypst && cd mktypst +$ sudo make install # mktypst -> /usr/local/bin, templates -> @local/hachem +$ make install PREFIX=~/.local # or without sudo +``` + +You need a C compiler for the binary, and Typst (plus the EB Garamond font) to build documents. The templates install into Typst's local package dir, so any file can `#import "@local/hachem:0.1.0"`. In the Typst app, link that folder as the namespace `local` and it works there too. + ## License `mktypst` is licensed under the MIT License. See [LICENSE](LICENSE) for more. |
