+;;;; This file is part of LilyPond, the GNU music typesetter.
;;;;
-;;;; documentation-lib.scm -- Assorted Functions for generated documentation
+;;;; Copyright (C) 2000--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Jan Nieuwenhuizen <janneke@gnu.org>
;;;;
-;;;; 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 <hanwen@xs4all.nl>
-;;;; Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; 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 <http://www.gnu.org/licenses/>.
(use-modules (oop goops)
(srfi srfi-13)
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 "}"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 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)
(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))
(init-value (assoc-get sym alist)))