]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - release/doc/share/sgml/release.dsl
This commit was generated by cvs2svn to compensate for changes in r172771,
[FreeBSD/FreeBSD.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* ((arch (attribute-string (normalize "arch")))
60          (role (attribute-string (normalize "role")))
61          (for-arch (entity-text "arch")))
62     (cond
63
64      ; If role=historic, and we're not printing historic things, then
65      ; don't output this element.
66      ((and (equal? role "historic")
67            (not %include-historic%))
68       (empty-sosofo))
69       
70
71      ; If arch= not specified, then print unconditionally.  This clause
72      ; handles the majority of cases.
73      ((or (equal? arch #f) (equal? arch ""))
74       (next-match))
75
76      ; arch= specified, see if it's equal to "all".  If so, then
77      ; print unconditionally.  Note that this clause could be
78      ; combined with the check to see if arch= wasn't specified
79      ; or was empty; they have the same outcome.
80      ((equal? arch "all")
81       (next-match))
82
83      ; arch= specified.  If we're building for all architectures,
84      ; then print it prepended with the set of architectures to which
85      ; this element applies.
86      ;
87      ; XXX This doesn't work.
88 ;     ((equal? for-arch "all")
89 ;      (sosofo-append (literal "[") (literal arch) (literal "] ")
90 ;                    (process-children)))
91
92      ; arch= specified, so we need to check to see if the specified
93      ; parameter includes the architecture we're building for.
94      ((string-list-match? for-arch (split-string-to-list arch))
95       (next-match))
96
97      ; None of the above
98      (else (empty-sosofo)))))
99
100 (mode qandatoc
101   (default
102   (let* ((arch (attribute-string (normalize "arch")))
103          (role (attribute-string (normalize "role")))
104          (for-arch (entity-text "arch")))
105     (cond
106
107      ; If role=historic, and we're not printing historic things, then
108      ; don't output this element.
109      ((and (equal? role "historic")
110            (not %include-historic%))
111       (empty-sosofo))
112       
113
114      ; If arch= not specified, then print unconditionally.  This clause
115      ; handles the majority of cases.
116      ((or (equal? arch #f) (equal? arch ""))
117       (next-match))
118
119      ; arch= specified, see if it's equal to "all".  If so, then
120      ; print unconditionally.  Note that this clause could be
121      ; combined with the check to see if arch= wasn't specified
122      ; or was empty; they have the same outcome.
123      ((equal? arch "all")
124       (next-match))
125
126      ; arch= specified.  If we're building for all architectures,
127      ; then print it prepended with the set of architectures to which
128      ; this element applies.
129      ;
130      ; XXX This doesn't work.
131 ;     ((equal? for-arch "all")
132 ;      (sosofo-append (literal "[") (literal arch) (literal "] ")
133 ;                    (process-children)))
134
135      ; arch= specified, so we need to check to see if the specified
136      ; parameter includes the architecture we're building for.
137      ((string-list-match? for-arch (split-string-to-list arch))
138       (next-match))
139
140      ; None of the above
141      (else (empty-sosofo))))))
142
143 ; We might have some sect1 level elements where the modification times
144 ; are significant.  An example of this is the "What's New" section in
145 ; the release notes.  We enable the printing of pubdate entry in
146 ; sect1info elements to support this.
147 (element (sect1info pubdate) (process-children))
148
149     <![ %output.print; [
150 ; Put URLs in footnotes, and put footnotes at the bottom of each page.
151       (define bop-footnotes #t)
152       (define %footnote-ulinks% #t)
153     ]]>
154
155     <![ %output.html; [
156       (define %callout-graphics%
157         ;; Use graphics in callouts?
158         #f)
159
160         <!-- Convert " ... " to `` ... '' in the HTML output. -->
161         (element quote
162           (make sequence
163             (literal "&#8220;")
164             (process-children)
165             (literal "&#8221;")))
166
167         <!-- Specify how to generate the man page link HREF -->
168         (define ($create-refentry-xref-link$ #!optional (n (current-node)))
169           (let* ((r (select-elements (children n) (normalize "refentrytitle")))
170                  (m (select-elements (children n) (normalize "manvolnum")))
171                  (v (attribute-string (normalize "vendor") n))
172                  (u (string-append "&release.man.url;?query="
173                          (data r) "&" "sektion=" (data m))))
174             (case v
175               (("xfree86") (string-append u "&" "manpath=XFree86+&release.manpath.xfree86;" ))
176               (("xorg")    (string-append u "&" "manpath=Xorg+&release.manpath.xorg;" ))
177               (("netbsd")  (string-append u "&" "manpath=NetBSD+&release.manpath.netbsd;"))
178               (("ports")   (string-append u "&" "manpath=FreeBSD+&release.manpath.freebsd-ports;"))
179               (else        (string-append u "&" "manpath=FreeBSD+&release.manpath.freebsd;")))))
180     ]]>
181
182       (define (toc-depth nd)
183         (if (string=? (gi nd) (normalize "book"))
184             3
185             3))
186
187     </style-specification-body>
188   </style-specification>
189
190   <external-specification id="docbook" document="freebsd.dsl">
191 </style-sheet>