From 45a8a5340449b04a7464e4dad88115740950ebf0 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Sat, 19 Oct 2024 21:37:21 +0200 Subject: [PATCH] docs(readme): add usage + example --- readme.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/readme.md b/readme.md index 6c25355..d4e4ff1 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,42 @@ A simple template for French letters for typst. + +## Usage + +To create a letter, write a typst document while defining the following +parameters, with the `lettre.typ` file in the same folder: + +```typst +#import "lettre.typ": * +#show link: strong + +#show: doc => lettre( + de: [ + Sender\ + Address + ], + pour: [ + Recipient\ + Address + ], + objet: "subject of the letter", // optional + date: "date of sending", // optional + lieu: "location", + introduction: "opening", + cloture: "closing", + signature: "signature", + post: [ + post-letter (e.g., post-scriptum) + ], + doc +) +``` + +Now you can fill the letter afterward, and compile your document with: + +```bash +typst compile +``` + +## Example + +An example file is given in the [`exemple.typ`](./exemple.typ) file in the repository.