TIVI-153: Add docbook-style-dssl as dep for iputils
[profile/ivi/docbook-style-dsssl.git] / html / dbrfntry.dsl
1 ;; $Id: dbrfntry.dsl,v 1.4 2003/01/15 08:24:13 adicarlo Exp $
2 ;;
3 ;; This file is part of the Modular DocBook Stylesheet distribution.
4 ;; See ../README or http://docbook.sourceforge.net/projects/dsssl/
5 ;;
6
7 ;; =========================== REFERENCE PAGES ==========================
8
9 ;;(element reference ($component$))
10
11 (element reference
12   (let* ((refinfo  (select-elements (children (current-node)) 
13                                     (normalize "docinfo")))
14          (refintro (select-elements (children (current-node)) 
15                                     (normalize "partintro")))
16          (nl       (titlepage-info-elements 
17                     (current-node)
18                     refinfo
19                     (if %generate-partintro-on-titlepage%
20                         refintro
21                         (empty-node-list)))))
22     (html-document 
23      (with-mode head-title-mode 
24        (literal (element-title-string (current-node))))
25      (make sequence
26        (make element gi: "DIV"
27              attributes: (list (list "CLASS" (gi)))
28
29              (make element gi: "A"
30                    attributes: (list (list "NAME" (element-id)))
31                    (empty-sosofo))
32
33              (if %generate-reference-titlepage%
34                  (make sequence
35                    (reference-titlepage nl 'recto)
36                    (reference-titlepage nl 'verso))
37                  (empty-sosofo))
38
39              (if (not (generate-toc-in-front))
40                  (process-children)
41                  (empty-sosofo))
42              
43              (if (and (not (node-list-empty? refintro))
44                       (not %generate-partintro-on-titlepage%))
45                  ($process-partintro$ refintro)
46                  (empty-sosofo))
47              
48              (if (and %generate-reference-toc%
49                       (not %generate-reference-toc-on-titlepage%))
50                  (make sequence
51                    (build-toc (current-node)
52                               (toc-depth (current-node))))
53                  (empty-sosofo))
54              
55              (if (generate-toc-in-front)
56                  (process-children)
57                  (empty-sosofo)))))))
58
59 ;; If each RefEntry begins on a new page, this title is going to wind
60 ;; up on its own page, too, so make it a divtitlepage instead.  Otherwise,
61 ;; just let it be a component title.
62 (element (reference title) 
63   (empty-sosofo))
64
65 (mode refentry-head-title-mode
66   (default (process-children))
67
68   (element refnamediv
69     (let* ((refdesc (select-elements (children (current-node)) 
70                                      (normalize "refdescriptor")))
71            (refname (select-elements (children (current-node)) 
72                                      (normalize "refname")))
73            (title   (if (node-list-empty? refdesc)
74                         (node-list-first refname)
75                         (node-list-first refdesc))))
76       (process-node-list title)))
77
78   (element refdescriptor
79     (process-children))
80
81   (element refname
82     (process-children))
83
84   (element graphic (empty-sosofo))
85   (element inlinegraphic (empty-sosofo)))
86
87 (define ($refentry-body$)
88   (let ((id (element-id (current-node))))
89     (make sequence 
90       (make element gi: "H1"
91             (make sequence
92               (make element gi: "A"
93                     attributes: (list (list "NAME" id))
94                     (empty-sosofo))
95               (element-title-sosofo (current-node))))
96       (process-children))))
97
98 (element refentry
99   (html-document (with-mode refentry-head-title-mode
100                    (literal (element-title-string (current-node))))
101                  ($refentry-body$)))
102
103 (element refmeta (empty-sosofo))
104
105 (element manvolnum 
106   ;; only called for xrefs and citerefentry
107   (if %refentry-xref-manvolnum%
108       (sosofo-append
109        (literal "(")
110        (process-children)
111        (literal ")"))
112       (empty-sosofo)))
113
114 (element refmiscinfo (empty-sosofo))
115
116 (element refentrytitle ($charseq$))
117
118 (element refnamediv ($block-container$))
119
120 (element refname
121   (make sequence
122     (if (and %refentry-generate-name% (first-sibling? (current-node)))
123         ($lowtitlewithsosofo$ 2 (literal (gentext-element-name 
124                                           (gi (current-node)))))
125         (empty-sosofo))
126     (make sequence
127           (process-children)
128           (if (last-sibling? (current-node))
129               (empty-sosofo)
130               (literal (gentext-intra-label-sep (gi (current-node))))))))
131
132 (element refpurpose
133   (make sequence
134     (make entity-ref name: "nbsp")
135     (literal (dingbat "em-dash"))
136     (make entity-ref name: "nbsp")
137     (process-children)))
138         
139 (element refdescriptor (empty-sosofo)) ;; TO DO: finish this
140
141 (element refclass
142   (let ((role (attribute-string (normalize "role"))))
143     (make element gi: "P"
144           (make element gi: "B"
145                 (literal
146                  (if role
147                      (string-append role ": ")
148                      "")))
149           (process-children-trim))))
150
151 (element refsynopsisdiv
152   (make element gi: "DIV"
153         attributes: (list (list "CLASS" (gi)))
154         (make element gi: "A"
155               attributes: (list (list "NAME" (element-id)))
156               (empty-sosofo))
157         (make element gi: "H2"
158               (element-title-sosofo (current-node)))
159         (process-children)))
160
161 (element (refsynopsisdiv title) (empty-sosofo))
162
163 (element refsect1 ($block-container$))
164 (element (refsect1 title) ($lowtitle$ 2))
165 (element refsect2 ($block-container$))
166 (element (refsect2 title) ($lowtitle$ 3))
167 (element refsect3 ($block-container$))
168 (element (refsect3 title) ($lowtitle$ 4))
169
170