OSDN Git Service

modify .gitignore
[linuxjf/JF.git] / docs / 2001-JF-Biblio / jf-custom.dsl
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>
3 ]>
4 <style-sheet>
5
6 <!--
7 ;; ===================================================
8 ;; customize the html stylesheet; borrowed from Cygnus
9 ;; at http://sourceware.cygnus.com/ (cygnus-both.dsl)
10 ;; ===================================================
11 -->
12
13 <style-specification id="html" use="docbook">
14 <style-specification-body> 
15
16 ;; borrowed from ldp.dsl
17
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?"
22   #f)
23
24 (define %generate-legalnotice-link%
25   ;; put the legal notice in a separate file
26   #t)
27
28 ;(define %admon-graphics-path%
29 ;  ;; use graphics in admonitions, set their
30 ;  "../images/")
31
32 (define %admon-graphics%
33   #f)
34
35 (define %funcsynopsis-decoration%
36   ;; make funcsynopsis look pretty
37   #t)
38
39 (define %html-ext%
40   ;; when producing HTML files, use this extension
41   ".html")
42
43 (define %generate-book-toc%
44   ;; Should a Table of Contents be produced for books?
45   #t)
46
47 (define %generate-article-toc% 
48   ;; Should a Table of Contents be produced for articles?
49   #t)
50
51 (define %generate-part-toc%
52   ;; Should a Table of Contents be produced for parts?
53   #t)
54
55 (define %generate-book-titlepage%
56   ;; produce a title page for books
57   #t)
58
59 (define %generate-article-titlepage%
60   ;; produce a title page for articles
61   #t)
62
63 (define (chunk-skip-first-element-list)
64   ;; forces the Table of Contents on separate page
65   '())
66
67 (define (list-element-list)
68   ;; fixes bug in Table of Contents generation
69   '())
70
71 (define %root-filename%
72   ;; The filename of the root HTML document (e.g, "index").
73   "index")
74
75 (define %shade-verbatim%
76   ;; verbatim sections will be shaded if t(rue)
77   #t)
78
79 (define %use-id-as-filename%
80   ;; Use ID attributes as name for component HTML files?
81   #t)
82
83 (define %graphic-extensions%
84   ;; graphic extensions allowed
85   '("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" ))
86
87 (define %graphic-default-extension% 
88   "gif")
89
90 (define %section-autolabel%
91   ;; For enumerated sections (1.1, 1.1.1, 1.2, etc.)
92   #t)
93
94 (define (toc-depth nd)
95   ;; more depth (2 levels) to toc; instead of flat hierarchy
96   ;; 2)
97   2)
98
99 (element emphasis
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))))
104
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")
114         (normalize "author")
115         (normalize "editor")
116         (normalize "copyright")
117         (normalize "revhistory")
118         (normalize "abstract")
119         (normalize "legalnotice")))
120
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")
127         (normalize "author")
128         (normalize "othercredit")
129         (normalize "releaseinfo")
130         (normalize "copyright")
131         (normalize "pubdate")
132         (normalize "revhistory")
133         (normalize "abstract")))
134
135 ;(mode article-titlepage-recto-mode
136 ;
137 ; (element contrib
138 ;  ;; print out with othercredit information; for translators, etc.
139 ;  (make sequence
140 ;    (make element gi: "SPAN"
141 ;          attributes: (list (list "CLASS" (gi)))
142 ;          (process-children))))
143 ;
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)
153 ;              (literal " - "))
154 ;         (process-node-list author-contrib))))
155 ;)
156
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)
162                    artinfo
163                    artheader))
164          (ahtitles  (select-elements (children ahdr)
165                                      (normalize "title")))
166          (artitles  (select-elements artchild (normalize "title")))
167          (titles    (if (node-list-empty? artitles)
168                         ahtitles
169                         artitles)))
170     (if (node-list-empty? titles)
171         ""
172         (node-list-first titles))))
173
174
175 ;; jf-custom.dsl original
176
177 (define %admon-graphics-path%
178   ;; use graphics in admonitions, set their
179   "./")
180
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.
184   "./")
185
186 (mode article-titlepage-recto-mode
187
188  (element contrib
189   ;; print out with othercredit information; for translators, etc.
190   (make sequence
191     (make element gi: "SPAN"
192           attributes: (list (list "CLASS" (gi)))
193           (process-children))))
194
195  (element othercredit
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)
206                 (literal " - "))
207           (process-node-list author-contrib)
208           (process-node-list author-affil))))
209 )
210
211 (define %show-ulinks%
212   ;; REFENTRY show-ulinks
213   ;; PURP Display URLs after ULinks?
214   ;; DESC
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.
218   ;; /DESC
219   ;; AUTHOR N/A
220   ;; /REFENTRY
221   #f)
222
223 (element ulink 
224   (make element gi: "A"
225         attributes: (list
226                      (list "HREF" (attribute-string (normalize "url")))
227                      (list "TARGET" "_top"))
228         (process-children)
229         (if (and %show-ulinks%
230                 (not (equal? (attribute-string (normalize "url"))
231                                 (data-of (current-node)))))
232                 (make sequence
233                         (literal " (")
234                         (literal (attribute-string (normalize "url")))
235                         (literal ")"))
236                 (empty-sosofo))))
237
238 ;; The following is obtained from:
239 ;;
240 ;; &#62; Id: dbbibl.dsl,v 1.23 2000/07/19 18:40:06 nwalsh Exp
241 ;; &#62;
242 ;; &#62; This file is part of the Modular DocBook Stylesheet distribution.
243 ;;
244 ;; and modified for Japanese name order convention.
245 ;; (modified by Hiroki Sato &#60;hrs@jp.FreeBSD.org&#62;
246
247 (define (author-string #!optional (author (current-node)))
248   ;; Return a formatted string representation of the contents of:
249   ;; AUTHOR:
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"
254   ;; CORPAUTHOR:
255   ;;   returns (data corpauthor)
256   (let* (
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")
263                    (select-elements 
264                     (descendants author) (normalize "surname"))
265                    (select-elements 
266                     (descendants author) (normalize "firstname"))))
267          (o_nl (select-elements 
268                 (descendants author) (normalize "othername")))
269          (s_nl (if (equal? lang "ja")
270                    (select-elements 
271                     (descendants author) (normalize "firstname"))
272                    (select-elements 
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")))
285         (string-append
286          (if has_h (string-append (data-of (node-list-first h_nl))
287                                   %honorific-punctuation%) "")
288          (if has_f (string-append
289                     (if has_h " " "")
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))) ""))
299         (data-of author))))
300
301 (element email
302   ;; Do not link to mail address.
303   ($mono-seq$
304    (make sequence 
305      (literal "&#60;")
306      (process-children)
307      (literal "&#62;"))))
308
309 (define %gentext-nav-tblwidth% "100%")
310
311 (define %honorific-punctuation% " / ")
312 (define biblio-number  #t)
313 (define %table-rules% #t)
314
315
316 (define %body-attr% 
317   ;; What attributes should be hung off of BODY?
318   (list
319    (list "BGCOLOR" "#FFFFFF")
320    (list "TEXT" "#000000")))
321
322 </style-specification-body>
323 </style-specification>
324
325 <external-specification id="docbook" document="docbook.dsl">
326
327 </style-sheet>