]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/documentation-lib.scm
* tex/GNUmakefile (TEX_FILES): add texinfo.cnf
[lilypond.git] / scm / documentation-lib.scm
index 8dc5edc5cabf2bb6836c7a298fd2fa3ae75ce69c..4f7a0f05948dacb9c3c067230f0809eb46c7cda2 100644 (file)
@@ -1,10 +1,10 @@
-;;;
-;;; documentation-lib.scm -- Assorted Functions for generated documentation
-;;;
-;;; source file of the GNU LilyPond music typesetter
-;;; 
-;;; (c)  2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-;;; Jan Nieuwenhuizen <janneke@gnu.org>
+;;;;
+;;;; documentation-lib.scm -- Assorted Functions for generated documentation
+;;;;
+;;;; source file of the GNU LilyPond music typesetter
+;;;; 
+;;;; (c)  2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;;                 Jan Nieuwenhuizen <janneke@gnu.org>
 
 (use-modules (oop goops)
             (srfi srfi-13)
    ;; prepend GNU for dir, must be unique
    "\n* GNU " name ": (" file-name ").          " name "."
    "\n@end direntry"
+   "@documentlanguage en\n"
+   "@documentencoding ISO-8859-1\n"
+
    ))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; property  stuff.
 
-(define (property->texi where sym)
-  "Document SYM for WHERE (which can be translation, backend, music)"
+(define (property->texi where sym . rest)
+  "Document SYM for WHERE (which can be translation, backend, music),
+with init values from ALIST (1st optional argument)
+"
   (let* ((name (symbol->string sym))
+        (alist (if (pair? rest) (car rest) '()))
         (type?-name (string->symbol
                      (string-append (symbol->string where) "-type?")))
         (doc-name (string->symbol                  
                    (string-append (symbol->string where) "-doc")))
         (type (object-property sym type?-name))
         (typename (type-name type))
-        (desc (object-property sym doc-name)))
+        (desc (object-property sym doc-name))
+        (handle (assoc sym alist))
+        )
 
     (if (eq? desc #f)
        (error "No description for property ~S" sym))
        
     (cons
      (string-append "@code{" name "} "
-                   "(" typename ")")
+                   "(" typename ")"
+                   (if handle
+                       (string-append
+                        ":\n\n"
+                        (scm->texi (cdr handle))
+                        "\n\n")
+                       "")
+                                   
+
+                   )
      desc)
      
     ))
 
-(define (document-property-value sym alist)
-  "Extract value for SYM from ALIST, return as texi string"
-  (let* ((handle (assoc sym alist)))
-    (if (eq? handle #f)
-       "(unset)"
-       (scm->texi (cdr handle)))))
-
-(define (backend-property->texi sym)
-  (property->texi 'backend sym))
-
-(define (document-property sym where alist)
-  "Document SYM. If GROB-DESCRIPTION is not #f, it's an alist
-containing default values."
-  (let*
-      ((without (property->texi where sym))
-       (rv
-
-       (cons (car without)
-             (if (eq? alist #f)
-                 (cdr without)
-                 (string-append
-                  (cdr without)
-                  "\nDefault value: "
-                  (document-property-value sym alist))))))
-    rv))