]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - release/doc/share/sgml/release.dsl
Clean-up old contents and bump version numbers for 8.1R.
[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                     (process-children-trim))
125                    (else
126                     (make sequence
127                       (literal "[")
128                       (let loop ((prev (car (split-string-to-list arch)))
129                                  (rest (cdr (split-string-to-list arch))))
130                         (make sequence
131                           (literal prev)
132                           (if (not (null? rest))
133                               (make sequence
134                                 (literal ", ")
135                                 (loop (car rest) (cdr rest)))
136                               (empty-sosofo))))
137                       (literal "] ")
138                       (process-children-trim))))
139                   (if (and (not (null? role)) (equal? role "merged"))
140                       (literal " [" merged-string "]")
141                       (empty-sosofo))))
142               (make paragraph
143                 first-line-start-indent: (if (is-first-para)
144                                              %para-indent-firstpara%
145                                              %para-indent%)
146                 space-before: %para-sep%
147                 space-after: (if (INLIST?)
148                                  0pt
149                                  %para-sep%)
150                 quadding: %default-quadding%
151                 hyphenate?: %hyphenation%
152                 language: (dsssl-language-code)
153                 country: (dsssl-country-code)
154                 (make sequence
155                   (cond
156                    ;; If arch= not specified, then print unconditionally.  This clause
157                    ;; handles the majority of cases.
158                    ((or (equal? arch #f)
159                         (equal? arch "")
160                         (equal? arch "all"))
161                     (process-children-trim))
162                    (else
163                     (make sequence
164                       (literal "[")
165                       (let loop ((prev (car (split-string-to-list arch)))
166                                  (rest (cdr (split-string-to-list arch))))
167                         (make sequence
168                           (literal prev)
169                           (if (not (null? rest))
170                               (make sequence
171                                 (literal ", ")
172                                 (loop (car rest) (cdr rest)))
173                               (empty-sosofo))))
174                       (literal "] ")
175                       (process-children-trim))))
176                   (if (and (not (null? role)) (equal? role "merged"))
177                       (literal " [" merged-string "]")
178                       (empty-sosofo)))))))
179     ]]>
180
181     <![ %output.html; [
182       (define %callout-graphics%
183         ;; Use graphics in callouts?
184         #f)
185
186         <!-- Convert " ... " to `` ... '' in the HTML output. -->
187         (element quote
188           (make sequence
189             (literal "&#8220;")
190             (process-children)
191             (literal "&#8221;")))
192
193         <!-- Specify how to generate the man page link HREF -->
194         (define ($create-refentry-xref-link$ #!optional (n (current-node)))
195           (let* ((r (select-elements (children n) (normalize "refentrytitle")))
196                  (m (select-elements (children n) (normalize "manvolnum")))
197                  (v (attribute-string (normalize "vendor") n))
198                  (u (string-append "&release.man.url;?query="
199                          (data r) "&" "sektion=" (data m))))
200             (case v
201               (("xorg")    (string-append u "&" "manpath=Xorg+&release.manpath.xorg;" ))
202               (("netbsd")  (string-append u "&" "manpath=NetBSD+&release.manpath.netbsd;"))
203               (("ports")   (string-append u "&" "manpath=FreeBSD+&release.manpath.freebsd-ports;"))
204               (else        (string-append u "&" "manpath=FreeBSD+&release.manpath.freebsd;")))))
205
206       ;; $paragraph$ function with arch attribute support.
207       (define ($paragraph$ #!optional (para-wrapper "P"))
208         (let ((footnotes (select-elements (descendants (current-node))
209                                           (normalize "footnote")))
210               (tgroup (have-ancestor? (normalize "tgroup")))
211               (arch (attribute-string (normalize "arch")))
212               (role (attribute-string (normalize "role")))
213               (arch-string (entity-text "arch"))
214               (merged-string (entity-text "merged")))
215           (make sequence
216             (make element gi: para-wrapper
217                   attributes: (append
218                                (if %default-quadding%
219                                    (list (list "ALIGN" %default-quadding%))
220                                    '()))
221                   (make sequence
222                     (cond
223                      ;; If arch= not specified, then print unconditionally.  This clause
224                      ;; handles the majority of cases.
225                      ((or (equal? arch #f)
226                           (equal? arch "")
227                           (equal? arch "all"))
228                       (process-children))
229                      (else
230                       (sosofo-append
231                        (make sequence
232                          (literal "[")
233                          (let loop ((prev (car (split-string-to-list arch)))
234                                     (rest (cdr (split-string-to-list arch))))
235                            (make sequence
236                              (literal prev)
237                              (if (not (null? rest))
238                                  (make sequence
239                                    (literal ", ")
240                                    (loop (car rest) (cdr rest)))
241                                  (empty-sosofo))))
242                          (literal "] ")
243                          (process-children)))))
244                     (if (and (not (null? role)) (equal? role "merged"))
245                         (literal " [" merged-string "]")
246                         (empty-sosofo))
247                     (if (or %footnotes-at-end% tgroup (node-list-empty? footnotes))
248                         (empty-sosofo)
249                         (make element gi: "BLOCKQUOTE"
250                               attributes: (list
251                                            (list "CLASS" "FOOTNOTES"))
252                               (with-mode footnote-mode
253                                 (process-node-list footnotes)))))))))
254     ]]>
255
256       (define (toc-depth nd)
257         (if (string=? (gi nd) (normalize "book"))
258             3
259             3))
260
261     </style-specification-body>
262   </style-specification>
263
264   <external-specification id="docbook" document="freebsd.dsl">
265 </style-sheet>