]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/document-markup.scm
Move *.py musicxml regression test files to buildscripts/
[lilypond.git] / scm / document-markup.scm
index 7ff76fa3f77dd188a5942c0d7f4642f9f95acef4..8761deb83db17b031f0d65f12f1d7e9ef7395053 100644 (file)
@@ -1,51 +1,66 @@
+;;;; document-markup.scm -- part of generated backend documentation
+;;;;
+;;;;  source file of the GNU LilyPond music typesetter
+;;;; 
+;;;; (c) 1998--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;;                 Jan Nieuwenhuizen <janneke@gnu.org>
 
 (define (doc-markup-function func)
-  (let*
-      (
-       (doc-str  (procedure-documentation func) )
-       (f-name (symbol->string (procedure-name  func)))
-       (sig (object-property func 'markup-signature))
-       (sig-str (string-join (map type-name sig) " "))
-       )
+  (let* ((doc-str  (procedure-documentation func))
+        (f-name (symbol->string (procedure-name  func)))
+        (c-name (regexp-substitute/global #f "-markup(-list)?$" f-name  'pre "" 'post))
+        (sig (object-property func 'markup-signature))
+        (arg-names (let ((arg-list (cadr (procedure-source func))))
+                      (if (list? arg-list)
+                          (map symbol->string (cddr arg-list))
+                          (make-list (length sig) "arg"))))
+        (sig-type-names (map type-name sig))
+        (signature-str
+         (string-join
+          (map (lambda (x) (string-append
+                            "@var{" (car x) "} ("  (cadr x) ")" ))
+               (zip arg-names  sig-type-names))
+          " " )))
     
-    
-       
-  (string-append
-   "\n\n@b{"
-   f-name
-   "}\n\n@findex " f-name "\n"
-   "\n\n@i{Argument types}: " sig-str
-   (if (string? doc-str)
-       (string-append
-       "\n\n@i{Description}: \n\n"
-       doc-str)
-       "")
-   
-   
-  )))
+    (string-append
+     "\n\n@item @code{\\" c-name "} " signature-str
+     
+     "\n@findex " f-name "\n"
+     "\n@cindex @code{" c-name "}\n"
+     
+     (if (string? doc-str)
+        doc-str
+        ""))))
 
 (define (markup-function<? a b)
   (string<? (symbol->string (procedure-name a)) (symbol->string (procedure-name b))))
 
+(define (markup-doc-string)
+  (string-append
+   
+   "@table @asis"
+   (apply string-append
+         
+         (map doc-markup-function
+              (sort markup-function-list markup-function<?)))
+   "\n@end table"))
+
+(define (markup-list-doc-string)
+  (string-append
+   "@table @asis"
+   (apply string-append
+         (map doc-markup-function
+              (sort markup-list-function-list markup-function<?)))
+   "\n@end table"))
+
 (define (markup-doc-node)
   (make <texi-node>
     #:name "Markup functions"
     #:desc "Definitions of the markup functions."
+    #:text (markup-doc-string)))
 
-
-    #:text (apply string-append
-                 
-                 "A @code{\\markup} mode command, eg. @code{bold}, is
-coupled with a Scheme function (@code{bold-markup}) implementing the
-formatting.  For use in Scheme, a function @code{make-bold-markup} is
-also defined, which constructs a Markup expression.
-
-This chapter describes all of the @code{...-markup} functions.
-
-"
-
-                 (map doc-markup-function
-                      (sort markup-function-list markup-function<?) ))
-    ))
-
-
+(define (markup-list-doc-node)
+  (make <texi-node>
+    #:name "Markup list functions"
+    #:desc "Definitions of the markup list functions."
+    #:text (markup-list-doc-string)))