skribilo-mdoc

Unnamed repository; edit this file 'description' to name the repository.

git clone https://git.8pit.net/skribilo-mdoc.git

 1;; This file provides a package for describing man pages using
 2;; Skribilo. While currently, markup writers for the defined
 3;; markup are only implemented for the mdoc engine, these
 4;; markups could also be used with different engines. For example,
 5;; with an engine implementing the legacy man(7) markup.
 6;;
 7;; See https://man.openbsd.org/man.7
 8
 9(define-module (skribilo package man)
10  #:use-module (skribilo utils keywords)
11  #:use-module (skribilo utils syntax)
12  #:use-module (skribilo lib)
13  #:use-module (skribilo ast)
14  #:use-module (skribilo engine))
15
16(skribilo-module-syntax)
17
18;; Markup for inserting the name of the current man page.
19(define-markup (man-name :rest ignored)
20  (new markup
21       (loc &invocation-location)
22       (markup 'man-name)))
23
24(define-markup (man-flags :rest flags)
25  (new markup
26    (markup 'man-flags)
27    (loc &invocation-location)
28    (body
29      ;; TODO: Filter out deliminters such as `|`.
30      ;; See the MACRO SYNTAX section in mdoc(7).
31      (the-body flags))))
32
33;; The .Ar macro
34(define-markup (man-arg :rest args)
35  (new markup
36    (markup 'man-arg)
37    (loc &invocation-location)
38    (body (the-body args))))
39
40;; The .Op macro
41(define-markup (man-opt :rest args)
42  (new markup
43    (markup 'man-opt)
44    (loc &invocation-location)
45    (body (the-body args))))