1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
2 <!ENTITY % html "IGNORE">
4 <!ENTITY % print "IGNORE">
5 <!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA dsssl>
7 <!ENTITY % print "INCLUDE">
9 <!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA dsssl>
15 <style-specification id="print" use="docbook">
16 <style-specification-body>
20 (define %body-font-family% "Palatino")
21 (define %mono-font-family% "Courier")
22 (define %admon-font-family% "Helvetica")
23 (define %title-font-family% "Helvetica")
25 ; fix pdf rendering problem with glossdiv
26 (element glossdiv (process-children))
27 (element (glossdiv title) ($lowtitle$ 2 2))
29 (define %division-title-quadding% 'start)
30 (define %division-subtitle-quadding% 'start)
32 (define %refentry-new-page%
33 ;; REFENTRY refentry-new-page
34 ;; PURP 'RefEntry' starts on new page?
36 ;; If true, each 'RefEntry' begins on a new page.
42 (element (formalpara title)
43 ;; Change the way Formal Paragraph titles are displayed.
46 ;; The GNOME Documentation Project's
47 ;; Custom DocBook Stylesheet Layer
48 ;; by Dave Mason dcm@redhat.com
51 (define %default-title-end-punct%
52 ;; REFENTRY default-title-end-punct
53 ;; PURP Default punctuation at the end of a run-in head.
55 ;; The punctuation used at the end of a run-in head (e.g. on FORMALPARA).
62 ;; Wrap link text with " " on page #"
64 ;; No warnings about missing targets. Jade will do that for us, and
65 ;; this way we can use -wno-idref if we really don't care.
66 (let* ((endterm (attribute-string (normalize "endterm")))
67 (linkend (attribute-string (normalize "linkend")))
68 (target (element-with-id linkend))
69 (link-cont (make sequence (literal "\"") (process-children) (literal "\" on page ") (element-page-number-sosofo target))))
70 (if (node-list-empty? target)
73 destination: (node-list-address target)
78 ;; PURP Is two-sided output being produced?
80 ;; If '%two-side%' is true, headers and footers are alternated
81 ;; so that the "outer" and "inner" headers will be correctly
82 ;; placed in the bound document.
88 (define %footnote-ulinks%
89 ;; REFENTRY footnote-ulinks
90 ;; PURP Generate footnotes for ULinks?
92 ;; If true, the URL of each ULink will appear as a footnote.
93 ;; Processing ULinks this way may be very, very slow. It requires
94 ;; walking over every descendant of every component in order to count
95 ;; both ulinks and footnotes.
101 (define %show-comments%
102 ;; REFENTRY show-comments
103 ;; PURP Display Comment elements?
105 ;; If true, comments will be displayed, otherwise they are suppressed.
106 ;; Comments here refers to the 'Comment' element, which will be renamed
107 ;; 'Remark' in DocBook V4.0, not SGML/XML comments which are unavailable.
113 (define ($object-titles-after$)
114 ;; REFENTRY object-titles-after
115 ;; PURP List of objects who's titles go after the object
117 ;; Titles of formal objects (Figures, Equations, Tables, etc.)
118 ;; in this list will be placed below the object instead of above it.
120 ;; This is a list of element names, for example:
121 ;; '(list (normalize "figure") (normalize "table"))'.
125 (list (normalize "figure") (normalize "table")))
127 (define %hsize-bump-factor%
128 ;; REFENTRY hsize-bump-factor
129 ;; PURP Font scaling factor
131 ;; Internally, the stylesheet refers to font sizes in purely relative
132 ;; terms. This is done by defining a scaled set of fonts
133 ;; (sizes 1, 2, 3, etc.)
134 ;; based at the default text font size (e.g. 10pt). The '%hsize-bump-factor%'
135 ;; describes the ratio between scaled sizes. The default is 1.2.
137 ;; Each hsize is '%hsize-bump-factor%' times larger than
138 ;; the previous hsize. For example, if the base size is 10pt, and
139 ;; '%hsize-bump-factor%'
140 ;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc.
147 ;; REFENTRY paper-type
148 ;; PURP Name of paper type
150 ;; The paper type value identifies the sort of paper in use, for example,
151 ;; 'A4' or 'USletter'. Setting the paper type is an
152 ;; easy shortcut for setting the correct paper height and width.
154 ;; See %page-width% and %page-height concerning what other page size
155 ;; are available. Some common examples are 'A4', 'USletter',
156 ;; 'A4landscape', 'USlandscape'.
163 </style-specification-body>
164 </style-specification>
166 <style-specification id="html" use="docbook">
167 <style-specification-body>
173 ;; PURP Default extension for HTML output files
175 ;; The default extension for HTML output files.
181 (define %show-comments%
182 ;; REFENTRY show-comments
183 ;; PURP Display Comment elements?
185 ;; If true, comments will be displayed, otherwise they are suppressed.
186 ;; Comments here refers to the 'Comment' element, which will be renamed
187 ;; 'Remark' in DocBook V4.0, not SGML/XML comments which are unavailable.
193 (define (chunk-element-list)
194 (list (normalize "preface")
195 (normalize "chapter")
196 (normalize "appendix")
197 (normalize "article")
198 (normalize "glossary")
199 (normalize "bibliography")
201 (normalize "colophon")
202 (normalize "setindex")
203 (normalize "reference")
204 (normalize "refentry")
206 (normalize "book") ;; just in case nothing else matches...
207 (normalize "set") ;; sets are definitely chunks...
210 (define (chunk? #!optional (nd (current-node)))
211 ;; 1. The (sgml-root-element) is always a chunk.
212 ;; 2. If nochunks is #t or the dbhtml PI on the root element
213 ;; specifies chunk='no', then the root element is the only
215 ;; 3. Otherwise, elements in the chunk-element-list are chunks
216 ;; unless they're combined with their parent.
217 ;; 4. Except for bibliographys, which are only chunks if they
218 ;; occur in book or article.
220 (let* ((notchunk (or (and (equal? (gi nd) (normalize "bibliography"))
221 (not (or (equal? (gi (parent nd)) (normalize "book"))
222 (equal? (gi (parent nd)) (normalize "article")))))))
223 (maybechunk (not notchunk)))
224 (if (node-list=? nd (sgml-root-element))
227 (equal? (dbhtml-value (sgml-root-element) "chunk") "no"))
229 (if (member (gi nd) (chunk-element-list))
230 (if (combined-chunk? nd)
235 (define $generate-chapter-toc$
236 ;; REFENTRY generate-chapter-toc
237 ;; PURP Should a Chapter Table of Contents be produced?
239 ;; If true, an automatically generated
240 ;; chapter TOC should be included. By default, it's true. It's false if
241 ;; the output is going to a single file and the current node isn't the
249 (define ($object-titles-after$)
250 ;; REFENTRY object-titles-after
251 ;; PURP List of objects who's titles go after the object
253 ;; Titles of formal objects (Figures, Equations, Tables, etc.)
254 ;; in this list will be placed below the object instead of above it.
256 ;; This is a list of element names, for example:
257 ;; '(list (normalize "figure") (normalize "table"))'.
261 (list (normalize "figure") (normalize "table")))
263 (define %spacing-paras%
264 ;; REFENTRY spacing-paras
265 ;; PURP Block-element spacing hack
267 ;; Should extraneous "P" tags be output to force the correct vertical
268 ;; spacing around things like tables. This is ugly because different
269 ;; browsers do different things. Turning this one can also create
276 (define %default-title-end-punct%
277 ;; REFENTRY default-title-end-punct
278 ;; PURP Default punctuation at the end of a run-in head.
280 ;; The punctuation used at the end of a run-in head (e.g. on FORMALPARA).
286 (define (build-toc nd depth #!optional (chapter-toc? #f) (first? #t))
287 (let ((toclist (toc-list-filter
288 (node-list-filter-by-gi (children nd)
289 (append (division-element-list)
290 (component-element-list)
291 (section-element-list)))))
292 (wrappergi (if first? "DIV" "DD"))
293 (wrapperattr (if first? '(("CLASS" "TOC")) '())))
295 (node-list-empty? toclist)
297 (not %force-chapter-toc%)
298 (<= (node-list-length toclist) 1)))
300 (make element gi: wrappergi
301 attributes: wrapperattr
302 (make element gi: "DL"
304 (make element gi: "DT"
305 (make element gi: "B"
306 (literal (gentext-element-name (normalize "toc")))))
308 (let loop ((nl toclist))
309 (if (node-list-empty? nl)
312 (toc-entry (node-list-first nl))
313 (build-toc (node-list-first nl)
314 (- depth 1) chapter-toc? #f)
315 (loop (node-list-rest nl))))))(make empty-element gi: "BR")))))
317 </style-specification-body>
318 </style-specification>
320 <external-specification id="docbook" document="docbook.dsl">