1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
2 <!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA dsssl>
7 ;; ===================================================
8 ;; customize the html stylesheet; borrowed from Cygnus
9 ;; at http://sourceware.cygnus.com/ (cygnus-both.dsl)
10 ;; ===================================================
13 <style-specification id="html" use="docbook">
14 <style-specification-body>
16 ;; borrowed from ldp.dsl
18 (declare-characteristic preserve-sdata?
19 ;; this is necessary because right now jadetex does not understand
20 ;; symbolic entities, whereas things work well with numeric entities.
21 "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
24 (define %generate-legalnotice-link%
25 ;; put the legal notice in a separate file
28 ;(define %admon-graphics-path%
29 ; ;; use graphics in admonitions, set their
32 (define %admon-graphics%
35 (define %funcsynopsis-decoration%
36 ;; make funcsynopsis look pretty
40 ;; when producing HTML files, use this extension
43 (define %generate-book-toc%
44 ;; Should a Table of Contents be produced for books?
47 (define %generate-article-toc%
48 ;; Should a Table of Contents be produced for articles?
51 (define %generate-part-toc%
52 ;; Should a Table of Contents be produced for parts?
55 (define %generate-book-titlepage%
56 ;; produce a title page for books
59 (define %generate-article-titlepage%
60 ;; produce a title page for articles
63 (define (chunk-skip-first-element-list)
64 ;; forces the Table of Contents on separate page
67 (define (list-element-list)
68 ;; fixes bug in Table of Contents generation
71 (define %root-filename%
72 ;; The filename of the root HTML document (e.g, "index").
75 (define %shade-verbatim%
76 ;; verbatim sections will be shaded if t(rue)
79 (define %use-id-as-filename%
80 ;; Use ID attributes as name for component HTML files?
83 (define %graphic-extensions%
84 ;; graphic extensions allowed
85 '("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" ))
87 (define %graphic-default-extension%
90 (define %section-autolabel%
91 ;; For enumerated sections (1.1, 1.1.1, 1.2, etc.)
94 (define (toc-depth nd)
95 ;; more depth (2 levels) to toc; instead of flat hierarchy
100 ;; make role=strong equate to bold for emphasis tag
101 (if (equal? (attribute-string "role") "strong")
102 (make element gi: "STRONG" (process-children))
103 (make element gi: "EM" (process-children))))
105 (define (book-titlepage-recto-elements)
106 ;; elements on a book's titlepage
107 ;; note: added revhistory to the default list
108 (list (normalize "title")
109 (normalize "subtitle")
110 (normalize "graphic")
111 (normalize "mediaobject")
112 (normalize "corpauthor")
113 (normalize "authorgroup")
116 (normalize "copyright")
117 (normalize "revhistory")
118 (normalize "abstract")
119 (normalize "legalnotice")))
121 (define (article-titlepage-recto-elements)
122 ;; elements on an article's titlepage
123 ;; note: added othercredit to the default list
124 (list (normalize "title")
125 (normalize "subtitle")
126 (normalize "authorgroup")
128 (normalize "othercredit")
129 (normalize "releaseinfo")
130 (normalize "copyright")
131 (normalize "pubdate")
132 (normalize "revhistory")
133 (normalize "abstract")))
135 ;(mode article-titlepage-recto-mode
138 ; ;; print out with othercredit information; for translators, etc.
140 ; (make element gi: "SPAN"
141 ; attributes: (list (list "CLASS" (gi)))
142 ; (process-children))))
144 ; (element othercredit
145 ; ;; print out othercredit information; for translators, etc.
146 ; (let ((author-name (author-string))
147 ; (author-contrib (select-elements (children (current-node))
148 ; (normalize "contrib"))))
149 ; (make element gi: "P"
150 ; attributes: (list (list "CLASS" (gi)))
151 ; (make element gi: "B"
152 ; (literal author-name)
154 ; (process-node-list author-contrib))))
157 (define (article-title nd)
158 (let* ((artchild (children nd))
159 (artheader (select-elements artchild (normalize "artheader")))
160 (artinfo (select-elements artchild (normalize "articleinfo")))
161 (ahdr (if (node-list-empty? artheader)
164 (ahtitles (select-elements (children ahdr)
165 (normalize "title")))
166 (artitles (select-elements artchild (normalize "title")))
167 (titles (if (node-list-empty? artitles)
170 (if (node-list-empty? titles)
172 (node-list-first titles))))
175 ;; jf-custom.dsl original
177 (define %admon-graphics-path%
178 ;; use graphics in admonitions, set their
181 (define %callout-graphics-path%
182 ;; Sets the path, probably relative to the directory where the HTML
183 ;; files are created, to the callout graphics.
186 (mode article-titlepage-recto-mode
189 ;; print out with othercredit information; for translators, etc.
191 (make element gi: "SPAN"
192 attributes: (list (list "CLASS" (gi)))
193 (process-children))))
196 ;; print out othercredit information; for translators, etc.
197 (let ((author-name (author-string))
198 (author-contrib (select-elements (children (current-node))
199 (normalize "contrib")))
200 (author-affil (select-elements (children (current-node))
201 (normalize "affiliation"))))
202 (make element gi: "P"
203 attributes: (list (list "CLASS" (gi)))
204 (make element gi: "B"
205 (literal author-name)
207 (process-node-list author-contrib)
208 (process-node-list author-affil))))
211 (define %show-ulinks%
212 ;; REFENTRY show-ulinks
213 ;; PURP Display URLs after ULinks?
215 ;; If true, the URL of each ULink will appear in parenthesis after
216 ;; the text of the link. If the text of the link and the URL are
217 ;; identical, the parenthetical URL is suppressed.
224 (make element gi: "A"
226 (list "HREF" (attribute-string (normalize "url")))
227 (list "TARGET" "_top"))
229 (if (and %show-ulinks%
230 (not (equal? (attribute-string (normalize "url"))
231 (data-of (current-node)))))
234 (literal (attribute-string (normalize "url")))
238 ;; The following is obtained from:
240 ;; > Id: dbbibl.dsl,v 1.23 2000/07/19 18:40:06 nwalsh Exp
242 ;; > This file is part of the Modular DocBook Stylesheet distribution.
244 ;; and modified for Japanese name order convention.
245 ;; (modified by Hiroki Sato <hrs@jp.FreeBSD.org>
247 (define (author-string #!optional (author (current-node)))
248 ;; Return a formatted string representation of the contents of:
250 ;; Handles Honorific, FirstName, SurName, and Lineage.
251 ;; If %author-othername-in-middle% is #t, also OtherName
252 ;; Handles *only* the first of each.
253 ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage"
255 ;; returns (data corpauthor)
257 ; (lang (attribute-string "lang" (select-elements
258 ; author (normalize "author"))))
259 (lang (if (string? author) ($lang$) ($lang$ author)))
260 (h_nl (select-elements
261 (descendants author) (normalize "honorific")))
262 (f_nl (if (equal? lang "ja")
264 (descendants author) (normalize "surname"))
266 (descendants author) (normalize "firstname"))))
267 (o_nl (select-elements
268 (descendants author) (normalize "othername")))
269 (s_nl (if (equal? lang "ja")
271 (descendants author) (normalize "firstname"))
273 (descendants author) (normalize "surname"))))
274 (l_nl (select-elements
275 (descendants author) (normalize "lineage")))
276 (has_h (not (node-list-empty? h_nl)))
277 (has_f (not (node-list-empty? f_nl)))
278 (has_o (and %author-othername-in-middle%
279 (not (node-list-empty? o_nl))))
280 (has_s (not (node-list-empty? s_nl)))
281 (has_l (not (node-list-empty? l_nl))))
282 (if (or (equal? (gi author) (normalize "author"))
283 (equal? (gi author) (normalize "editor"))
284 (equal? (gi author) (normalize "othercredit")))
286 (if has_h (string-append (data-of (node-list-first h_nl))
287 %honorific-punctuation%) "")
288 (if has_f (string-append
290 (data-of (node-list-first f_nl))) "")
291 (if has_o (string-append
292 (if (or has_h has_f) " " "")
293 (data-of (node-list-first o_nl))) "")
294 (if has_s (string-append
295 (if (or has_h has_f has_o) " " "")
296 (data-of (node-list-first s_nl))) "")
297 (if has_l (string-append
298 ", " (data-of (node-list-first l_nl))) ""))
302 ;; Do not link to mail address.
309 (define %gentext-nav-tblwidth% "100%")
311 (define %honorific-punctuation% " / ")
312 (define biblio-number #t)
313 (define %table-rules% #t)
317 ;; What attributes should be hung off of BODY?
319 (list "BGCOLOR" "#FFFFFF")
320 (list "TEXT" "#000000")))
322 </style-specification-body>
323 </style-specification>
325 <external-specification id="docbook" document="docbook.dsl">