Compare commits

..

5 Commits

Author SHA1 Message Date
63acdd1397 style(show): use show: lettre.with() instead of unnamed function
- Maybe more idiomatic… not sure actually
2025-02-11 20:03:47 +01:00
1961298f00 style(template): remove useless else 2024-10-20 11:26:16 +02:00
9af1dcb98b fix(template): fix the display of location and date
- extra space
- without the location, the comma still appeared
- docs(readme): add the optional comment for the sending location
2024-10-20 11:24:05 +02:00
be06465111 style(readme): Add a link to lettre.typ 2024-10-19 21:40:23 +02:00
5235b3a891 fix(readme): remove unnecessary line 2024-10-19 21:39:40 +02:00
4 changed files with 15 additions and 9 deletions

Binary file not shown.

View File

@ -1,7 +1,7 @@
#import "lettre.typ": *
#show link: strong
#show: doc => lettre(
#show: lettre.with(
de: [
Ex Péditeur,\
12 rue des Sept Nains\
@ -21,7 +21,6 @@
post: [
#emph("PS: Finalement, rien.")
],
doc
)
je soussigné, Ex Péditeur, atteste par la présente sur lhonneur que ce document

View File

@ -17,13 +17,22 @@
show raw: set text(font: "Inconsolata")
show heading: set block(above: 1.4em, below: 1em)
let formatLieuDate(lieu, date) = {
let isDate = date.trim().len() > 0;
let isLieu = lieu.trim().len() > 0;
if isLieu [#lieu]
if isDate {
if isLieu [, ]
[le #date]
}
}
grid(
columns: (2fr, 1fr, 2fr),
par(de),
text[],
text[
#lieu
#if date.trim().len() != 0 [, le #date ]
#formatLieuDate(lieu, date)
] + v(2em),
text[],
text[],

View File

@ -3,13 +3,12 @@ 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:
parameters, with the [`lettre.typ`](./lettre.typ) file in the same folder:
```typst
#import "lettre.typ": *
#show link: strong
#show: doc => lettre(
#show: lettre.with(
de: [
Sender\
Address
@ -20,14 +19,13 @@ parameters, with the `lettre.typ` file in the same folder:
],
objet: "subject of the letter", // optional
date: "date of sending", // optional
lieu: "location",
lieu: "location", // optional
introduction: "opening",
cloture: "closing",
signature: "signature",
post: [
post-letter (e.g., post-scriptum)
],
doc
)
```