+;;;;
+;;;; LilyPond is free software: you can redistribute it and/or modify
+;;;; it under the terms of the GNU General Public License as published by
+;;;; the Free Software Foundation, either version 3 of the License, or
+;;;; (at your option) any later version.
+;;;;
+;;;; LilyPond is distributed in the hope that it will be useful,
+;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;;; GNU General Public License for more details.
+;;;;
+;;;; You should have received a copy of the GNU General Public License
+;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+
+(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))