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
This commit is contained in:
Fabrice Mouhartem 2024-10-20 11:23:04 +02:00
parent be06465111
commit 9af1dcb98b
Signed by: fmouhart
GPG Key ID: 2C5033B228CFE4E7
3 changed files with 13 additions and 3 deletions

Binary file not shown.

View File

@ -17,13 +17,23 @@
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]
else []
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

@ -19,7 +19,7 @@ parameters, with the [`lettre.typ`](./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",