1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
3 PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//DA"
9 <style-specification id="docbook-l10n-da">
10 <style-specification-body>
12 ;; $Id: dbl1da.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $
14 ;; This file is part of the Modular DocBook Stylesheet distribution.
15 ;; See ../README or http://nwalsh.com/docbook/dsssl/
18 ;; ----------------------------- Localization -----------------------------
20 ;; If you create a new version of this file, please send it to
21 ;; Norman Walsh, ndw@nwalsh.com
24 ;; Finn Bock, fbo@dde.dk
26 (define (da-author-string #!optional (author (current-node)))
27 ;; Return a formatted string representation of the contents of:
29 ;; Handles Honorific, FirstName, SurName, and Lineage.
30 ;; If %author-othername-in-middle% is #t, also OtherName
31 ;; Handles *only* the first of each.
32 ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage"
34 ;; returns (data corpauthor)
35 (let* ((h_nl (select-elements (descendants author) (normalize "honorific")))
36 (f_nl (select-elements (descendants author) (normalize "firstname")))
37 (o_nl (select-elements (descendants author) (normalize "othername")))
38 (s_nl (select-elements (descendants author) (normalize "surname")))
39 (l_nl (select-elements (descendants author) (normalize "lineage")))
40 (has_h (not (node-list-empty? h_nl)))
41 (has_f (not (node-list-empty? f_nl)))
42 (has_o (and %author-othername-in-middle%
43 (not (node-list-empty? o_nl))))
44 (has_s (not (node-list-empty? s_nl)))
45 (has_l (not (node-list-empty? l_nl))))
46 (if (or (equal? (gi author) (normalize "author"))
47 (equal? (gi author) (normalize "editor"))
48 (equal? (gi author) (normalize "othercredit")))
50 (if has_h (string-append (data-of (node-list-first h_nl))
51 %honorific-punctuation%) "")
52 (if has_f (string-append
54 (data-of (node-list-first f_nl))) "")
55 (if has_o (string-append
56 (if (or has_h has_f) " " "")
57 (data-of (node-list-first o_nl))) "")
58 (if has_s (string-append
59 (if (or has_h has_f has_o) " " "")
60 (data-of (node-list-first s_nl))) "")
61 (if has_l (string-append ", " (data-of (node-list-first l_nl))) ""))
64 (define (da-xref-strings)
65 (list (list (normalize "appendix") (if %chapter-autolabel%
67 "&appendix; med navn %t"))
68 (list (normalize "article") (string-append %gentext-da-start-quote%
70 %gentext-da-end-quote%))
71 (list (normalize "bibliography") "%t")
72 (list (normalize "book") "%t")
73 (list (normalize "chapter") (if %chapter-autolabel%
76 (list (normalize "equation") "&Equation; %n")
77 (list (normalize "example") "&Example; %n")
78 (list (normalize "figure") "&Figure; %n")
79 (list (normalize "glossary") "%t")
80 (list (normalize "index") "%t")
81 (list (normalize "listitem") "%n")
82 (list (normalize "part") "&Part; %n")
83 (list (normalize "preface") "%t")
84 (list (normalize "procedure") "&Procedure; %n, %t")
85 (list (normalize "reference") "&Reference; %n, %t")
86 (list (normalize "section") (if %section-autolabel%
88 "sektionen med navn %t"))
89 (list (normalize "sect1") (if %section-autolabel%
91 "sektionen med navn %t"))
92 (list (normalize "sect2") (if %section-autolabel%
94 "undersektionen med navn %t"))
95 (list (normalize "sect3") (if %section-autolabel%
97 "undersektionen med navn %t"))
98 (list (normalize "sect4") (if %section-autolabel%
100 "undersektionen med navn %t"))
101 (list (normalize "sect5") (if %section-autolabel%
103 "undersektionen med navn %t"))
104 (list (normalize "simplesect") (if %section-autolabel%
106 "undersektionen med navn %t"))
107 (list (normalize "sidebar") "&sidebar; %t")
108 (list (normalize "step") "&step; %n")
109 (list (normalize "table") "&Table; %n")))
111 (define (gentext-da-xref-strings gind)
112 (let* ((giname (if (string? gind) gind (gi gind)))
113 (name (normalize giname))
114 (xref (assoc name (da-xref-strings))))
117 (let* ((msg (string-append "[&xrefto; "
118 (if giname giname "&nonexistantelement;")
120 (err (node-list-error msg (current-node))))
123 (define (da-auto-xref-indirect-connector before)
126 ;; Should the TOC come first or last?
128 (define %generate-da-toc-in-front% #t)
130 ;; gentext-element-name returns the generated text that should be
131 ;; used to make reference to the selected element.
134 (define (da-element-name)
136 (list (normalize "abstract") "&Abstract;")
137 (list (normalize "answer") "&Answer;")
138 (list (normalize "appendix") "&Appendix;")
139 (list (normalize "article") "&Article;")
140 (list (normalize "bibliography") "&Bibliography;")
141 (list (normalize "book") "&Book;")
142 (list (normalize "calloutlist") "")
143 (list (normalize "caution") "&Caution;")
144 (list (normalize "chapter") "&Chapter;")
145 (list (normalize "copyright") "&Copyright;")
146 (list (normalize "dedication") "&Dedication;")
147 (list (normalize "edition") "&Edition;")
148 (list (normalize "equation") "&Equation;")
149 (list (normalize "example") "&Example;")
150 (list (normalize "figure") "&Figure;")
151 (list (normalize "glossary") "&Glossary;")
152 (list (normalize "glosssee") "&GlossSee;")
153 (list (normalize "glossseealso") "&GlossSeeAlso;")
154 (list (normalize "important") "&Important;")
155 (list (normalize "index") "&Index;")
156 (list (normalize "colophon") "&Colophon;")
157 (list (normalize "setindex") "&SetIndex;")
158 (list (normalize "isbn") "&isbn;")
159 (list (normalize "legalnotice") "&LegalNotice;")
160 (list (normalize "msgaud") "&MsgAud;")
161 (list (normalize "msglevel") "&MsgLevel;")
162 (list (normalize "msgorig") "&MsgOrig;")
163 (list (normalize "note") "&Note;")
164 (list (normalize "part") "&Part;")
165 (list (normalize "preface") "&Preface;")
166 (list (normalize "procedure") "&Procedure;")
167 (list (normalize "pubdate") "&Published;")
168 (list (normalize "question") "&Question;")
169 (list (normalize "refentry") "&RefEntry;")
170 (list (normalize "reference") "&Reference;")
171 (list (normalize "refname") "&RefName;")
172 (list (normalize "revhistory") "&RevHistory;")
173 (list (normalize "refsect1") "&RefSection;")
174 (list (normalize "refsect2") "&RefSection;")
175 (list (normalize "refsect3") "&RefSection;")
176 (list (normalize "refsynopsisdiv") "&RefSynopsisDiv;")
177 (list (normalize "revision") "&Revision;")
178 (list (normalize "sect1") "&Section;")
179 (list (normalize "sect2") "&Section;")
180 (list (normalize "sect3") "&Section;")
181 (list (normalize "sect4") "&Section;")
182 (list (normalize "sect5") "&Section;")
183 (list (normalize "section") "&Section;")
184 (list (normalize "simplesect") "&Section;")
185 (list (normalize "seeie") "&See;")
186 (list (normalize "seealsoie") "&Seealso;")
187 (list (normalize "set") "&Set;")
188 (list (normalize "sidebar") "&Sidebar;")
189 (list (normalize "step") "&step;")
190 (list (normalize "table") "&Table;")
191 (list (normalize "tip") "&Tip;")
192 (list (normalize "toc") "&TableofContents;")
193 (list (normalize "warning") "&Warning;")
196 (define (gentext-da-element-name gind)
197 (let* ((giname (if (string? gind) gind (gi gind)))
198 (name (normalize giname))
199 (pname (assoc name (da-element-name))))
202 (let* ((msg (string-append
203 "gentext-da-element-name: &unexpectedelementname;: "
205 (err (node-list-error msg (current-node))))
208 ;; gentext-element-name-space returns gentext-element-name with a
209 ;; trailing space, if gentext-element-name isn't "".
211 (define (gentext-da-element-name-space giname)
212 (string-with-space (gentext-element-name giname)))
214 ;; gentext-intra-label-sep returns the seperator to be inserted
215 ;; between multiple occurances of a label (or parts of a label)
216 ;; for the specified element. Most of these are for enumerated
217 ;; labels like "Figure 2-4", but this function is used elsewhere
218 ;; (e.g. REFNAME) with a little abuse.
221 (define (local-da-intra-label-sep)
224 (define (da-intra-label-sep)
226 (list (normalize "equation") "-")
227 (list (normalize "informalequation") "-")
228 (list (normalize "example") "-")
229 (list (normalize "figure") "-")
230 (list (normalize "listitem") ".")
231 (list (normalize "procedure") ".")
232 (list (normalize "refentry") ".")
233 (list (normalize "reference") ".")
234 (list (normalize "refname") ", ")
235 (list (normalize "refsect1") ".")
236 (list (normalize "refsect2") ".")
237 (list (normalize "refsect3") ".")
238 (list (normalize "sect1") ".")
239 (list (normalize "sect2") ".")
240 (list (normalize "sect3") ".")
241 (list (normalize "sect4") ".")
242 (list (normalize "sect5") ".")
243 (list (normalize "section") ".")
244 (list (normalize "simplesect") ".")
245 (list (normalize "step") ".")
246 (list (normalize "table") "-")
247 (list (normalize "_pagenumber") "-")
250 (define (gentext-da-intra-label-sep gind)
251 (let* ((giname (if (string? gind) gind (gi gind)))
252 (name (normalize giname))
253 (lsep (assoc name (local-da-intra-label-sep)))
254 (sep (assoc name (da-intra-label-sep))))
261 ;; gentext-label-title-sep returns the seperator to be inserted
262 ;; between a label and the text following the label for the
263 ;; specified element. Most of these are for use between
264 ;; enumerated labels and titles like "1. Chapter One Title", but
265 ;; this function is used elsewhere (e.g. NOTE) with a little
269 (define (local-da-label-title-sep)
272 (define (da-label-title-sep)
274 (list (normalize "abstract") ": ")
275 (list (normalize "answer") " ")
276 (list (normalize "appendix") ". ")
277 (list (normalize "caution") "")
278 (list (normalize "chapter") ". ")
279 (list (normalize "equation") ". ")
280 (list (normalize "example") ". ")
281 (list (normalize "figure") ". ")
282 (list (normalize "footnote") ". ")
283 (list (normalize "glosssee") ": ")
284 (list (normalize "glossseealso") ": ")
285 (list (normalize "important") ": ")
286 (list (normalize "note") ": ")
287 (list (normalize "orderedlist") ". ")
288 (list (normalize "part") ". ")
289 (list (normalize "procedure") ". ")
290 (list (normalize "prefix") ". ")
291 (list (normalize "question") " ")
292 (list (normalize "refentry") "")
293 (list (normalize "reference") ". ")
294 (list (normalize "refsect1") ". ")
295 (list (normalize "refsect2") ". ")
296 (list (normalize "refsect3") ". ")
297 (list (normalize "sect1") ". ")
298 (list (normalize "sect2") ". ")
299 (list (normalize "sect3") ". ")
300 (list (normalize "sect4") ". ")
301 (list (normalize "sect5") ". ")
302 (list (normalize "section") ". ")
303 (list (normalize "simplesect") ". ")
304 (list (normalize "seeie") " ")
305 (list (normalize "seealsoie") " ")
306 (list (normalize "step") ". ")
307 (list (normalize "table") ". ")
308 (list (normalize "tip") ": ")
309 (list (normalize "warning") "")
312 (define (gentext-da-label-title-sep gind)
313 (let* ((giname (if (string? gind) gind (gi gind)))
314 (name (normalize giname))
315 (lsep (assoc name (local-da-label-title-sep)))
316 (sep (assoc name (da-label-title-sep))))
323 (define (da-label-number-format-list)
325 (list (normalize "set") "1")
326 (list (normalize "book") "1")
327 (list (normalize "prefix") "1")
328 (list (normalize "part") "I")
329 (list (normalize "chapter") "1")
330 (list (normalize "appendix") "A")
331 (list (normalize "reference") "I")
332 (list (normalize "example") "1")
333 (list (normalize "figure") "1")
334 (list (normalize "table") "1")
335 (list (normalize "procedure") "1")
336 (list (normalize "step") "1")
337 (list (normalize "refsect1") "1")
338 (list (normalize "refsect2") "1")
339 (list (normalize "refsect3") "1")
340 (list (normalize "sect1") "1")
341 (list (normalize "sect2") "1")
342 (list (normalize "sect3") "1")
343 (list (normalize "sect4") "1")
344 (list (normalize "sect5") "1")
345 (list (normalize "section") "1")
348 (define (da-label-number-format gind)
349 (let* ((giname (if (string? gind) gind (gi gind)))
350 (name (normalize giname))
351 (format (assoc name (da-label-number-format-list))))
356 (define (da-lot-title)
358 (list (normalize "table") "&ListofTables;")
359 (list (normalize "example") "&ListofExamples;")
360 (list (normalize "figure") "&ListofFigures;")
361 (list (normalize "equation") "&ListofEquations;")
364 (define ($lot-title-da$ gind)
365 (let* ((giname (if (string? gind) gind (gi gind)))
366 (name (normalize giname))
367 (title (assoc name (da-lot-title))))
370 (let* ((msg (string-append "&ListofUnknown;: " name))
371 (err (node-list-error msg (current-node))))
374 (define %gentext-da-start-quote% (dingbat "ldquo"))
376 (define %gentext-da-end-quote% (dingbat "rdquo"))
378 (define %gentext-da-start-nested-quote% (dingbat "lsquo"))
380 (define %gentext-da-end-nested-quote% (dingbat "rsquo"))
382 (define %gentext-da-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous
383 ;; Authored "by" Jane Doe
385 (define %gentext-da-edited-by% "&Editedby;")
386 ;; "Edited by" Jane Doe
388 (define %gentext-da-revised-by% "&Revisedby;")
389 ;; "Revised by" Jane Doe
391 (define %gentext-da-page% "")
393 (define %gentext-da-and% "∧")
395 (define %gentext-da-listcomma% "&listcomma;")
397 (define %gentext-da-lastlistcomma% "&lastlistcomma;")
399 (define %gentext-da-bibl-pages% "&Pgs;")
401 (define %gentext-da-endnotes% "&Notes;")
403 (define %gentext-da-table-endnotes% "&TableNotes;:")
405 (define %gentext-da-index-see% "&See;")
407 (define %gentext-da-index-seealso% "&SeeAlso;")
410 (define (gentext-da-nav-prev prev)
411 (make sequence (literal "&nav-prev;")))
413 (define (gentext-da-nav-prev-sibling prevsib)
414 (make sequence (literal "&nav-prev-sibling;")))
416 (define (gentext-da-nav-next-sibling nextsib)
417 (make sequence (literal "&nav-next-sibling;")))
419 (define (gentext-da-nav-next next)
420 (make sequence (literal "&nav-next;")))
422 (define (gentext-da-nav-up up)
423 (make sequence (literal "&nav-up;")))
425 (define (gentext-da-nav-home home)
426 (make sequence (literal "&nav-home;")))
430 </style-specification-body>
431 </style-specification>