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* ((arch (attribute-string (normalize "arch")))
60 (role (attribute-string (normalize "role")))
61 (for-arch (entity-text "arch")))
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%))
71 ; If arch= not specified, then print unconditionally. This clause
72 ; handles the majority of cases.
73 ((or (equal? arch #f) (equal? arch ""))
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.
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.
87 ; XXX This doesn't work.
88 ; ((equal? for-arch "all")
89 ; (sosofo-append (literal "[") (literal arch) (literal "] ")
90 ; (process-children)))
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))
98 (else (empty-sosofo)))))
102 (let* ((arch (attribute-string (normalize "arch")))
103 (role (attribute-string (normalize "role")))
104 (for-arch (entity-text "arch")))
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%))
114 ; If arch= not specified, then print unconditionally. This clause
115 ; handles the majority of cases.
116 ((or (equal? arch #f) (equal? arch ""))
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.
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.
130 ; XXX This doesn't work.
131 ; ((equal? for-arch "all")
132 ; (sosofo-append (literal "[") (literal arch) (literal "] ")
133 ; (process-children)))
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))
141 (else (empty-sosofo))))))
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))
150 ; Put URLs in footnotes, and put footnotes at the bottom of each page.
151 (define bop-footnotes #t)
152 (define %footnote-ulinks% #t)
156 (define %callout-graphics%
157 ;; Use graphics in callouts?
160 <!-- Convert " ... " to `` ... '' in the HTML output. -->
165 (literal "”")))
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))))
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;")))))
182 (define (toc-depth nd)
183 (if (string=? (gi nd) (normalize "book"))
187 </style-specification-body>
188 </style-specification>
190 <external-specification id="docbook" document="freebsd.dsl">