3 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
4 <!ENTITY % output.html "IGNORE">
5 <!ENTITY % output.print "IGNORE">
6 <!ENTITY % include.historic "IGNORE">
7 <!ENTITY % no.include.historic "IGNORE">
8 <!ENTITY freebsd.dsl PUBLIC "-//FreeBSD//DOCUMENT DocBook Stylesheet//EN" CDATA DSSSL>
9 <!ENTITY % release.ent PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN">
14 <style-specification use="docbook">
15 <style-specification-body>
17 ; Configure behavior of this stylesheet
18 <![ %include.historic; [
19 (define %include-historic% #t)
21 <![ %no.include.historic; [
22 (define %include-historic% #f)
25 ; String manipulation functions
26 (define (split-string-to-list STR)
27 ;; return list of STR separated with char #\ or #\,
29 (let loop ((i (string-delim-index STR)))
30 (cond ((equal? (cdr i) '()) '())
31 (else (cons (substring STR (list-ref i 0) (- (list-ref i 1) 1))
35 (define (string-delim-index STR)
36 ;; return indexes of STR separated with char #\ or #\,
38 (let ((strlen (string-length STR)))
40 (cond ((= i strlen) (cons (+ strlen 1) '()))
41 ((= i 0) (cons i (loop (+ i 1))))
42 ((or (equal? (string-ref STR i) #\ )
43 (equal? (string-ref STR i) #\,)) (cons (+ i 1) (loop (+ i 1))))
44 (else (loop (+ i 1))))))
48 (define (string-list-match? STR STR-LIST)
49 (let loop ((s STR-LIST))
53 ((equal? (car s) #f) #f)
54 ((equal? STR (car s)) #t)
55 (else (loop (cdr s))))))
57 ; Deal with conditional inclusion of text via entities.
59 (let* ((role (attribute-string (normalize "role")))
60 (for-arch (entity-text "arch")))
63 ;; If role=historic, and we're not printing historic things, then
64 ;; don't output this element.
65 ((and (equal? role "historic")
66 (not %include-historic%))
70 (else (next-match)))))
74 (let* ((role (attribute-string (normalize "role")))
75 (for-arch (entity-text "arch")))
78 ;; If role=historic, and we're not printing historic things, then
79 ;; don't output this element.
80 ((and (equal? role "historic")
81 (not %include-historic%))
85 (else (next-match))))))
87 ; We might have some sect1 level elements where the modification times
88 ; are significant. An example of this is the "What's New" section in
89 ; the release notes. We enable the printing of pubdate entry in
90 ; sect1info elements to support this.
91 (element (sect1info pubdate) (process-children))
94 ; Put URLs in footnotes, and put footnotes at the bottom of each page.
95 (define bop-footnotes #t)
96 (define %footnote-ulinks% #t)
99 (let ((arch (attribute-string (normalize "arch")))
100 (role (attribute-string (normalize "role")))
101 (arch-string (entity-text "arch"))
102 (merged-string (entity-text "merged")))
103 (if (or (equal? (print-backend) 'tex)
104 (equal? (print-backend) #f))
105 ;; avoid using country: characteristic because of a JadeTeX bug...
107 first-line-start-indent: (if (is-first-para)
108 %para-indent-firstpara%
110 space-before: %para-sep%
111 space-after: (if (INLIST?)
114 quadding: %default-quadding%
115 hyphenate?: %hyphenation%
116 language: (dsssl-language-code)
119 ;; If arch= not specified, then print unconditionally. This clause
120 ;; handles the majority of cases.
121 ((or (equal? arch #f)
125 (if (and (not (null? role)) (equal? role "7.1"))
128 (if (and (not (null? role)) (equal? role "7.2"))
131 (process-children-trim))
135 (let loop ((prev (car (split-string-to-list arch)))
136 (rest (cdr (split-string-to-list arch))))
139 (if (not (null? rest))
142 (loop (car rest) (cdr rest)))
145 (if (and (not (null? role)) (equal? role "7.1"))
148 (if (and (not (null? role)) (equal? role "7.2"))
151 (process-children-trim))))
152 (if (and (not (null? role)) (equal? role "merged"))
153 (literal " [" merged-string "]")
156 first-line-start-indent: (if (is-first-para)
157 %para-indent-firstpara%
159 space-before: %para-sep%
160 space-after: (if (INLIST?)
163 quadding: %default-quadding%
164 hyphenate?: %hyphenation%
165 language: (dsssl-language-code)
166 country: (dsssl-country-code)
169 ;; If arch= not specified, then print unconditionally. This clause
170 ;; handles the majority of cases.
171 ((or (equal? arch #f)
175 (if (and (not (null? role)) (equal? role "7.1"))
178 (if (and (not (null? role)) (equal? role "7.2"))
181 (process-children-trim)))
185 (let loop ((prev (car (split-string-to-list arch)))
186 (rest (cdr (split-string-to-list arch))))
189 (if (not (null? rest))
192 (loop (car rest) (cdr rest)))
195 (if (and (not (null? role)) (equal? role "7.1"))
198 (if (and (not (null? role)) (equal? role "7.2"))
201 (process-children-trim))))
202 (if (and (not (null? role)) (equal? role "merged"))
203 (literal " [" merged-string "]")
204 (empty-sosofo))))))))
208 (define %callout-graphics%
209 ;; Use graphics in callouts?
212 <!-- Convert " ... " to `` ... '' in the HTML output. -->
217 (literal "”")))
219 <!-- Specify how to generate the man page link HREF -->
220 (define ($create-refentry-xref-link$ #!optional (n (current-node)))
221 (let* ((r (select-elements (children n) (normalize "refentrytitle")))
222 (m (select-elements (children n) (normalize "manvolnum")))
223 (v (attribute-string (normalize "vendor") n))
224 (u (string-append "&release.man.url;?query="
225 (data r) "&" "sektion=" (data m))))
227 (("xorg") (string-append u "&" "manpath=Xorg+&release.manpath.xorg;" ))
228 (("netbsd") (string-append u "&" "manpath=NetBSD+&release.manpath.netbsd;"))
229 (("ports") (string-append u "&" "manpath=FreeBSD+&release.manpath.freebsd-ports;"))
230 (else (string-append u "&" "manpath=FreeBSD+&release.manpath.freebsd;")))))
232 ;; $paragraph$ function with arch attribute support.
233 (define ($paragraph$ #!optional (para-wrapper "P"))
234 (let ((footnotes (select-elements (descendants (current-node))
235 (normalize "footnote")))
236 (tgroup (have-ancestor? (normalize "tgroup")))
237 (arch (attribute-string (normalize "arch")))
238 (role (attribute-string (normalize "role")))
239 (arch-string (entity-text "arch"))
240 (merged-string (entity-text "merged")))
242 (make element gi: para-wrapper
244 (if %default-quadding%
245 (list (list "ALIGN" %default-quadding%))
249 ;; If arch= not specified, then print unconditionally. This clause
250 ;; handles the majority of cases.
251 ((or (equal? arch #f)
255 (if (and (not (null? role)) (equal? role "7.1"))
258 (if (and (not (null? role)) (equal? role "7.2"))
266 (if (and (not (null? role)) (equal? role "7.1"))
269 (if (and (not (null? role)) (equal? role "7.2"))
273 (let loop ((prev (car (split-string-to-list arch)))
274 (rest (cdr (split-string-to-list arch))))
277 (if (not (null? rest))
280 (loop (car rest) (cdr rest)))
283 (process-children)))))
284 (if (and (not (null? role)) (equal? role "merged"))
285 (literal " [" merged-string "]")
287 (if (or %footnotes-at-end% tgroup (node-list-empty? footnotes))
289 (make element gi: "BLOCKQUOTE"
291 (list "CLASS" "FOOTNOTES"))
292 (with-mode footnote-mode
293 (process-node-list footnotes)))))))))
296 (define (toc-depth nd)
297 (if (string=? (gi nd) (normalize "book"))
301 </style-specification-body>
302 </style-specification>
304 <external-specification id="docbook" document="freebsd.dsl">