1 ;;;; This file is part of LilyPond, the GNU music typesetter.
3 ;;;; Copyright (C) 1998--2012 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 doc-context (ly:make-global-context $defaultlayout))
21 (define (music-props-doc)
23 #:name "Music properties"
24 #:desc "All music properties, including descriptions."
26 (let* ((ps (sort (map symbol->string all-music-properties) ly:string-ci<?))
27 (descs (map (lambda (prop)
28 (property->texi 'music (string->symbol prop)))
30 (texi (description-list->texi descs #f)))
33 (define music-types->names (make-hash-table 61))
34 (filter-map (lambda (entry)
35 (let* ((class (ly:camel-case->lisp-identifier (car entry)))
36 (classes (ly:make-event-class doc-context class)))
40 (hashq-set! music-types->names cl
42 (hashq-ref music-types->names cl '()))))
48 (define (strip-description x)
49 (cons (symbol->string (car x))
52 (define (music-type-doc entry)
53 (let* ((accept-list (human-listify
56 (map ly:translator-name
59 (engraver-accepts-music-type? (car entry) x))
60 all-engravers-list)))))))
62 #:name (symbol->string (car entry))
65 "\nMusic event type @code{"
66 (symbol->string (car entry))
67 "} is in music objects of type "
69 (map ref-ify (sort (map symbol->string (cdr entry))
74 (if (equal? accept-list "none")
75 "Not accepted by any engraver or performer"
81 (define (music-types-doc)
83 #:name "Music classes"
87 (hash-table->alist music-types->names) ly:alist-ci<?))))
89 (define (music-doc-str obj)
90 (let* ((namesym (car obj))
92 (class (ly:camel-case->lisp-identifier namesym))
93 (classes (ly:make-event-class doc-context class))
94 (accept-list (if classes
98 (map ly:translator-name
101 (engraver-accepts-music-types? classes x))
102 all-engravers-list)))))
104 (event-texi (if classes
106 "\n\nEvent classes:\n"
108 (map ref-ify (sort (map symbol->string classes)
113 (if (equal? accept-list "none")
114 "Not accepted by any engraver or performer"
122 (object-property namesym 'music-description)
125 (description-list->texi
127 (lambda (x) (property->texi 'music x props))
128 (sort (map car props) ly:symbol-ci<?))
131 (define (music-object-doc obj)
133 #:name (symbol->string (car obj))
134 #:text (music-doc-str obj)))
136 (define (music-expressions-doc)
138 #:name "Music expressions"
139 #:desc "Objects that represent music."
141 (map music-object-doc music-descriptions)))
143 (define (music-doc-node)
145 #:name "Music definitions"
146 #:desc "Definition of the input data structures."
149 (music-expressions-doc)