]> git.donarmstrong.com Git - lilypond.git/blob - scm/documentation-generate.scm
Add '-dcrop' option to ps and svg backends
[lilypond.git] / scm / documentation-generate.scm
1 ;;;; This file is part of LilyPond, the GNU music typesetter.
2 ;;;;
3 ;;;; Copyright (C) 2000--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
4 ;;;; Jan Nieuwenhuizen <janneke@gnu.org>
5 ;;;;
6 ;;;; LilyPond is free software: you can redistribute it and/or modify
7 ;;;; it under the terms of the GNU General Public License as published by
8 ;;;; the Free Software Foundation, either version 3 of the License, or
9 ;;;; (at your option) any later version.
10 ;;;;
11 ;;;; LilyPond is distributed in the hope that it will be useful,
12 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ;;;; GNU General Public License for more details.
15 ;;;;
16 ;;;; You should have received a copy of the GNU General Public License
17 ;;;; along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18
19 ;;; File entry point for generated documentation
20 ;;; Running LilyPond on this file generates the documentation
21
22 ;;(set-debug-cell-accesses! 5000)
23
24 ;;;;;;;;;;;;;;;;
25 ;;;;;;;;;;;;;;;; TODO : make modules of these!
26 ;;;;;;;;;;;;;;;;
27
28 ;; todo: naming: grob vs. layout property
29
30 (use-modules (scm accreg))
31
32 (for-each ly:load '("documentation-lib.scm"
33                     "lily-sort.scm"
34                     "document-functions.scm"
35                     "document-translation.scm"
36                     "document-music.scm"
37                     "document-type-predicates.scm"
38                     "document-identifiers.scm"
39                     "document-context-mods.scm"
40                     "document-backend.scm"
41                     "document-markup.scm"))
42
43 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
44
45 (display
46  (slot-ref (all-scheme-functions-doc) 'text)
47  (open-output-file "scheme-functions.tely"))
48
49 ;;(display
50 ;; (markup-doc-string)
51 ;; (open-output-file "markup-commands.tely"))
52
53 (display
54  ;; ugly hack to remove the @node... @appendixsec... portion
55  (substring
56   (call-with-output-string
57    (lambda (port)
58      (dump-node (markup-doc-node) port 2)))
59   ;; magic number to remove the initial part.  63 comes from:
60   ;; "\nnode Text markup commands\n@appendixsec Text markup commands\n\n\n\n"
61   ;; which is generated by (dump-node...) in documentation-lib.scm
62   63
63   )
64  (open-output-file "markup-commands.tely"))
65
66 (display
67  (markup-list-doc-string)
68  (open-output-file "markup-list-commands.tely"))
69
70 (display
71  type-predicates-doc-string
72  (open-output-file "type-predicates.tely"))
73
74 (display
75  (identifiers-doc-string)
76  (open-output-file "identifiers.tely"))
77
78 (display
79  context-mods-doc-string
80  (open-output-file "context-mod-identifiers.tely"))
81
82 (display
83  (backend-properties-doc-string all-user-grob-properties)
84  (open-output-file "layout-properties.tely"))
85
86 (display
87  (translation-properties-doc-string all-user-translation-properties)
88  (open-output-file "context-properties.tely"))
89
90 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
91
92 (define file-name "internals")
93 (define outname (string-append file-name ".texi"))
94
95 (define out-port (open-output-file outname))
96
97 (writing-wip outname)
98
99 (display
100  (string-append
101   (texi-file-head "LilyPond Internals Reference" file-name
102                   "(lilypond-internals.info)")
103   "
104
105 @include macros.itexi
106
107 @ignore
108 @omftitle LilyPond internals
109 @omfcreator Han-Wen Nienhuys and Jan Nieuwenhuizen
110 @omfdescription Programmer's reference of the LilyPond music engraving system
111 @omftype user's guide
112 @omflanguage English
113 @omfcategory Applications|Publishing
114 @end ignore
115
116 @iftex
117 @afourpaper
118 @end iftex
119
120 @finalout
121
122 @titlepage
123 @title LilyPond
124 @subtitle The music typesetter
125 @titlefont{Internals Reference}
126 @author The LilyPond development team
127
128 @c `Internals Reference' was born 2000-10-21 with this commit:
129 @c patch::: 1.3.96.jcn9
130 @c author: Jan Nieuwenhuizen
131 @c commit: 8ecd09ad7514d57630fb611d38c161f3c3c708db
132 @c   file: scm/generate-documentation.scm
133 Copyright @copyright{} 2000--2015 by the authors
134
135 @vskip 20pt
136
137 For LilyPond version @version{}
138 @end titlepage
139
140 @contents
141
142 @ifnottex")
143  out-port)
144
145 (define top-node
146   (make <texi-node>
147     #:name "GNU LilyPond -- Internals Reference"
148     #:text
149     (string-append  "@end ifnottex
150
151 @ifhtml
152 @ifclear bigpage
153 This document is also available as a
154 @uref{source/Documentation/internals.pdf,PDF} and as
155 @uref{source/Documentation/internals-big-page.html,one big page}.
156 @end ifclear
157 @ifset bigpage
158 This document is also available as a
159 @uref{source/Documentation/internals.pdf,PDF} and as a
160 @uref{source/Documentation/internals/index.html,HTML indexed multiple pages}.
161 @end ifset
162 @end ifhtml
163
164 This is the Internals Reference (IR) for version "
165                     (lilypond-version)
166                     " of LilyPond, the GNU music typesetter.")
167
168     #:children
169     (list
170      (music-doc-node)
171      (translation-doc-node)
172      (backend-doc-node)
173      (all-scheme-functions-doc)
174      (make <texi-node>
175        #:appendix #t
176        #:name "Indices"
177        #:text "
178 @appendixsec Concept index
179
180 @printindex cp
181
182 @appendixsec Function index
183
184 @printindex fn
185
186 \n@bye"))))
187
188 (dump-node top-node out-port 0)
189 (newline (current-error-port))