1 ;;;; document-funcions.scm -- part of generated backend documentation
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 1998--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 ;;;; Jan Nieuwenhuizen <janneke@gnu.org>
11 (define (dashify-underscores str)
12 (regexp-substitute/global #f "_" str 'pre "-" 'post))
14 (define (format-c-header c-h)
15 (regexp-substitute/global
17 (regexp-substitute/global #f "(SCM|\\)|\\() *" (dashify-underscores c-h)
21 (define (document-scheme-function name c-header doc-string)
23 "@defun " (symbol->string name) " " (format-c-header c-header) "\n"
27 (define all-scheme-functions
29 (lambda (key val prior)
30 (cons (cons key val) prior))
31 '() (ly:get-all-function-documentation)))
33 (define (all-scheme-functions-doc)
34 (let* ((fdocs (map (lambda (x)
35 (document-scheme-function (car x) (cadr x) (cddr x)))
36 all-scheme-functions))
37 (sfdocs (sort fdocs string<?)))
39 #:name "Scheme functions"
40 #:desc "Primitive functions exported by LilyPond."
42 (apply string-append sfdocs))))
44 ;; (dump-node (all-scheme-functions-doc) (current-output-port) 0 )