]> git.donarmstrong.com Git - lilypond.git/blob - scm/documentation-generate.scm
Run grand-replace (issue 3765)
[lilypond.git] / scm / documentation-generate.scm
1 ;;;; This file is part of LilyPond, the GNU music typesetter.
2 ;;;;
3 ;;;; Copyright (C) 2000--2014 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 git commit 01e371f...
129 Copyright @copyright{} 2000--2014 by the authors
130
131 @vskip 20pt
132
133 For LilyPond version @version{}
134 @end titlepage
135
136 @contents
137
138 @ifnottex")
139  out-port)
140
141 (define top-node
142   (make <texi-node>
143     #:name "GNU LilyPond -- Internals Reference"
144     #:text
145     (string-append  "@end ifnottex
146
147 @ifhtml
148 @ifclear bigpage
149 This document is also available as a
150 @uref{source/Documentation/internals.pdf,PDF} and as
151 @uref{source/Documentation/internals-big-page.html,one big page}.
152 @end ifclear
153 @ifset bigpage
154 This document is also available as a
155 @uref{source/Documentation/internals.pdf,PDF} and as a
156 @uref{source/Documentation/internals/index.html,HTML indexed multiple pages}.
157 @end ifset
158 @end ifhtml
159
160 This is the Internals Reference (IR) for version "
161                     (lilypond-version)
162                     " of LilyPond, the GNU music typesetter.")
163
164     #:children
165     (list
166      (music-doc-node)
167      (translation-doc-node)
168      (backend-doc-node)
169      (all-scheme-functions-doc)
170      (make <texi-node>
171        #:appendix #t
172        #:name "Indices"
173        #:text "
174 @appendixsec Concept index
175
176 @printindex cp
177
178 @appendixsec Function index
179
180 @printindex fn
181
182 \n@bye"))))
183
184 (dump-node top-node out-port 0)
185 (newline (current-error-port))