1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
;; -*- Scheme -*-
;;
;; $Id: html-locale.dsl.in,v 1.1 2002/01/06 15:42:27 hholzgra Exp $
;;
;; This file contains stylesheet customization for locale specific
;; preferences in HTML version.
;;
(define ($component-title$ #!optional (titlegi "H1") (subtitlegi "H2"))
(let* ((info (cond
((equal? (gi) (normalize "appendix"))
(select-elements (children (current-node)) (normalize "docinfo")))
((equal? (gi) (normalize "article"))
(select-elements (children (current-node)) (normalize "artheader")))
((equal? (gi) (normalize "bibliography"))
(select-elements (children (current-node)) (normalize "docinfo")))
((equal? (gi) (normalize "chapter"))
(select-elements (children (current-node)) (normalize "docinfo")))
((equal? (gi) (normalize "dedication"))
(empty-node-list))
((equal? (gi) (normalize "glossary"))
(select-elements (children (current-node)) (normalize "docinfo")))
((equal? (gi) (normalize "index"))
(select-elements (children (current-node)) (normalize "docinfo")))
((equal? (gi) (normalize "preface"))
(select-elements (children (current-node)) (normalize "docinfo")))
((equal? (gi) (normalize "reference"))
(select-elements (children (current-node)) (normalize "docinfo")))
((equal? (gi) (normalize "setindex"))
(select-elements (children (current-node)) (normalize "docinfo")))
(else
(empty-node-list))))
(exp-children (if (node-list-empty? info)
(empty-node-list)
(expand-children (children info)
(list (normalize "bookbiblio")
(normalize "bibliomisc")
(normalize "biblioset")))))
(parent-titles (select-elements (children (current-node)) (normalize "title")))
(info-titles (select-elements exp-children (normalize "title")))
(titles (if (node-list-empty? parent-titles)
info-titles
parent-titles))
(subtitles (select-elements exp-children (normalize "subtitle"))))
(make sequence
(make element gi: titlegi
(make element gi: "A"
attributes: (list (list "NAME" (element-id)))
(if (and %chapter-autolabel%
(or (equal? (gi) (normalize "chapter"))
(equal? (gi) (normalize "appendix"))))
(if %prefers-ordinal-label-name-format%
(literal (element-label (current-node)) ". "
(gentext-element-name (gi))
(gentext-label-title-sep (gi)))
(literal (gentext-element-name-space (gi))
(element-label (current-node))
(gentext-label-title-sep (gi))))
(empty-sosofo))
(if (node-list-empty? titles)
(element-title-sosofo) ;; get a default!
(with-mode title-mode
(process-node-list titles)))))
(if (node-list-empty? subtitles)
(empty-sosofo)
(with-mode subtitle-mode
(make element gi: subtitlegi
(process-node-list subtitles)))))))
(define (nav-context-sosofo elemnode)
(let* ((component (ancestor-member elemnode
(append (book-element-list)
(division-element-list)
(component-element-list))))
(context-text (inherited-dbhtml-value elemnode "context-text")))
(if (and context-text (not (string=? context-text "")))
(literal context-text)
(if (equal? (element-label component) "")
(make sequence
(element-title-sosofo component))
(make sequence
;; Special case. This is a bit of a hack.
;; I need to revisit this aspect of
;; appendixes.
(if (and (equal? (gi component) (normalize "appendix"))
(or (equal? (gi elemnode) (normalize "sect1"))
(equal? (gi elemnode) (normalize "section")))
(equal? (gi (parent component)) (normalize "article")))
(empty-sosofo)
(if %prefers-ordinal-label-name-format%
(make sequence
(element-label-sosofo component)
(literal ". " (gentext-element-name (gi component))))
(make sequence
(literal (gentext-element-name-space (gi component)))
(element-label-sosofo component))))
(literal (gentext-label-title-sep (gi component)))
(element-title-sosofo component))))))
(define %html-header-tags%
'(("META" ("HTTP-EQUIV" "Content-type") ("CONTENT" "text/html; charset=@ENCODING@"))))
|