1 |
<!DOCTYPE style-sheet PUBLIC |
2 |
"-//James Clark//DTD DSSSL Style Sheet//EN" [ |
3 |
<!ENTITY % html "IGNORE"> |
4 |
<![%html;[ |
5 |
<!ENTITY % print "IGNORE"> |
6 |
<!ENTITY docbook.dsl PUBLIC |
7 |
"-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" |
8 |
CDATA dsssl> |
9 |
]]> |
10 |
<!ENTITY % print "INCLUDE"> |
11 |
<![%print;[ |
12 |
<!ENTITY docbook.dsl PUBLIC |
13 |
"-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" |
14 |
CDATA dsssl> |
15 |
]]> |
16 |
]> |
17 |
|
18 |
<style-sheet> |
19 |
|
20 |
<!-- |
21 |
;; ------------------------------------------------------------------------ |
22 |
;; ldp.dsl - LDP Customized DSSSL Stylesheet |
23 |
;; v1.11, 2003-02-03 |
24 |
;; Copyright (C) 2000-2003 |
25 |
;; |
26 |
;; This program is free software; you can redistribute it and/or modify |
27 |
;; it under the terms of the GNU General Public License as published by |
28 |
;; the Free Software Foundation; either version 2 of the License, or |
29 |
;; (at your option) any later version. |
30 |
;; |
31 |
;; This program is distributed in the hope that it will be useful, |
32 |
;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
33 |
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
34 |
;; GNU General Public License for more details. |
35 |
;; |
36 |
;; You should have received a copy of the GNU General Public License |
37 |
;; along with this program; if not, write to the Free Software |
38 |
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
39 |
;; ------------------------------------------------------------------------ |
40 |
--> |
41 |
|
42 |
<style-specification id="print" use="docbook"> |
43 |
<style-specification-body> |
44 |
|
45 |
;; customize the print stylesheet |
46 |
|
47 |
(declare-characteristic preserve-sdata? |
48 |
;; this is necessary because right now jadetex does not understand |
49 |
;; symbolic entities, whereas things work well with numeric entities. |
50 |
"UNREGISTERED::James Clark//Characteristic::preserve-sdata?" |
51 |
#f) |
52 |
|
53 |
(define %generate-article-toc% |
54 |
;; Should a Table of Contents be produced for Articles? |
55 |
#t) |
56 |
|
57 |
(define (toc-depth nd) |
58 |
4) |
59 |
|
60 |
(define %generate-article-titlepage-on-separate-page% |
61 |
;; Should the article title page be on a separate page? |
62 |
#t) |
63 |
|
64 |
(define %section-autolabel% |
65 |
;; Are sections enumerated? |
66 |
#t) |
67 |
|
68 |
(define %footnote-ulinks% |
69 |
;; Generate footnotes for ULinks? |
70 |
#f) |
71 |
|
72 |
(define %bop-footnotes% |
73 |
;; Make "bottom-of-page" footnotes? |
74 |
#f) |
75 |
|
76 |
(define %body-start-indent% |
77 |
;; Default indent of body text |
78 |
0pi) |
79 |
|
80 |
(define %para-indent-firstpara% |
81 |
;; First line start-indent for the first paragraph |
82 |
0pt) |
83 |
|
84 |
(define %para-indent% |
85 |
;; First line start-indent for paragraphs (other than the first) |
86 |
0pt) |
87 |
|
88 |
(define %block-start-indent% |
89 |
;; Extra start-indent for block-elements |
90 |
0pt) |
91 |
|
92 |
(define formal-object-float |
93 |
;; Do formal objects float? |
94 |
#t) |
95 |
|
96 |
(define %hyphenation% |
97 |
;; Allow automatic hyphenation? |
98 |
#t) |
99 |
|
100 |
(define %admon-graphics% |
101 |
;; Use graphics in admonitions? |
102 |
#f) |
103 |
|
104 |
(define %default-quadding% |
105 |
;; Full justification. |
106 |
'justify) |
107 |
|
108 |
(define (book-titlepage-verso-elements) |
109 |
;;added publisher, releaseinfo to the default list |
110 |
(list (normalize "title") |
111 |
(normalize "subtitle") |
112 |
(normalize "corpauthor") |
113 |
(normalize "authorgroup") |
114 |
(normalize "author") |
115 |
(normalize "publisher") |
116 |
(normalize "releaseinfo") |
117 |
(normalize "editor") |
118 |
(normalize "edition") |
119 |
(normalize "pubdate") |
120 |
(normalize "copyright") |
121 |
(normalize "abstract") |
122 |
(normalize "legalnotice") |
123 |
(normalize "revhistory"))) |
124 |
|
125 |
</style-specification-body> |
126 |
</style-specification> |
127 |
|
128 |
|
129 |
<!-- |
130 |
;; customize the html stylesheet; parts borrowed from |
131 |
;; Cygnus at http://sourceware.cygnus.com/ (cygnus-both.dsl) |
132 |
--> |
133 |
|
134 |
<style-specification id="html" use="docbook"> |
135 |
<style-specification-body> |
136 |
|
137 |
(declare-characteristic preserve-sdata? |
138 |
;; this is necessary because right now jadetex does not understand |
139 |
;; symbolic entities, whereas things work well with numeric entities. |
140 |
"UNREGISTERED::James Clark//Characteristic::preserve-sdata?" |
141 |
#f) |
142 |
|
143 |
(declare-flow-object-class element |
144 |
;; for redhat |
145 |
"UNREGISTERED::James Clark//Flow Object Class::element") |
146 |
|
147 |
(define %generate-legalnotice-link% |
148 |
;; put the legal notice in a separate file |
149 |
#t) |
150 |
|
151 |
(define %admon-graphics-path% |
152 |
;; use graphics in admonitions, set their |
153 |
"../images/") |
154 |
|
155 |
(define %admon-graphics% |
156 |
#t) |
157 |
|
158 |
(define %funcsynopsis-decoration% |
159 |
;; make funcsynopsis look pretty |
160 |
#t) |
161 |
|
162 |
(define %html-ext% |
163 |
;; when producing HTML files, use this extension |
164 |
".html") |
165 |
|
166 |
(define %generate-book-toc% |
167 |
;; Should a Table of Contents be produced for books? |
168 |
#t) |
169 |
|
170 |
(define %generate-article-toc% |
171 |
;; Should a Table of Contents be produced for articles? |
172 |
#t) |
173 |
|
174 |
(define %generate-part-toc% |
175 |
;; Should a Table of Contents be produced for parts? |
176 |
#t) |
177 |
|
178 |
(define %generate-book-titlepage% |
179 |
;; produce a title page for books |
180 |
#t) |
181 |
|
182 |
(define %generate-article-titlepage% |
183 |
;; produce a title page for articles |
184 |
#t) |
185 |
|
186 |
(define (chunk-skip-first-element-list) |
187 |
;; forces the Table of Contents on separate page |
188 |
'()) |
189 |
|
190 |
(define (list-element-list) |
191 |
;; fixes bug in Table of Contents generation |
192 |
'()) |
193 |
|
194 |
(define %root-filename% |
195 |
;; The filename of the root HTML document (e.g, "index"). |
196 |
"index") |
197 |
|
198 |
(define %shade-verbatim% |
199 |
;; verbatim sections will be shaded if t(rue) |
200 |
#t) |
201 |
|
202 |
(define %use-id-as-filename% |
203 |
;; Use ID attributes as name for component HTML files? |
204 |
#t) |
205 |
|
206 |
(define %graphic-extensions% |
207 |
;; graphic extensions allowed |
208 |
'("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" )) |
209 |
|
210 |
(define %graphic-default-extension% |
211 |
"gif") |
212 |
|
213 |
(define %section-autolabel% |
214 |
;; For enumerated sections (1.1, 1.1.1, 1.2, etc.) |
215 |
#t) |
216 |
|
217 |
(define (toc-depth nd) |
218 |
;; more depth (2 levels) to toc; instead of flat hierarchy |
219 |
2) |
220 |
|
221 |
(element emphasis |
222 |
;; make role=strong equate to bold for emphasis tag |
223 |
(if (equal? (attribute-string "role") "strong") |
224 |
(make element gi: "STRONG" (process-children)) |
225 |
(make element gi: "EM" (process-children)))) |
226 |
|
227 |
(define (book-titlepage-recto-elements) |
228 |
;; elements on a book's titlepage |
229 |
(list (normalize "title") |
230 |
(normalize "subtitle") |
231 |
(normalize "graphic") |
232 |
(normalize "mediaobject") |
233 |
(normalize "corpauthor") |
234 |
(normalize "authorgroup") |
235 |
(normalize "author") |
236 |
(normalize "othercredit") |
237 |
(normalize "edition") |
238 |
(normalize "releaseinfo") |
239 |
(normalize "publisher") |
240 |
(normalize "editor") |
241 |
(normalize "copyright") |
242 |
(normalize "pubdate") |
243 |
(normalize "revhistory") |
244 |
(normalize "abstract") |
245 |
(normalize "legalnotice"))) |
246 |
|
247 |
(define (article-titlepage-recto-elements) |
248 |
;; elements on an article's titlepage |
249 |
(list (normalize "title") |
250 |
(normalize "subtitle") |
251 |
(normalize "authorgroup") |
252 |
(normalize "author") |
253 |
(normalize "othercredit") |
254 |
(normalize "releaseinfo") |
255 |
(normalize "copyright") |
256 |
(normalize "pubdate") |
257 |
(normalize "revhistory") |
258 |
(normalize "abstract") |
259 |
(normalize "legalnotice"))) |
260 |
|
261 |
(define (process-contrib #!optional (sosofo (process-children))) |
262 |
;; print out with othercredit information; for translators, etc. |
263 |
(make sequence |
264 |
(make element gi: "SPAN" |
265 |
attributes: (list (list "CLASS" (gi))) |
266 |
(process-children)))) |
267 |
|
268 |
(define (process-othercredit #!optional (sosofo (process-children))) |
269 |
;; print out othercredit information; for translators, etc. |
270 |
(let ((author-name (author-string)) |
271 |
(author-contrib (select-elements (children (current-node)) |
272 |
(normalize "contrib")))) |
273 |
(make element gi: "P" |
274 |
attributes: (list (list "CLASS" (gi))) |
275 |
(make element gi: "B" |
276 |
(literal author-name) |
277 |
(literal " - ")) |
278 |
(process-node-list author-contrib)))) |
279 |
|
280 |
(mode article-titlepage-recto-mode |
281 |
(element contrib (process-contrib)) |
282 |
(element othercredit (process-othercredit)) |
283 |
) |
284 |
|
285 |
(mode book-titlepage-recto-mode |
286 |
(element contrib (process-contrib)) |
287 |
(element othercredit (process-othercredit)) |
288 |
) |
289 |
|
290 |
(define (article-title nd) |
291 |
(let* ((artchild (children nd)) |
292 |
(artheader (select-elements artchild (normalize "artheader"))) |
293 |
(artinfo (select-elements artchild (normalize "articleinfo"))) |
294 |
(ahdr (if (node-list-empty? artheader) |
295 |
artinfo |
296 |
artheader)) |
297 |
(ahtitles (select-elements (children ahdr) |
298 |
(normalize "title"))) |
299 |
(artitles (select-elements artchild (normalize "title"))) |
300 |
(titles (if (node-list-empty? artitles) |
301 |
ahtitles |
302 |
artitles))) |
303 |
(if (node-list-empty? titles) |
304 |
"" |
305 |
(node-list-first titles)))) |
306 |
|
307 |
(mode subtitle-mode |
308 |
;; do not print subtitle on subsequent pages |
309 |
(element subtitle (empty-sosofo))) |
310 |
|
311 |
;; Redefinition of $verbatim-display$ |
312 |
;; Origin: dbverb.dsl |
313 |
;; Different foreground and background colors for verbatim elements |
314 |
;; Author: Philippe Martin (feloy@free.fr) 2001-04-07 |
315 |
|
316 |
(define ($verbatim-display$ indent line-numbers?) |
317 |
(let ((verbatim-element (gi)) |
318 |
(content (make element gi: "PRE" |
319 |
attributes: (list |
320 |
(list "CLASS" (gi))) |
321 |
(if (or indent line-numbers?) |
322 |
($verbatim-line-by-line$ indent line-numbers?) |
323 |
(process-children))))) |
324 |
(if %shade-verbatim% |
325 |
(make element gi: "TABLE" |
326 |
attributes: (shade-verbatim-attr-element verbatim-element) |
327 |
(make element gi: "TR" |
328 |
(make element gi: "TD" |
329 |
(make element gi: "FONT" |
330 |
attributes: (list |
331 |
(list "COLOR" (car (shade-verbatim-element-colors |
332 |
verbatim-element)))) |
333 |
content)))) |
334 |
content))) |
335 |
|
336 |
;; |
337 |
;; Customize this function |
338 |
;; to change the foreground and background colors |
339 |
;; of the different verbatim elements |
340 |
;; Return (list "foreground color" "background color") |
341 |
;; |
342 |
(define (shade-verbatim-element-colors element) |
343 |
(case element |
344 |
(("SYNOPSIS") (list "#000000" "#6495ED")) |
345 |
;; ... |
346 |
;; Add your verbatim elements here |
347 |
;; ... |
348 |
(else (list "#000000" "#E0E0E0")))) |
349 |
|
350 |
(define (shade-verbatim-attr-element element) |
351 |
(list |
352 |
(list "BORDER" |
353 |
(cond |
354 |
((equal? element (normalize "SCREEN")) "1") |
355 |
(else "0"))) |
356 |
(list "BGCOLOR" (car (cdr (shade-verbatim-element-colors element)))) |
357 |
(list "WIDTH" ($table-width$)))) |
358 |
|
359 |
;; End of $verbatim-display$ redefinition |
360 |
|
361 |
</style-specification-body> |
362 |
</style-specification> |
363 |
|
364 |
<external-specification id="docbook" document="docbook.dsl"> |
365 |
|
366 |
</style-sheet> |