1 ;;;; This file is part of LilyPond, the GNU music typesetter.
3 ;;;; Copyright (C) 1998--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
4 ;;;; Jan Nieuwenhuizen <janneke@gnu.org>
6 ;;;; LilyPond is free software: you can redistribute it and/or modify
7 ;;;; it under the terms of the GNU General Public License as published by
8 ;;;; the Free Software Foundation, either version 3 of the License, or
9 ;;;; (at your option) any later version.
11 ;;;; LilyPond is distributed in the hope that it will be useful,
12 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;;; GNU General Public License for more details.
16 ;;;; You should have received a copy of the GNU General Public License
17 ;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
19 (define (music-props-doc)
21 #:name "Music properties"
22 #:desc "All music properties, including descriptions."
24 (let* ((ps (sort (map symbol->string all-music-properties) ly:string-ci<?))
25 (descs (map (lambda (prop)
26 (property->texi 'music (string->symbol prop)))
28 (texi (description-list->texi descs #f)))
31 (define music-types->names (make-hash-table 61))
32 (filter-map (lambda (entry)
33 (let* ((class (ly:camel-case->lisp-identifier (car entry)))
34 (classes (ly:make-event-class class)))
38 (hashq-set! music-types->names cl
40 (hashq-ref music-types->names cl '()))))
46 (define (strip-description x)
47 (cons (symbol->string (car x))
50 (define (music-type-doc entry)
51 (let* ((accept-list (human-listify
54 (map ly:translator-name
57 (engraver-accepts-music-type? (car entry) x))
58 all-engravers-list)))))))
60 #:name (symbol->string (car entry))
63 "\nMusic event type @code{"
64 (symbol->string (car entry))
65 "} is in music objects of type "
67 (map ref-ify (sort (map symbol->string (cdr entry))
72 (if (equal? accept-list "none")
73 "Not accepted by any engraver or performer"
79 (define (music-types-doc)
81 #:name "Music classes"
85 (hash-table->alist music-types->names) ly:alist-ci<?))))
87 (define (music-doc-str obj)
88 (let* ((namesym (car obj))
90 (class (ly:camel-case->lisp-identifier namesym))
91 (classes (ly:make-event-class class))
92 (accept-list (if classes
96 (map ly:translator-name
99 (engraver-accepts-music-types? classes x))
100 all-engravers-list)))))
102 (event-texi (if classes
104 "\n\nEvent classes:\n"
106 (map ref-ify (sort (map symbol->string classes)
111 (if (equal? accept-list "none")
112 "Not accepted by any engraver or performer"
120 (object-property namesym 'music-description)
123 (description-list->texi
125 (lambda (x) (property->texi 'music x props))
126 (sort (map car props) ly:symbol-ci<?))
129 (define (music-object-doc obj)
131 #:name (symbol->string (car obj))
132 #:text (music-doc-str obj)))
134 (define (music-expressions-doc)
136 #:name "Music expressions"
137 #:desc "Objects that represent music."
139 (map music-object-doc music-descriptions)))
141 (define (music-doc-node)
143 #:name "Music definitions"
144 #:desc "Definition of the input data structures."
147 (music-expressions-doc)