1 ;;;; This file is part of LilyPond, the GNU music typesetter.
3 ;;;; Copyright (C) 1998--2015 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))
33 (for-each (lambda (entry)
34 (let* ((class (ly:camel-case->lisp-identifier (car entry)))
35 (classes (ly:make-event-class class)))
39 (hashq-set! music-types->names cl
41 (hashq-ref music-types->names cl '()))))
45 (define (strip-description x)
46 (cons (symbol->string (car x))
49 (define (music-type-doc entry)
50 (let* ((accept-list (human-listify
53 (map ly:translator-name
56 (engraver-accepts-music-type? (car entry) x))
57 all-engravers-list)))))))
59 #:name (symbol->string (car entry))
62 "\nMusic event type @code{"
63 (symbol->string (car entry))
64 "} is in music objects of type "
66 (map ref-ify (sort (map symbol->string (cdr entry))
71 (if (equal? accept-list "none")
72 "Not accepted by any engraver or performer"
78 (define (music-types-doc)
80 #:name "Music classes"
84 (hash-table->alist music-types->names) ly:alist-ci<?))))
86 (define (music-doc-str obj)
87 (let* ((namesym (car obj))
89 (class (ly:camel-case->lisp-identifier namesym))
90 (classes (ly:make-event-class class))
91 (accept-list (if classes
95 (map ly:translator-name
98 (engraver-accepts-music-types? classes x))
99 all-engravers-list)))))
101 (event-texi (if classes
103 "\n\nEvent classes:\n"
105 (map ref-ify (sort (map symbol->string classes)
110 (if (equal? accept-list "none")
111 "Not accepted by any engraver or performer"
119 (object-property namesym 'music-description)
122 (description-list->texi
124 (lambda (x) (property->texi 'music x props))
125 (sort (map car props) ly:symbol-ci<?))
128 (define (music-object-doc obj)
130 #:name (symbol->string (car obj))
131 #:text (music-doc-str obj)))
133 (define (music-expressions-doc)
135 #:name "Music expressions"
136 #:desc "Objects that represent music."
138 (map music-object-doc music-descriptions)))
140 (define (music-doc-node)
142 #:name "Music definitions"
143 #:desc "Definition of the input data structures."
146 (music-expressions-doc)