1 ;;;; document-markup.scm -- part of generated backend documentation
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
6 ;;;; Jan Nieuwenhuizen <janneke@gnu.org>
8 (define (doc-markup-function func)
9 (let* ((doc-str (procedure-documentation func))
10 (f-name (symbol->string (procedure-name func)))
11 (c-name (regexp-substitute/global #f "-markup$" f-name 'pre "" 'post))
12 (sig (object-property func 'markup-signature))
15 (cddr (cadr (procedure-source func)))))
17 (sig-type-names (map type-name sig))
18 (signature (zip arg-names sig-type-names))
21 (map (lambda (x) (string-append
22 "@var{" (car x) "} (" (cadr x) ")" ))
23 (zip arg-names sig-type-names))
27 "\n\n@item @code{\\" c-name "} " signature-str
29 "\n@findex " f-name "\n"
30 "\n@cindex @code{" c-name "}\n"
36 (define (markup-function<? a b)
37 (string<? (symbol->string (procedure-name a)) (symbol->string (procedure-name b))))
39 (define (markup-doc-string)
45 (map doc-markup-function
46 (sort markup-function-list markup-function<?)))
49 (define (markup-doc-node)
51 #:name "Markup functions"
52 #:desc "Definitions of the markup functions."
53 #:text (markup-doc-string)))