From 41eebac1c92cd45dffb1153a3e5d61aa81e194d9 Mon Sep 17 00:00:00 2001
From: Simon Tournier <simon.tournier@u-paris.fr>
Date: Wed, 12 Feb 2025 23:50:20 +0100
Subject: [PATCH] doc/build: Read date from Markdown file.

* doc/build.scm (markdown->latex)<build>: Rely on commondmark reader from
Skribilo.
---
 doc/build.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/doc/build.scm b/doc/build.scm
index 530d643..1367fac 100644
--- a/doc/build.scm
+++ b/doc/build.scm
@@ -247,8 +247,16 @@ directory containing LaTeX files."
 \\includepdf[fitpaper=true, pages=-]{back.pdf}
 ")))))
                  (document (eval exp (make-user-module 'skribilo)))
-                 (date (or (markup-option document #:date)
-                           "February 2025"))
+                 (date (match (markup-option document #:date)
+                         ((year month rest ...)
+                          (let* ((month (string->number month))
+                                 (month (cond
+                                         ((= month 1) "January")
+                                         ((= month 2) "February")
+                                         ((= month 3) "March")
+                                         (else "Too late!"))))
+                            (string-append month " " year)))
+                         (_ "Fix Skribilo CommonMark reader :-)")))
                  (authors (string-join
                            (map (lambda (author)
                                   (markup-option author #:name))
-- 
GitLab