X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdocument-music.scm;h=7d7e2a9942b974169b722eb2ec39b2e33200c390;hb=7b51a4f655755a864f7efe6818b175d5eba2b31f;hp=0d01abb6b9c66b5289ae8ab0cda057f387240150;hpb=a667c0fbd789c30b782bae277456bb1f940ddccc;p=lilypond.git diff --git a/scm/document-music.scm b/scm/document-music.scm index 0d01abb6b9..7d7e2a9942 100644 --- a/scm/document-music.scm +++ b/scm/document-music.scm @@ -1,34 +1,48 @@ -;;;; document-markup.scm -- part of generated backend documentation +;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; source file of the GNU LilyPond music typesetter -;;;; -;;;; (c) 1998--2006 Han-Wen Nienhuys +;;;; Copyright (C) 1998--2012 Han-Wen Nienhuys ;;;; Jan Nieuwenhuizen +;;;; +;;;; LilyPond is free software: you can redistribute it and/or modify +;;;; it under the terms of the GNU General Public License as published by +;;;; the Free Software Foundation, either version 3 of the License, or +;;;; (at your option) any later version. +;;;; +;;;; LilyPond is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with LilyPond. If not, see . + +(define doc-context (ly:make-global-context $defaultlayout)) (define (music-props-doc) (make #:name "Music properties" #:desc "All music properties, including descriptions." #:text - (let* ((ps (sort (map symbol->string all-music-properties) stringstring all-music-properties) ly:string-citexi 'music (string->symbol prop))) ps)) - (texi (description-list->texi descs))) + (texi (description-list->texi descs #f))) texi))) -(define music-types->names (make-vector 61 '())) +(define music-types->names (make-hash-table 61)) (filter-map (lambda (entry) (let* ((class (ly:camel-case->lisp-identifier (car entry))) - (classes (ly:make-event-class class))) + (classes (ly:make-event-class doc-context class))) (if classes - (map (lambda (cl) - (hashq-set! music-types->names cl - (cons (car entry) - (hashq-ref music-types->names cl '())))) - classes) + (map + (lambda (cl) + (hashq-set! music-types->names cl + (cons (car entry) + (hashq-ref music-types->names cl '())))) + classes) #f))) - + music-descriptions) (define (strip-description x) @@ -36,54 +50,71 @@ "")) (define (music-type-doc entry) - (make - #:name (symbol->string (car entry)) - #:text - (string-append - "\nMusic event type @code{" - (symbol->string (car entry)) - "} is in music objects of type " - (human-listify - (sort - (map (lambda (x) (ref-ify (symbol->string x))) - (cdr entry)) stringstring + (map ly:translator-name + (filter + (lambda (x) + (engraver-accepts-music-type? (car entry) x)) + all-engravers-list))))))) + (make + #:name (symbol->string (car entry)) + #:text + (string-append + "\nMusic event type @code{" + (symbol->string (car entry)) + "} is in music objects of type " + (human-listify + (map ref-ify (sort (map symbol->string (cdr entry)) + ly:string-cistring - (map ly:translator-name - (filter - (lambda (x) (engraver-accepts-music-type? (car entry) x)) all-engravers-list))))) - "." - "\n\n"))) + "\n\n" + (if (equal? accept-list "none") + "Not accepted by any engraver or performer" + (string-append + "Accepted by: " + accept-list)) + ".")))) (define (music-types-doc) (make #:name "Music classes" - #:children + #:children (map music-type-doc (sort - (hash-table->alist music-types->names) alistalist music-types->names) ly:alist-cilisp-identifier namesym)) - (classes (ly:make-event-class class)) + (classes (ly:make-event-class doc-context class)) + (accept-list (if classes + (human-listify + (map ref-ify + (map symbol->string + (map ly:translator-name + (filter + (lambda (x) + (engraver-accepts-music-types? classes x)) + all-engravers-list))))) + "")) (event-texi (if classes (string-append "\n\nEvent classes:\n" - (human-listify (map ref-ify (map symbol->string classes))) + (human-listify + (map ref-ify (sort (map symbol->string classes) + ly:string-cistring (map ly:translator-name - (filter - (lambda (x) (engraver-accepts-music-types? classes x)) all-engravers-list))))) + "\n\n" + (if (equal? accept-list "none") + "Not accepted by any engraver or performer" + (string-append + "Accepted by: " + accept-list)) ".") ""))) @@ -94,7 +125,8 @@ (description-list->texi (map (lambda (x) (property->texi 'music x props)) - (map car props)))))) + (sort (map car props) ly:symbol-ci