]> git.donarmstrong.com Git - lilypond.git/blob - scm/function-documentation.scm
''
[lilypond.git] / scm / function-documentation.scm
1 (use-modules
2  (ice-9 regex))
3
4 (define (format-c-header c-h)
5   (regexp-substitute/global
6    #f "," 
7    (regexp-substitute/global #f "(SCM|\\)|\\() *" c-h 'pre "" 'post)
8    'pre " " 'post)
9   )
10
11 (define (document-scheme-function name c-header doc-string)
12   (string-append
13    "@defun " (symbol->string name)  " " (format-c-header c-header) "\n"
14    doc-string
15    "\n@end defun\n\n")
16    )
17
18 (define all-scheme-functions
19    (hash-fold
20     (lambda (key val prior)
21       (cons (cons key val)  prior)
22       )
23     '() (ly-get-all-function-documentation))
24    )
25
26 (define (document-all-scheme-functions)
27   (let*
28       (
29
30        (fdocs (map (lambda (x)
31                 (document-scheme-function (car x) (cadr x) (cddr x))
32                 )
33               all-scheme-functions)
34          )
35        (sfdocs (sort fdocs string<?))
36        )
37
38     (apply string-append sfdocs)
39          
40   ))
41
42