2 ;; document-identifiers.scm -- implement documentation
3 ;; of identifiers from .ly file.
5 ;; source file of the GNU LilyPond music typesetter
7 ;; (c) 2006 Han-Wen Nienhuys <hanwen@lilypond.org>
10 (use-modules (ice-9 format))
12 (define (document-music-function music-func-pair)
14 ((name-sym (car music-func-pair))
15 (music-func (cdr music-func-pair))
16 (func (ly:music-function-extract music-func))
19 (cddr (cadr (procedure-source func)))))
20 (doc (procedure-documentation func))
21 (sign (object-property func 'music-function-signature))
22 (type-names (map type-name sign))
26 (map (lambda (x) (format "@var{~a} (~a)"
29 (zip arg-names type-names)))))
35 name-sym (if (equal? "" signature-str) "" " - ") signature-str
37 (if doc doc "(undocumented; fixme)"))))
40 (define (document-object obj-pair)
42 ((ly:music-function? (cdr obj-pair))
43 (document-music-function obj-pair))
48 (define (identifier<? a b)
50 (symbol->string (car a))
51 (symbol->string (car b))))
54 (define-public (identifiers-doc-string)
66 (ly:module->alist (current-module))