]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - release/doc/share/sgml/release.dsl
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / release / doc / share / sgml / release.dsl
1 <!-- $FreeBSD$ -->
2
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">
10 %release.ent;
11 ]>
12
13 <style-sheet>
14   <style-specification use="docbook">
15     <style-specification-body>
16
17 ; Configure behavior of this stylesheet
18 <![ %include.historic; [
19       (define %include-historic% #t)
20 ]]>
21 <![ %no.include.historic; [
22       (define %include-historic% #f)
23 ]]>
24
25 ; String manipulation functions
26 (define (split-string-to-list STR)
27   ;; return list of STR separated with char #\ or #\,
28   (if (string? STR)
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))
32                           (loop (cdr i))))))
33       '()))
34
35 (define (string-delim-index STR)
36   ;; return indexes of STR separated with char #\ or #\,
37   (if (string? STR)
38       (let ((strlen (string-length STR)))
39         (let loop ((i 0))
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))))))
45       '()
46       ))
47
48 (define (string-list-match? STR STR-LIST)
49   (let loop ((s STR-LIST))
50     (cond
51      ((equal? s #f) #f)
52      ((equal? s '()) #f)
53      ((equal? (car s) #f) #f)
54      ((equal? STR (car s)) #t)
55      (else (loop (cdr s))))))
56
57 ; Deal with conditional inclusion of text via entities.
58 (default
59   (let* ((role (attribute-string (normalize "role")))
60          (for-arch (entity-text "arch")))
61     (cond
62
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%))
67       (empty-sosofo))
68
69      ;; None of the above
70      (else (next-match)))))
71
72 (mode qandatoc
73   (default
74     (let* ((role (attribute-string (normalize "role")))
75            (for-arch (entity-text "arch")))
76       (cond
77
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%))
82         (empty-sosofo))
83
84        ;; None of the above
85        (else (next-match))))))
86
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))
92
93     <![ %output.print; [
94 ; Put URLs in footnotes, and put footnotes at the bottom of each page.
95       (define bop-footnotes #t)
96       (define %footnote-ulinks% #t)
97
98       (define ($paragraph$)
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...
106               (make paragraph
107                 first-line-start-indent: (if (is-first-para)
108                                              %para-indent-firstpara%
109                                              %para-indent%)
110                 space-before: %para-sep%
111                 space-after: (if (INLIST?)
112                                  0pt
113                                  %para-sep%)
114                 quadding: %default-quadding%
115                 hyphenate?: %hyphenation%
116                 language: (dsssl-language-code)
117                 (make sequence
118                   (cond
119                    ;; If arch= not specified, then print unconditionally.  This clause
120                    ;; handles the majority of cases.
121                    ((or (equal? arch #f)
122                         (equal? arch "")
123                         (equal? arch "all"))
124                     (make sequence
125                       (if (and (not (null? role)) (equal? role "7.1"))
126                           (literal " [7.1R]")
127                           (empty-sosofo))
128                       (if (and (not (null? role)) (equal? role "7.2"))
129                           (literal " [7.2R]")
130                           (empty-sosofo))
131                       (process-children-trim))
132                    (else
133                     (make sequence
134                       (literal "[")
135                       (let loop ((prev (car (split-string-to-list arch)))
136                                  (rest (cdr (split-string-to-list arch))))
137                         (make sequence
138                           (literal prev)
139                           (if (not (null? rest))
140                               (make sequence
141                                 (literal ", ")
142                                 (loop (car rest) (cdr rest)))
143                               (empty-sosofo))))
144                       (literal "] ")
145                       (if (and (not (null? role)) (equal? role "7.1"))
146                           (literal " [7.1R] ")
147                           (empty-sosofo))
148                       (if (and (not (null? role)) (equal? role "7.2"))
149                           (literal " [7.2R] ")
150                           (empty-sosofo))
151                       (process-children-trim))))
152                   (if (and (not (null? role)) (equal? role "merged"))
153                       (literal " [" merged-string "]")
154                       (empty-sosofo))))
155               (make paragraph
156                 first-line-start-indent: (if (is-first-para)
157                                              %para-indent-firstpara%
158                                              %para-indent%)
159                 space-before: %para-sep%
160                 space-after: (if (INLIST?)
161                                  0pt
162                                  %para-sep%)
163                 quadding: %default-quadding%
164                 hyphenate?: %hyphenation%
165                 language: (dsssl-language-code)
166                 country: (dsssl-country-code)
167                 (make sequence
168                   (cond
169                    ;; If arch= not specified, then print unconditionally.  This clause
170                    ;; handles the majority of cases.
171                    ((or (equal? arch #f)
172                         (equal? arch "")
173                         (equal? arch "all"))
174                     (make sequence
175                       (if (and (not (null? role)) (equal? role "7.1"))
176                           (literal " [7.1R] ")
177                           (empty-sosofo))
178                       (if (and (not (null? role)) (equal? role "7.2"))
179                           (literal " [7.2R] ")
180                           (empty-sosofo))
181                       (process-children-trim)))
182                    (else
183                     (make sequence
184                       (literal "[")
185                       (let loop ((prev (car (split-string-to-list arch)))
186                                  (rest (cdr (split-string-to-list arch))))
187                         (make sequence
188                           (literal prev)
189                           (if (not (null? rest))
190                               (make sequence
191                                 (literal ", ")
192                                 (loop (car rest) (cdr rest)))
193                               (empty-sosofo))))
194                       (literal "] ")
195                       (if (and (not (null? role)) (equal? role "7.1"))
196                           (literal " [7.1R]")
197                           (empty-sosofo))
198                       (if (and (not (null? role)) (equal? role "7.2"))
199                           (literal " [7.2R]")
200                           (empty-sosofo))
201                       (process-children-trim))))
202                   (if (and (not (null? role)) (equal? role "merged"))
203                       (literal " [" merged-string "]")
204                       (empty-sosofo))))))))
205     ]]>
206
207     <![ %output.html; [
208       (define %callout-graphics%
209         ;; Use graphics in callouts?
210         #f)
211
212         <!-- Convert " ... " to `` ... '' in the HTML output. -->
213         (element quote
214           (make sequence
215             (literal "&#8220;")
216             (process-children)
217             (literal "&#8221;")))
218
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))))
226             (case v
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;")))))
231
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")))
241           (make sequence
242             (make element gi: para-wrapper
243                   attributes: (append
244                                (if %default-quadding%
245                                    (list (list "ALIGN" %default-quadding%))
246                                    '()))
247                   (make sequence
248                     (cond
249                      ;; If arch= not specified, then print unconditionally.  This clause
250                      ;; handles the majority of cases.
251                      ((or (equal? arch #f)
252                           (equal? arch "")
253                           (equal? arch "all"))
254                       (make sequence
255                         (if (and (not (null? role)) (equal? role "7.1"))
256                             (literal " [7.1R] ")
257                             (empty-sosofo))
258                         (if (and (not (null? role)) (equal? role "7.2"))
259                             (literal " [7.2R] ")
260                             (empty-sosofo))
261                         (process-children)))
262                      (else
263                       (sosofo-append
264                        (make sequence
265                          (make sequence
266                            (if (and (not (null? role)) (equal? role "7.1"))
267                                (literal " [7.1R] ")
268                                (empty-sosofo))
269                            (if (and (not (null? role)) (equal? role "7.2"))
270                                (literal " [7.2R] ")
271                                (empty-sosofo)))
272                          (literal "[")
273                          (let loop ((prev (car (split-string-to-list arch)))
274                                     (rest (cdr (split-string-to-list arch))))
275                            (make sequence
276                              (literal prev)
277                              (if (not (null? rest))
278                                  (make sequence
279                                    (literal ", ")
280                                    (loop (car rest) (cdr rest)))
281                                  (empty-sosofo))))
282                          (literal "] ")
283                          (process-children)))))
284                     (if (and (not (null? role)) (equal? role "merged"))
285                         (literal " [" merged-string "]")
286                         (empty-sosofo))
287                     (if (or %footnotes-at-end% tgroup (node-list-empty? footnotes))
288                         (empty-sosofo)
289                         (make element gi: "BLOCKQUOTE"
290                               attributes: (list
291                                            (list "CLASS" "FOOTNOTES"))
292                               (with-mode footnote-mode
293                                 (process-node-list footnotes)))))))))
294     ]]>
295
296       (define (toc-depth nd)
297         (if (string=? (gi nd) (normalize "book"))
298             3
299             3))
300
301     </style-specification-body>
302   </style-specification>
303
304   <external-specification id="docbook" document="freebsd.dsl">
305 </style-sheet>