1 <!DOCTYPE style-sheet PUBLIC
2 "-//James Clark//DTD DSSSL Style Sheet//EN" [
3 <!ENTITY % html "IGNORE">
5 <!ENTITY % print "IGNORE">
6 <!ENTITY docbook.dsl PUBLIC
7 "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN"
10 <!ENTITY % print "INCLUDE">
12 <!ENTITY docbook.dsl PUBLIC
13 "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN"
20 ;; ------------------------------------------------------------------------
21 ;; ldp.dsl - LDP Customized DSSSL Stylesheet
23 ;; Copyright (C) 2000-2003
25 ;; This program is free software; you can redistribute it and/or modify
26 ;; it under the terms of the GNU General Public License as published by
27 ;; the Free Software Foundation; either version 2 of the License, or
28 ;; (at your option) any later version.
30 ;; This program is distributed in the hope that it will be useful,
31 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;; GNU General Public License for more details.
35 ;; You should have received a copy of the GNU General Public License
36 ;; along with this program; if not, write to the Free Software
37 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38 ;; ------------------------------------------------------------------------
40 <style-specification id="print" use="docbook">
41 <style-specification-body>
43 ;; customize the print stylesheet
45 (declare-characteristic preserve-sdata?
46 ;; this is necessary because right now jadetex does not understand
47 ;; symbolic entities, whereas things work well with numeric entities.
48 "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
51 (define %generate-article-toc%
52 ;; Should a Table of Contents be produced for Articles?
55 (define (toc-depth nd)
58 (define %generate-article-titlepage-on-separate-page%
59 ;; Should the article title page be on a separate page?
62 (define %section-autolabel%
63 ;; Are sections enumerated?
66 (define %footnote-ulinks%
67 ;; Generate footnotes for ULinks?
70 (define %bop-footnotes%
71 ;; Make "bottom-of-page" footnotes?
74 (define %body-start-indent%
75 ;; Default indent of body text
78 (define %para-indent-firstpara%
79 ;; First line start-indent for the first paragraph
83 ;; First line start-indent for paragraphs (other than the first)
86 (define %block-start-indent%
87 ;; Extra start-indent for block-elements
90 (define formal-object-float
91 ;; Do formal objects float?
95 ;; Allow automatic hyphenation?
98 (define %admon-graphics%
99 ;; Use graphics in admonitions?
102 (define %default-quadding%
103 ;; Full justification.
106 (define (book-titlepage-verso-elements)
107 ;;added publisher, releaseinfo to the default list
108 (list (normalize "title")
109 (normalize "subtitle")
110 (normalize "corpauthor")
111 (normalize "authorgroup")
113 (normalize "publisher")
114 (normalize "releaseinfo")
116 (normalize "edition")
117 (normalize "pubdate")
118 (normalize "copyright")
119 (normalize "abstract")
120 (normalize "legalnotice")
121 (normalize "revhistory")))
123 </style-specification-body>
124 </style-specification>
128 ;; customize the html stylesheet; parts borrowed from
129 ;; Cygnus at http://sourceware.cygnus.com/ (cygnus-both.dsl)
132 <style-specification id="html" use="docbook">
133 <style-specification-body>
135 (declare-characteristic preserve-sdata?
136 ;; this is necessary because right now jadetex does not understand
137 ;; symbolic entities, whereas things work well with numeric entities.
138 "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
141 (declare-flow-object-class element
143 "UNREGISTERED::James Clark//Flow Object Class::element")
145 (define %generate-legalnotice-link%
146 ;; put the legal notice in a separate file
149 (define %admon-graphics-path%
150 ;; use graphics in admonitions, set their
153 (define %admon-graphics%
156 (define %funcsynopsis-decoration%
157 ;; make funcsynopsis look pretty
161 ;; when producing HTML files, use this extension
164 (define %generate-book-toc%
165 ;; Should a Table of Contents be produced for books?
168 (define %generate-article-toc%
169 ;; Should a Table of Contents be produced for articles?
172 (define %generate-part-toc%
173 ;; Should a Table of Contents be produced for parts?
176 (define %generate-book-titlepage%
177 ;; produce a title page for books
180 (define %generate-article-titlepage%
181 ;; produce a title page for articles
184 (define (chunk-skip-first-element-list)
185 ;; forces the Table of Contents on separate page
188 (define (list-element-list)
189 ;; fixes bug in Table of Contents generation
192 (define %root-filename%
193 ;; The filename of the root HTML document (e.g, "index").
196 (define %shade-verbatim%
197 ;; verbatim sections will be shaded if t(rue)
200 (define %use-id-as-filename%
201 ;; Use ID attributes as name for component HTML files?
204 (define %graphic-extensions%
205 ;; graphic extensions allowed
206 '("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" ))
208 (define %graphic-default-extension%
211 (define %section-autolabel%
212 ;; For enumerated sections (1.1, 1.1.1, 1.2, etc.)
215 (define (toc-depth nd)
216 ;; more depth (2 levels) to toc; instead of flat hierarchy
220 ;; make role=strong equate to bold for emphasis tag
221 (if (equal? (attribute-string "role") "strong")
222 (make element gi: "STRONG" (process-children))
223 (make element gi: "EM" (process-children))))
225 (define (book-titlepage-recto-elements)
226 ;; elements on a book's titlepage
227 (list (normalize "title")
228 (normalize "subtitle")
229 (normalize "graphic")
230 (normalize "mediaobject")
231 (normalize "corpauthor")
232 (normalize "authorgroup")
234 (normalize "othercredit")
235 (normalize "edition")
236 (normalize "releaseinfo")
237 (normalize "publisher")
239 (normalize "copyright")
240 (normalize "pubdate")
241 (normalize "revhistory")
242 (normalize "abstract")
243 (normalize "legalnotice")))
245 (define (article-titlepage-recto-elements)
246 ;; elements on an article's titlepage
247 (list (normalize "title")
248 (normalize "subtitle")
249 (normalize "authorgroup")
251 (normalize "othercredit")
252 (normalize "releaseinfo")
253 (normalize "copyright")
254 (normalize "pubdate")
255 (normalize "revhistory")
256 (normalize "abstract")
257 (normalize "legalnotice")))
259 (define (process-contrib #!optional (sosofo (process-children)))
260 ;; print out with othercredit information; for translators, etc.
262 (make element gi: "SPAN"
263 attributes: (list (list "CLASS" (gi)))
264 (process-children))))
266 (define (process-othercredit #!optional (sosofo (process-children)))
267 ;; print out othercredit information; for translators, etc.
268 (let ((author-name (author-string))
269 (author-contrib (select-elements (children (current-node))
270 (normalize "contrib"))))
271 (make element gi: "P"
272 attributes: (list (list "CLASS" (gi)))
273 (make element gi: "B"
274 (literal author-name)
276 (process-node-list author-contrib))))
278 (mode article-titlepage-recto-mode
279 (element contrib (process-contrib))
280 (element othercredit (process-othercredit))
283 (mode book-titlepage-recto-mode
284 (element contrib (process-contrib))
285 (element othercredit (process-othercredit))
288 (define (article-title nd)
289 (let* ((artchild (children nd))
290 (artheader (select-elements artchild (normalize "artheader")))
291 (artinfo (select-elements artchild (normalize "articleinfo")))
292 (ahdr (if (node-list-empty? artheader)
295 (ahtitles (select-elements (children ahdr)
296 (normalize "title")))
297 (artitles (select-elements artchild (normalize "title")))
298 (titles (if (node-list-empty? artitles)
301 (if (node-list-empty? titles)
303 (node-list-first titles))))
306 ;; do not print subtitle on subsequent pages
307 (element subtitle (empty-sosofo)))
309 ;; Redefinition of $verbatim-display$
310 ;; Origin: dbverb.dsl
311 ;; Different foreground and background colors for verbatim elements
312 ;; Author: Philippe Martin (feloy@free.fr) 2001-04-07
314 (define ($verbatim-display$ indent line-numbers?)
315 (let ((verbatim-element (gi))
316 (content (make element gi: "PRE"
319 (if (or indent line-numbers?)
320 ($verbatim-line-by-line$ indent line-numbers?)
321 (process-children)))))
323 (make element gi: "TABLE"
324 attributes: (shade-verbatim-attr-element verbatim-element)
325 (make element gi: "TR"
326 (make element gi: "TD"
327 (make element gi: "FONT"
329 (list "COLOR" (car (shade-verbatim-element-colors
335 ;; Customize this function
336 ;; to change the foreground and background colors
337 ;; of the different verbatim elements
338 ;; Return (list "foreground color" "background color")
340 (define (shade-verbatim-element-colors element)
342 (("SYNOPSIS") (list "#000000" "#6495ED"))
344 ;; Add your verbatim elements here
346 (else (list "#000000" "#E0E0E0"))))
348 (define (shade-verbatim-attr-element element)
352 ((equal? element (normalize "SCREEN")) "1")
354 (list "BGCOLOR" (car (cdr (shade-verbatim-element-colors element))))
355 (list "WIDTH" ($table-width$))))
357 ;; End of $verbatim-display$ redefinition
359 </style-specification-body>
360 </style-specification>
362 <external-specification id="docbook" document="docbook.dsl">