mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
man-db: Support mdoc-formatted man pages.
* guix/man-db.scm (man-page->entry): Extract man name and section from .Dt macro. Change-Id: I02dc99d73dceecdb077315805025efad9a650e91 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
80cda80489
commit
c705d6e035
1 changed files with 4 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue