1 ;;;; document-markup.scm -- part of generated backend documentation
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 1998--2007 Han-Wen Nienhuys <hanwen@xs4all.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(-list)?$" f-name 'pre "" 'post))
12 (sig (object-property func 'markup-signature))
13 (arg-names (let ((arg-list (cadr (procedure-source func))))
15 (map symbol->string (cddr arg-list))
16 (make-list (length sig) "arg"))))
17 (sig-type-names (map type-name sig))
20 (map (lambda (x) (string-append
21 "@var{" (car x) "} (" (cadr x) ")" ))
22 (zip arg-names sig-type-names))
26 "\n\n@item @code{\\" c-name "} " signature-str
28 "\n@findex " f-name "\n"
29 "\n@cindex @code{" c-name "}\n"
35 (define (markup-function<? a b)
36 (string<? (symbol->string (procedure-name a)) (symbol->string (procedure-name b))))
38 (define (markup-doc-string)
44 (map doc-markup-function
45 (sort markup-function-list markup-function<?)))
48 (define (markup-list-doc-string)
52 (map doc-markup-function
53 (sort markup-list-function-list markup-function<?)))
56 (define (markup-doc-node)
58 #:name "Markup functions"
59 #:desc "Definitions of the markup functions."
60 #:text (markup-doc-string)))
62 (define (markup-list-doc-node)
64 #:name "Markup list functions"
65 #:desc "Definitions of the markup list functions."
66 #:text (markup-list-doc-string)))