]> git.donarmstrong.com Git - lilypond.git/blob - scm/document-type-predicates.scm
Add '-dcrop' option to ps and svg backends
[lilypond.git] / scm / document-type-predicates.scm
1 ;;;; This file is part of LilyPond, the GNU music typesetter.
2 ;;;;
3 ;;;; Copyright (C) 2010--2015 Mark Polesky <markpolesky@yahoo.com>
4 ;;;;
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.
9 ;;;;
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.
14 ;;;;
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/>.
17
18 (define (document-type-predicate entry)
19   (let ((pred (procedure-name (car entry))))
20     (string-append
21      "@item @code{"
22      (case pred
23        ;; don't print "cheap-markup?"
24        ((cheap-markup?) "markup?")
25        (else (symbol->string pred)))
26      "} @tab \n"
27      (case pred
28        ;; clarify `list?' vs. `cheap-list?'
29        ((list?) "list @emph{(use} @code{cheap-list?}
30                 @emph{for faster processing)}")
31        ((cheap-list?) "list @emph{(use this instead of}
32                       @code{list?} @emph{for faster processing)}")
33        (else (cdr entry)))
34      "\n")))
35
36 (define (document-type-predicate-category alist nodename)
37   (string-append
38    "@node " nodename "\n"
39    "@unnumberedsubsec " nodename "\n"
40    "\n"
41    "@multitable @columnfractions .33 .66\n"
42    "@headitem Type predicate @tab Description\n"
43    (string-concatenate
44     (sort (map document-type-predicate alist)
45           ly:string-ci<?))
46    "@end multitable\n"
47    "\n"))
48
49 (define-public type-predicates-doc-string
50   (string-append
51    "@menu\n"
52    "* R5RS primary predicates::\n"
53    "* R5RS secondary predicates::\n"
54    "* Guile predicates::\n"
55    "* LilyPond scheme predicates::\n"
56    "* LilyPond exported predicates::\n"
57    "@end menu\n"
58    "\n"
59    (string-concatenate
60     (map
61      (lambda (alist-nodename-list)
62        (apply document-type-predicate-category
63               alist-nodename-list))
64      `((,r5rs-primary-predicates "R5RS primary predicates")
65        (,r5rs-secondary-predicates "R5RS secondary predicates")
66        (,guile-predicates "Guile predicates")
67        (,lilypond-scheme-predicates "LilyPond scheme predicates")
68        (,lilypond-exported-predicates "LilyPond exported predicates"))))))