X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdocumentation-lib.scm;h=182f5812721f34be60a59df1a74bb966fa5f64cc;hb=f2bd555640f6f28276fd56250c7e8b1bd07aa1df;hp=6f82b4018a4417b83e8d7f6934248320fa0257de;hpb=dc66bebbf1b1c3a4f34750b5f3254777dcf2766a;p=lilypond.git diff --git a/scm/documentation-lib.scm b/scm/documentation-lib.scm index 6f82b4018a..182f581272 100644 --- a/scm/documentation-lib.scm +++ b/scm/documentation-lib.scm @@ -1,10 +1,20 @@ +;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; documentation-lib.scm -- Assorted Functions for generated documentation +;;;; Copyright (C) 2000--2012 Han-Wen Nienhuys +;;;; Jan Nieuwenhuizen ;;;; -;;;; source file of the GNU LilyPond music typesetter +;;;; 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. ;;;; -;;;; (c) 2000--2009 Han-Wen Nienhuys -;;;; Jan Nieuwenhuizen +;;;; 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 . (use-modules (oop goops) (srfi srfi-13) @@ -46,7 +56,7 @@ (node-children node))) (define (processing name) - (ly:message (_ "Processing ~S...") name)) + (ly:basic-progress (_ "Processing ~S...") name)) (define (self-evaluating? x) (or (number? x) (string? x) (procedure? x) (boolean? x))) @@ -149,7 +159,7 @@ string-to-use). If QUOTE? is #t, embed table in a @quotation environment." name) (define (ref-ify x) - "Return @ref{X}. If mapping ref-ify to a list that needs to be sorted, + "Return @ref{X}. If mapping ref-ify to a list that needs to be sorted, sort the list first." (string-append "@ref{" x "}")) @@ -165,10 +175,21 @@ string-to-use). If QUOTE? is #t, embed table in a @quotation environment." (define (writing-wip x) (ly:message (_ "Writing ~S...") x)) +(define (identifierstring (car a)) + (symbol->string (car b)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; property stuff. +(define (verify-type-name where sym type) + (if (eq? type #f) + (ly:error (_ "cannot find description for property `~S' (~S)") + sym + where)) + (type-name type)) + (define (property->texi where sym . rest) "Document SYM for WHERE (which can be translation, backend, music), with init values from ALIST (1st optional argument) @@ -180,9 +201,9 @@ with init values from ALIST (1st optional argument) (doc-name (string->symbol (string-append (symbol->string where) "-doc"))) (type (object-property sym type?-name)) - (typename (type-name type)) + (typename (verify-type-name where sym type)) (desc (object-property sym doc-name)) - (handle (assoc sym alist))) + (init-value (assoc-get sym alist))) (if (eq? desc #f) (ly:error (_ "cannot find description for property ~S (~S)") sym where)) @@ -190,10 +211,10 @@ with init values from ALIST (1st optional argument) (cons (string-append "@code{" name "} " "(" typename ")" - (if handle + (if init-value (string-append ":\n\n" - (scm->texi (cdr handle)) + (scm->texi init-value) "\n\n") "")) desc)))