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