1 ;;;; This file is part of LilyPond, the GNU music typesetter.
3 ;;;; Copyright (C) 2011--2012 Neil Puttock <n.puttock@gmail.com>
5 ;;;; LilyPond is free software: you can redistribute it and/or modify
6 ;;;; it under the terms of the GNU General Public License as published by
7 ;;;; the Free Software Foundation, either version 3 of the License, or
8 ;;;; (at your option) any later version.
10 ;;;; LilyPond is distributed in the hope that it will be useful,
11 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ;;;; GNU General Public License for more details.
15 ;;;; You should have received a copy of the GNU General Public License
16 ;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
18 (use-modules (ice-9 format))
20 (define (grob-property-path path)
21 (string-join (map symbol->string path) " "))
23 (define (document-mod-list op)
29 (let ((value (car args))
33 (format "grob property @code{~a} "
34 (grob-property-path path))
35 (format "in @code{@rinternals{~a}} to ~a."
42 (format "grob property @code{~a} "
43 (grob-property-path (car args)))
44 (format "in @code{@rinternals{~a}}."
48 (format "@item Sets translator property @code{~a} to ~a.\n"
50 (scm->texi (car args))))
52 (format "@item Unsets translator property @code{~a}.\n"
55 (format "@item Adds @code{@rinternals{~a}}.\n" name-sym))
57 (format "@item Removes @code{@rinternals{~a}}.\n" name-sym))
60 (define (document-context-mod context-mod-pair)
61 (let* ((name-sym (car context-mod-pair))
62 (mod-list (ly:get-context-mods (cdr context-mod-pair)))
63 (docstring (filter (lambda (mod)
64 (eq? (car mod) 'description))
79 (ly:warning "context modification `~a' not documented." name-sym)
80 "(undocumented; fixme)"))
81 (map document-mod-list mod-list))))
83 (define (document-mod obj-pair)
84 (and (ly:context-mod? (cdr obj-pair))
85 (document-context-mod obj-pair)))
87 (define context-mods-doc-string
97 (ly:module->alist (current-module))