From c705d6e035bd46bc2df788124bbed16c1fefa28b Mon Sep 17 00:00:00 2001 From: Sergey Trofimov Date: Wed, 9 Apr 2025 14:46:41 +0200 Subject: [PATCH] man-db: Support mdoc-formatted man pages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/man-db.scm (man-page->entry): Extract man name and section from .Dt macro. Change-Id: I02dc99d73dceecdb077315805025efad9a650e91 Signed-off-by: Ludovic Courtès --- guix/man-db.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guix/man-db.scm b/guix/man-db.scm index 1259658f529..59723fb336f 100644 --- a/guix/man-db.scm +++ b/guix/man-db.scm @@ -227,10 +227,13 @@ for it." ;; man 7 groff groff_mdoc groff_man ;; look for metadata in macro invocations (lines starting with .) (match (and (string-prefix? "." line) (man-macro-tokenize line)) - ((".TH" name (= string->number section) _ ...) + ;; "Title Header" or "Document title" + (((or ".TH" ".Dt") name (= string->number section) _ ...) (loop name section synopsis kind)) + ;; "Section Header" ((".SH" (or "NAME" "\"NAME\"")) (loop name section (read-synopsis port) kind)) + ;; include source ((".so" link) (match (and=> (resolve link) (cut man-page->entry <> resolve))