man-page-fileserver-update-20080311
[openafs.git] / doc / xml / AdminReference / mystyle.dsl
1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
2 <!ENTITY % html "IGNORE">
3 <![%html;[
4 <!ENTITY % print "IGNORE">
5 <!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA dsssl>
6 ]]>
7 <!ENTITY % print "INCLUDE">
8 <![%print;[
9 <!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA dsssl>
10 ]]>
11 ]>
12
13 <style-sheet>
14
15 <style-specification id="print" use="docbook">
16 <style-specification-body> 
17
18 ;; PRINT
19
20 (define %body-font-family% "Palatino")
21 (define %mono-font-family% "Courier")
22 (define %admon-font-family% "Helvetica")
23 (define %title-font-family% "Helvetica")
24
25 ; fix pdf rendering problem with glossdiv
26 (element glossdiv (process-children))
27 (element (glossdiv title) ($lowtitle$ 2 2))
28
29 (define %division-title-quadding% 'start)
30 (define %division-subtitle-quadding% 'start)
31
32 (define %refentry-new-page%
33   ;; REFENTRY refentry-new-page
34   ;; PURP 'RefEntry' starts on new page?
35   ;; DESC
36   ;; If true, each 'RefEntry' begins on a new page.
37   ;; /DESC
38   ;; AUTHOR N/A
39   ;; /REFENTRY
40   #t)
41
42 (element (formalpara title)
43   ;; Change the way Formal Paragraph titles are displayed.
44   ;;
45   ;; borrowed from:
46   ;;   The GNOME Documentation Project's
47   ;;   Custom DocBook Stylesheet Layer
48   ;;   by Dave Mason dcm@redhat.com
49   ($lowtitle$ 5 7))
50
51 (define %default-title-end-punct%
52   ;; REFENTRY default-title-end-punct
53   ;; PURP Default punctuation at the end of a run-in head.
54   ;; DESC
55   ;; The punctuation used at the end of a run-in head (e.g. on FORMALPARA).
56   ;; /DESC
57   ;; AUTHOR N/A
58   ;; /REFENTRY
59   ":")
60
61 (element link
62   ;; Wrap link text with " " on page #"
63   ;; 
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)
71         link-cont
72         (make link
73           destination: (node-list-address target)
74           link-cont))))
75
76 (define %two-side%
77   ;; REFENTRY two-side
78   ;; PURP Is two-sided output being produced?
79   ;; DESC
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.
83   ;; /DESC
84   ;; AUTHOR N/A
85   ;; /REFENTRY
86   #t)
87
88 (define %footnote-ulinks%
89   ;; REFENTRY footnote-ulinks
90   ;; PURP Generate footnotes for ULinks?
91   ;; DESC
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.
96   ;; /DESC
97   ;; AUTHOR N/A
98   ;; /REFENTRY
99   #f)
100
101 (define %show-comments%
102   ;; REFENTRY show-comments
103   ;; PURP Display Comment elements?
104   ;; DESC
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.
108   ;; /DESC
109   ;; AUTHOR N/A
110   ;; /REFENTRY
111   #t)
112
113 (define ($object-titles-after$)
114   ;; REFENTRY object-titles-after
115   ;; PURP List of objects who's titles go after the object
116   ;; DESC
117   ;; Titles of formal objects (Figures, Equations, Tables, etc.)
118   ;; in this list will be placed below the object instead of above it.
119   ;;
120   ;; This is a list of element names, for example:
121   ;; '(list (normalize "figure") (normalize "table"))'.
122   ;; /DESC
123   ;; AUTHOR N/A
124   ;; /REFENTRY
125   (list (normalize "figure") (normalize "table")))
126
127 (define %hsize-bump-factor%
128   ;; REFENTRY hsize-bump-factor
129   ;; PURP Font scaling factor
130   ;; DESC
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.
136   ;;
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.
141   ;; /DESC
142   ;; AUTHOR N/A
143   ;; /REFENTRY
144   1.1)
145
146 (define %paper-type%
147   ;; REFENTRY paper-type
148   ;; PURP Name of paper type
149   ;; DESC
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.
153   ;; 
154   ;; See %page-width% and %page-height concerning what other page size
155   ;; are available.  Some common examples are 'A4', 'USletter',
156   ;; 'A4landscape', 'USlandscape'.
157   ;; /DESC
158   ;; AUTHOR N/A
159   ;; /REFENTRY
160   ;; "A4"
161   "USletter")
162
163 </style-specification-body>
164 </style-specification>
165
166 <style-specification id="html" use="docbook">
167 <style-specification-body> 
168
169 ;; HTML
170
171 (define %html-ext% 
172   ;; REFENTRY html-ext
173   ;; PURP Default extension for HTML output files
174   ;; DESC
175   ;; The default extension for HTML output files.
176   ;; /DESC
177   ;; AUTHOR N/A
178   ;; /REFENTRY
179   ".html")
180
181 (define %show-comments%
182   ;; REFENTRY show-comments
183   ;; PURP Display Comment elements?
184   ;; DESC
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.
188   ;; /DESC
189   ;; AUTHOR N/A
190   ;; /REFENTRY
191   #t)
192
193 (define (chunk-element-list)
194   (list (normalize "preface")
195         (normalize "chapter")
196         (normalize "appendix")
197         (normalize "article")
198         (normalize "glossary")
199         (normalize "bibliography")
200         (normalize "index")
201         (normalize "colophon")
202         (normalize "setindex")
203         (normalize "reference")
204         (normalize "refentry")
205         (normalize "part")
206         (normalize "book") ;; just in case nothing else matches...
207         (normalize "set")  ;; sets are definitely chunks...
208         ))
209
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
214   ;;    chunk.
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.
219   ;;
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))
225         #t
226         (if (or nochunks
227                 (equal? (dbhtml-value (sgml-root-element) "chunk") "no"))
228             #f
229             (if (member (gi nd) (chunk-element-list))
230                 (if (combined-chunk? nd)
231                     #f
232                     maybechunk)
233                 #f)))))
234
235 (define $generate-chapter-toc$
236   ;; REFENTRY generate-chapter-toc
237   ;; PURP Should a Chapter Table of Contents be produced?
238   ;; DESC
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
242   ;; root element.
243   ;; /DESC
244   ;; AUTHOR N/A
245   ;; /REFENTRY
246   (lambda ()
247     #f))
248
249 (define ($object-titles-after$)
250   ;; REFENTRY object-titles-after
251   ;; PURP List of objects who's titles go after the object
252   ;; DESC
253   ;; Titles of formal objects (Figures, Equations, Tables, etc.)
254   ;; in this list will be placed below the object instead of above it.
255   ;;
256   ;; This is a list of element names, for example:
257   ;; '(list (normalize "figure") (normalize "table"))'.
258   ;; /DESC
259   ;; AUTHOR N/A
260   ;; /REFENTRY
261   (list (normalize "figure") (normalize "table")))
262
263 (define %spacing-paras%
264   ;; REFENTRY spacing-paras
265   ;; PURP Block-element spacing hack
266   ;; DESC
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
270   ;; illegal HTML.
271   ;; /DESC
272   ;; AUTHOR N/A
273   ;; /REFENTRY
274   #f)
275
276 (define %default-title-end-punct%
277   ;; REFENTRY default-title-end-punct
278   ;; PURP Default punctuation at the end of a run-in head.
279   ;; DESC 
280   ;; The punctuation used at the end of a run-in head (e.g. on FORMALPARA).
281   ;; /DESC
282   ;; AUTHOR N/A
283   ;; /REFENTRY
284   ":")
285
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")) '())))
294     (if (or (<= depth 0)
295             (node-list-empty? toclist)
296             (and chapter-toc?
297                  (not %force-chapter-toc%)
298                  (<= (node-list-length toclist) 1)))
299         (empty-sosofo)
300         (make element gi: wrappergi
301               attributes: wrapperattr
302               (make element gi: "DL"
303                     (if first?
304                         (make element gi: "DT"
305                               (make element gi: "B"
306                                     (literal (gentext-element-name (normalize "toc")))))
307                         (empty-sosofo))
308                     (let loop ((nl toclist))
309                       (if (node-list-empty? nl)
310                           (empty-sosofo)
311                           (sosofo-append
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")))))
316
317 </style-specification-body>
318 </style-specification>
319
320 <external-specification id="docbook" document="docbook.dsl">
321
322 </style-sheet>