+;;;; document-markup.scm -- part of generated backend documentation
+;;;;
+;;;; source file of the GNU LilyPond music typesetter
+;;;;
+;;;; (c) 1998--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Jan Nieuwenhuizen <janneke@gnu.org>
+
+
+(define (doc-markup-function-properties func)
+ (let ((properties (hashq-ref markup-functions-properties func))
+ (prop-strings (list)))
+ (for-each (lambda (prop-spec)
+ (set! prop-strings
+ (if (list? prop-spec)
+ ;; either (prop value) or (prop)
+ (cons (if (null? (cdr prop-spec))
+ (format #f "@item @code{~a}\n" (car prop-spec))
+ (format #f "@item @code{~a} (~a)\n"
+ (car prop-spec)
+ (let ((default (cadr prop-spec)))
+ (if (and (list? default)
+ (null? default))
+ "'()"
+ default))))
+ prop-strings)
+ ;; a markup command: get its properties
+ ;; FIXME: avoid cyclical references
+ (append (doc-markup-function-properties prop-spec)
+ prop-strings))))
+ (or properties (list)))
+ prop-strings))