2001-04-27 21:28:02 +00:00
|
|
|
<!-- $FreeBSD$ -->
|
|
|
|
|
|
|
|
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
|
2002-01-07 03:51:41 +00:00
|
|
|
<!ENTITY % output.html "IGNORE">
|
|
|
|
<!ENTITY % output.print "IGNORE">
|
2002-06-20 21:19:49 +00:00
|
|
|
<!ENTITY % include.historic "IGNORE">
|
|
|
|
<!ENTITY % no.include.historic "IGNORE">
|
2001-04-27 21:28:02 +00:00
|
|
|
<!ENTITY freebsd.dsl PUBLIC "-//FreeBSD//DOCUMENT DocBook Stylesheet//EN" CDATA DSSSL>
|
2003-05-23 10:30:27 +00:00
|
|
|
<!ENTITY % release.ent PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN">
|
|
|
|
%release.ent;
|
2001-04-27 21:28:02 +00:00
|
|
|
]>
|
|
|
|
|
|
|
|
<style-sheet>
|
|
|
|
<style-specification use="docbook">
|
|
|
|
<style-specification-body>
|
|
|
|
|
2002-06-20 21:19:49 +00:00
|
|
|
; Configure behavior of this stylesheet
|
|
|
|
<![ %include.historic; [
|
|
|
|
(define %include-historic% #t)
|
|
|
|
]]>
|
|
|
|
<![ %no.include.historic; [
|
|
|
|
(define %include-historic% #f)
|
|
|
|
]]>
|
|
|
|
|
2001-10-19 20:41:09 +00:00
|
|
|
; String manipulation functions
|
|
|
|
(define (split-string-to-list STR)
|
|
|
|
;; return list of STR separated with char #\ or #\,
|
|
|
|
(if (string? STR)
|
|
|
|
(let loop ((i (string-delim-index STR)))
|
|
|
|
(cond ((equal? (cdr i) '()) '())
|
|
|
|
(else (cons (substring STR (list-ref i 0) (- (list-ref i 1) 1))
|
|
|
|
(loop (cdr i))))))
|
|
|
|
'()))
|
2001-04-27 21:28:02 +00:00
|
|
|
|
2001-10-19 20:41:09 +00:00
|
|
|
(define (string-delim-index STR)
|
|
|
|
;; return indexes of STR separated with char #\ or #\,
|
|
|
|
(if (string? STR)
|
|
|
|
(let ((strlen (string-length STR)))
|
|
|
|
(let loop ((i 0))
|
|
|
|
(cond ((= i strlen) (cons (+ strlen 1) '()))
|
|
|
|
((= i 0) (cons i (loop (+ i 1))))
|
|
|
|
((or (equal? (string-ref STR i) #\ )
|
|
|
|
(equal? (string-ref STR i) #\,)) (cons (+ i 1) (loop (+ i 1))))
|
|
|
|
(else (loop (+ i 1))))))
|
|
|
|
'()
|
|
|
|
))
|
|
|
|
|
|
|
|
(define (string-list-match? STR STR-LIST)
|
|
|
|
(let loop ((s STR-LIST))
|
|
|
|
(cond
|
|
|
|
((equal? s #f) #f)
|
|
|
|
((equal? s '()) #f)
|
|
|
|
((equal? (car s) #f) #f)
|
|
|
|
((equal? STR (car s)) #t)
|
|
|
|
(else (loop (cdr s))))))
|
|
|
|
|
|
|
|
; Deal with conditional inclusion of text via entities.
|
2001-04-27 21:28:02 +00:00
|
|
|
(default
|
2001-05-02 22:02:50 +00:00
|
|
|
(let* ((arch (attribute-string (normalize "arch")))
|
2002-06-20 21:19:49 +00:00
|
|
|
(role (attribute-string (normalize "role")))
|
2001-05-02 22:02:50 +00:00
|
|
|
(for-arch (entity-text "arch")))
|
2001-10-19 20:41:09 +00:00
|
|
|
(cond
|
|
|
|
|
2002-06-20 21:19:49 +00:00
|
|
|
; If role=historic, and we're not printing historic things, then
|
|
|
|
; don't output this element.
|
|
|
|
((and (equal? role "historic")
|
|
|
|
(not %include-historic%))
|
|
|
|
(empty-sosofo))
|
|
|
|
|
|
|
|
|
2001-10-19 20:41:09 +00:00
|
|
|
; If arch= not specified, then print unconditionally. This clause
|
|
|
|
; handles the majority of cases.
|
|
|
|
((or (equal? arch #f) (equal? arch ""))
|
|
|
|
(next-match))
|
|
|
|
|
|
|
|
; arch= specified, see if it's equal to "all". If so, then
|
|
|
|
; print unconditionally. Note that this clause could be
|
|
|
|
; combined with the check to see if arch= wasn't specified
|
|
|
|
; or was empty; they have the same outcome.
|
|
|
|
((equal? arch "all")
|
|
|
|
(next-match))
|
|
|
|
|
|
|
|
; arch= specified. If we're building for all architectures,
|
|
|
|
; then print it prepended with the set of architectures to which
|
|
|
|
; this element applies.
|
|
|
|
;
|
|
|
|
; XXX This doesn't work.
|
|
|
|
; ((equal? for-arch "all")
|
|
|
|
; (sosofo-append (literal "[") (literal arch) (literal "] ")
|
|
|
|
; (process-children)))
|
|
|
|
|
|
|
|
; arch= specified, so we need to check to see if the specified
|
|
|
|
; parameter includes the architecture we're building for.
|
|
|
|
((string-list-match? for-arch (split-string-to-list arch))
|
|
|
|
(next-match))
|
|
|
|
|
|
|
|
; None of the above
|
|
|
|
(else (empty-sosofo)))))
|
2001-04-27 21:28:02 +00:00
|
|
|
|
2001-05-14 22:31:51 +00:00
|
|
|
; We might have some sect1 level elements where the modification times
|
|
|
|
; are significant. An example of this is the "What's New" section in
|
|
|
|
; the release notes. We enable the printing of pubdate entry in
|
|
|
|
; sect1info elements to support this.
|
|
|
|
(element (sect1info pubdate) (process-children))
|
|
|
|
|
2002-01-07 03:51:41 +00:00
|
|
|
<![ %output.print; [
|
|
|
|
; Put URLs in footnotes, and put footnotes at the bottom of each page.
|
|
|
|
(define bop-footnotes #t)
|
|
|
|
(define %footnote-ulinks% #t)
|
|
|
|
]]>
|
|
|
|
|
2002-03-23 00:23:53 +00:00
|
|
|
<![ %output.html; [
|
|
|
|
(define %callout-graphics%
|
|
|
|
;; Use graphics in callouts?
|
|
|
|
#f)
|
2003-05-23 10:30:27 +00:00
|
|
|
|
|
|
|
<!-- Convert " ... " to `` ... '' in the HTML output. -->
|
|
|
|
(element quote
|
|
|
|
(make sequence
|
2005-05-05 17:10:37 +00:00
|
|
|
(literal "“")
|
2003-05-23 10:30:27 +00:00
|
|
|
(process-children)
|
2005-05-05 17:10:37 +00:00
|
|
|
(literal "”")))
|
2003-05-23 10:30:27 +00:00
|
|
|
|
|
|
|
<!-- Specify how to generate the man page link HREF -->
|
|
|
|
(define ($create-refentry-xref-link$ #!optional (n (current-node)))
|
|
|
|
(let* ((r (select-elements (children n) (normalize "refentrytitle")))
|
|
|
|
(m (select-elements (children n) (normalize "manvolnum")))
|
|
|
|
(v (attribute-string (normalize "vendor") n))
|
|
|
|
(u (string-append "&release.man.url;?query="
|
|
|
|
(data r) "&" "sektion=" (data m))))
|
|
|
|
(case v
|
|
|
|
(("xfree86") (string-append u "&" "manpath=XFree86+&release.manpath.xfree86;" ))
|
2004-09-05 13:50:38 +00:00
|
|
|
(("xorg") (string-append u "&" "manpath=Xorg+&release.manpath.xorg;" ))
|
2003-05-23 10:30:27 +00:00
|
|
|
(("netbsd") (string-append u "&" "manpath=NetBSD+&release.manpath.netbsd;"))
|
|
|
|
(("ports") (string-append u "&" "manpath=FreeBSD+&release.manpath.freebsd-ports;"))
|
|
|
|
(else (string-append u "&" "manpath=FreeBSD+&release.manpath.freebsd;")))))
|
2002-03-23 00:23:53 +00:00
|
|
|
]]>
|
|
|
|
|
2003-05-23 10:30:27 +00:00
|
|
|
(define (toc-depth nd)
|
|
|
|
(if (string=? (gi nd) (normalize "book"))
|
|
|
|
3
|
|
|
|
3))
|
|
|
|
|
2001-04-27 21:28:02 +00:00
|
|
|
</style-specification-body>
|
|
|
|
</style-specification>
|
|
|
|
|
|
|
|
<external-specification id="docbook" document="freebsd.dsl">
|
|
|
|
</style-sheet>
|