+;;; generate-documentation.scm -- Generate documentation
+;;;
+;;; source file of the GNU LilyPond music typesetter
+;;;
+;;; (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;; Jan Nieuwenhuizen <janneke@gnu.org>
-(define (urlfy x)
- (string-append "<a href=" x ".html>" x "</a>"))
+;;; File entry point for generated documentation
-(define (human-listify l)
- (cond
- ((null? l) "none")
- ((null? (cdr l)) (car l))
- ((null? (cddr l)) (string-append (car l) " and " (cadr l)))
- (else (string-append (car l) ", " (human-listify (cdr l))))
- ))
+;;; Running LilyPond on this file generates the documentation
-(define (writing-wip x)
- (display (string-append "Writing " x " ... \n") (current-error-port))
- )
-(eval-string (ly-gulp-file "generate-engraver-documentation.scm"))
-(eval-string (ly-gulp-file "generate-backend-documentation.scm"))
+;; We use ly-gulp because these files live in
+;;
+;; PATH=$LILYPONDPREFIX/scm:<datadir>/scm
+;;
+(eval-string
+ (apply string-append
+ (map ly-gulp-file '("documentation-lib.scm"
+ "engraver-documentation-lib.scm"
+ "music-documentation-lib.scm"
+ "backend-documentation-lib.scm"))))
+
+;;(define no-copies #t) ; from 490 to 410K, but doesn't look nice yet
+;;
+;; Also, copies of interfaces use up lots more space, but that's
+;; functional because the default property values of the interfaces
+;; are described...
+(define no-copies #f)
+
+(let* ((doc (string-append
+ (document-music "LilyPond music properties")
+ (document-paper "LilyPond interpretation contexts")
+ (document-all-engravers "LilyPond engravers")
+ (document-all-engraver-properties "LilyPond context properties")
+ (document-all-grobs "LilyPond backend")
+ (document-all-interfaces "LilyPond interfaces")
+ (document-all-backend-properties "LilyPond backend properties")
+ )
+ )
+ (name "lilypond-internals")
+ (outname (string-append name ".texi"))
+ (out (open-output-file outname)))
+
+ (writing-wip outname)
+ (display
+ (string-append
+ (texi-file-head
+
+ ;; we can't use (dir) and top if we're included by lilypond.tely
+ "LilyPond internals" name "(lilypond.info)"
+ '(
+ ("LilyPond music properties" . "properties for Music representation")
+ ("LilyPond interpretation contexts" . "Hierarchy and grouping of Engravers")
+ ("LilyPond engravers" . "Engravers create Grobs")
+ ("LilyPond context properties" . "context properties")
+ ("LilyPond backend" . "Detailed description of all Grobs")
+ ("LilyPond interfaces" . "Grob Interfaces")
+ ("LilyPond backend properties" . "Grob properties")
+ ("Index" . "index")
+ ))
+
+
+
+ doc
+
+ "@node Index
+@unnumbered Concept index
+
+@printindex cp
+
+@unnumbered Variable index
+
+@printindex vr
+
+@unnumbered Function index
+
+@printindex fn
+
+"
+
+
+ "\n@bye")
+ out))
+
+(newline (current-error-port))