3 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
4 <!ENTITY % output.html "IGNORE">
5 <!ENTITY % output.print "IGNORE">
6 <!ENTITY freebsd.dsl PUBLIC "-//FreeBSD//DOCUMENT DocBook Stylesheet//EN" CDATA DSSSL>
7 <!ENTITY % release.ent PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN">
12 <style-specification use="docbook">
13 <style-specification-body>
15 ; String manipulation functions
16 (define (split-string-to-list STR)
17 ;; return list of STR separated with char #\ or #\,
19 (let loop ((i (string-delim-index STR)))
20 (cond ((equal? (cdr i) '()) '())
21 (else (cons (substring STR (list-ref i 0) (- (list-ref i 1) 1))
25 (define (string-delim-index STR)
26 ;; return indexes of STR separated with char #\ or #\,
28 (let ((strlen (string-length STR)))
30 (cond ((= i strlen) (cons (+ strlen 1) '()))
31 ((= i 0) (cons i (loop (+ i 1))))
32 ((or (equal? (string-ref STR i) #\ )
33 (equal? (string-ref STR i) #\,)) (cons (+ i 1) (loop (+ i 1))))
34 (else (loop (+ i 1))))))
38 (define (string-list-match? STR STR-LIST)
39 (let loop ((s STR-LIST))
43 ((equal? (car s) #f) #f)
44 ((equal? STR (car s)) #t)
45 (else (loop (cdr s))))))
47 ; We might have some sect1 level elements where the modification times
48 ; are significant. An example of this is the "What's New" section in
49 ; the release notes. We enable the printing of pubdate entry in
50 ; sect1info elements to support this.
51 (element (sect1info pubdate) (process-children))
54 ; Put URLs in footnotes, and put footnotes at the bottom of each page.
55 (define bop-footnotes #t)
56 (define %footnote-ulinks% #t)
59 (let ((arch (attribute-string (normalize "arch")))
60 (role (attribute-string (normalize "role")))
61 (arch-string (entity-text "arch"))
62 (merged-string (entity-text "merged")))
63 (if (or (equal? (print-backend) 'tex)
64 (equal? (print-backend) #f))
65 ;; avoid using country: characteristic because of a JadeTeX bug...
67 first-line-start-indent: (if (is-first-para)
68 %para-indent-firstpara%
70 space-before: %para-sep%
71 space-after: (if (INLIST?)
74 quadding: %default-quadding%
75 hyphenate?: %hyphenation%
76 language: (dsssl-language-code)
79 ;; If arch= not specified, then print unconditionally. This clause
80 ;; handles the majority of cases.
84 (process-children-trim))
88 (let loop ((prev (car (split-string-to-list arch)))
89 (rest (cdr (split-string-to-list arch))))
92 (if (not (null? rest))
95 (loop (car rest) (cdr rest)))
98 (process-children-trim))))
99 (if (and (not (null? role)) (equal? role "merged"))
100 (literal " [" merged-string "]")
103 first-line-start-indent: (if (is-first-para)
104 %para-indent-firstpara%
106 space-before: %para-sep%
107 space-after: (if (INLIST?)
110 quadding: %default-quadding%
111 hyphenate?: %hyphenation%
112 language: (dsssl-language-code)
113 country: (dsssl-country-code)
116 ;; If arch= not specified, then print unconditionally. This clause
117 ;; handles the majority of cases.
118 ((or (equal? arch #f)
121 (process-children-trim))
125 (let loop ((prev (car (split-string-to-list arch)))
126 (rest (cdr (split-string-to-list arch))))
129 (if (not (null? rest))
132 (loop (car rest) (cdr rest)))
135 (process-children-trim))))
136 (if (and (not (null? role)) (equal? role "merged"))
137 (literal " [" merged-string "]")
142 (define %callout-graphics%
143 ;; Use graphics in callouts?
146 <!-- Convert " ... " to `` ... '' in the HTML output. -->
151 (literal "”")))
153 <!-- Specify how to generate the man page link HREF -->
154 (define ($create-refentry-xref-link$ #!optional (n (current-node)))
155 (let* ((r (select-elements (children n) (normalize "refentrytitle")))
156 (m (select-elements (children n) (normalize "manvolnum")))
157 (v (attribute-string (normalize "vendor") n))
158 (u (string-append "&release.man.url;?query="
159 (data r) "&" "sektion=" (data m))))
161 (("xorg") (string-append u "&" "manpath=Xorg+&release.manpath.xorg;" ))
162 (("netbsd") (string-append u "&" "manpath=NetBSD+&release.manpath.netbsd;"))
163 (("ports") (string-append u "&" "manpath=FreeBSD+&release.manpath.freebsd-ports;"))
164 (else (string-append u "&" "manpath=FreeBSD+&release.manpath.freebsd;")))))
166 ;; $paragraph$ function with arch attribute support.
167 (define ($paragraph$ #!optional (para-wrapper "P"))
168 (let ((footnotes (select-elements (descendants (current-node))
169 (normalize "footnote")))
170 (tgroup (have-ancestor? (normalize "tgroup")))
171 (arch (attribute-string (normalize "arch")))
172 (role (attribute-string (normalize "role")))
173 (arch-string (entity-text "arch"))
174 (merged-string (entity-text "merged")))
176 (make element gi: para-wrapper
178 (if %default-quadding%
179 (list (list "ALIGN" %default-quadding%))
183 ;; If arch= not specified, then print unconditionally. This clause
184 ;; handles the majority of cases.
185 ((or (equal? arch #f)
193 (let loop ((prev (car (split-string-to-list arch)))
194 (rest (cdr (split-string-to-list arch))))
197 (if (not (null? rest))
200 (loop (car rest) (cdr rest)))
203 (process-children)))))
204 (if (and (not (null? role)) (equal? role "merged"))
205 (literal " [" merged-string "]")
207 (if (or %footnotes-at-end% tgroup (node-list-empty? footnotes))
209 (make element gi: "BLOCKQUOTE"
211 (list "CLASS" "FOOTNOTES"))
212 (with-mode footnote-mode
213 (process-node-list footnotes)))))))))
216 (define (toc-depth nd)
217 (if (string=? (gi nd) (normalize "book"))
221 </style-specification-body>
222 </style-specification>
224 <external-specification id="docbook" document="freebsd.dsl">