/usr/share/sgml/docbook/stylesheet/dsssl/modular/html/dblists.dsl is in docbook-dsssl 1.79-6ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | ;; $Id: dblists.dsl,v 1.6 2003/04/05 21:39:15 adicarlo Exp $
;;
;; This file is part of the Modular DocBook Stylesheet distribution.
;; See ../README or http://docbook.sourceforge.net/projects/dsssl/
;;
;; =============================== LISTS ================================
(element orderedlist
(let* ((depth (length (hierarchical-number-recursive
(normalize "orderedlist"))))
(numeration (attribute-string (normalize "numeration")))
(firstitem (node-list-first
(select-elements (children (current-node))
(normalize "listitem"))))
(start (orderedlist-listitem-number firstitem))
(rawnum (cond
((equal? numeration (normalize "arabic")) 0)
((equal? numeration (normalize "loweralpha")) 1)
((equal? numeration (normalize "lowerroman")) 2)
((equal? numeration (normalize "upperalpha")) 3)
((equal? numeration (normalize "upperroman")) 4)
(else (modulo depth 5))))
(type (case rawnum
((0) "1")
((1) "a")
((2) "i")
((3) "A")
((4) "I"))))
(make sequence
(if %spacing-paras%
(make element gi: "P" (empty-sosofo))
(empty-sosofo))
(para-check)
(process-node-list (select-elements (children (current-node))
(normalize "title")))
(make element gi: "OL"
attributes: (append
(if (equal? start 1)
'()
(list (list "START" (number->string start))))
(if (equal? (attribute-string (normalize "spacing"))
(normalize "compact"))
'(("COMPACT" "COMPACT"))
'())
(list (list "TYPE" type)))
(process-node-list (select-elements (children (current-node))
(normalize "listitem"))))
(para-check 'restart))))
(element (orderedlist title)
(make element gi: "P"
(make element gi: "B"
(process-children))))
(element itemizedlist
(make sequence
(if %spacing-paras%
(make element gi: "P" (empty-sosofo))
(empty-sosofo))
(para-check)
(process-node-list (select-elements (children (current-node))
(normalize "title")))
(make element gi: "UL"
attributes: (if (equal? (attribute-string (normalize "spacing")) (normalize "compact"))
'(("COMPACT" "COMPACT"))
'())
(process-node-list (select-elements (children (current-node))
(normalize "listitem"))))
(para-check 'restart)))
(element listitem
(let* ((override (inherited-attribute-string (normalize "override")))
(mark (inherited-attribute-string (normalize "mark")))
(usemark (if override override mark))
(cssmark (if (and usemark (assoc usemark %css-liststyle-alist%))
(car (cdr (assoc usemark %css-liststyle-alist%)))
usemark))
(cssstyle (if (and %css-decoration% cssmark)
(list (list "STYLE"
(string-append "list-style-type: "
cssmark)))
'())))
(make element gi: "LI"
attributes: cssstyle
(if (attribute-string (normalize "id"))
(make element gi: "A"
attributes: (list
(list "NAME" (attribute-string (normalize "id"))))
(empty-sosofo))
(empty-sosofo))
(process-children))))
(element (orderedlist listitem simpara)
(let* ((spacing (inherited-attribute-string (normalize "spacing")))
(listitem (parent (current-node)))
(lichildren (node-list-filter-out-pis
(children listitem)))
(childcount (node-list-length lichildren)))
(if (and (equal? spacing (normalize "compact"))
(equal? childcount 1))
($paragraph$ "SPAN")
(next-match))))
(element (itemizedlist listitem simpara)
(let* ((spacing (inherited-attribute-string (normalize "spacing")))
(listitem (parent (current-node)))
(lichildren (node-list-filter-out-pis
(children listitem)))
(childcount (node-list-length lichildren)))
(if (and (equal? spacing (normalize "compact"))
(equal? childcount 1))
($paragraph$ "SPAN")
(next-match))))
(element variablelist
(let* ((termlength (if (attribute-string (normalize "termlength"))
(string->number
(attribute-string (normalize "termlength")))
%default-variablelist-termlength%))
(too-long? (variablelist-term-too-long? termlength)))
(make sequence
(if %spacing-paras%
(make element gi: "P" (empty-sosofo))
(empty-sosofo))
(para-check)
(if (and (or (and termlength (not too-long?))
%always-format-variablelist-as-table%)
(or %may-format-variablelist-as-table%
%always-format-variablelist-as-table%))
(make element gi: "TABLE"
attributes: '(("CLASS" "VARIABLELIST")
("BORDER" "0")
("CELLSPACING" "1")
("CELLPADDING" "1"))
(if %html40%
(make element gi: "TBODY"
(with-mode variablelist-table
(process-children)))
(with-mode variablelist-table
(process-children))))
(make sequence
(make element gi: "DIV"
attributes: (list (list "CLASS" (gi)))
(process-node-list
(select-elements (children (current-node))
(normalize "title")))
(make element gi: "DL"
(process-node-list
(select-elements (children (current-node))
(normalize "varlistentry")))))))
(para-check 'restart))))
(element varlistentry
(let ((terms (select-elements (children (current-node)) (normalize "term")))
(listitem (select-elements (children (current-node)) (normalize "listitem"))))
(make sequence
(make element gi: "DT"
(if (attribute-string (normalize "id"))
(make sequence
(make element gi: "A"
attributes: (list
(list "NAME" (attribute-string (normalize "id"))))
(empty-sosofo))
(process-node-list terms))
(process-node-list terms)))
(process-node-list listitem))))
(element (varlistentry term)
(make sequence
(process-children-trim)
(if (not (last-sibling?))
(literal ", ")
(literal ""))))
(element (varlistentry listitem)
(make element gi: "DD"
(process-children)))
(mode variablelist-table
(element (variablelist title)
(make element gi: "TR"
attributes: '(("CLASS" "TITLE"))
(make element gi: "TH"
attributes: '(("ALIGN" "LEFT")
("VALIGN" "TOP")
("COLSPAN" "3"))
(process-children))))
(element varlistentry
(let* ((terms (select-elements (children (current-node))
(normalize "term")))
(listitem (select-elements (children (current-node))
(normalize "listitem")))
(termlen (if (attribute-string (normalize "termlength")
(parent (current-node)))
(string->number (attribute-string
(normalize "termlength")
(parent (current-node))))
%default-variablelist-termlength%))
(too-long? (varlistentry-term-too-long? (current-node) termlen)))
(if too-long?
(make sequence
(make element gi: "TR"
(make element gi: "TD"
attributes: '(("ALIGN" "LEFT")
("VALIGN" "TOP")
("COLSPAN" "3"))
(make element gi: "A"
attributes: (list
(list "NAME" (element-id)))
(empty-sosofo))
(process-node-list terms)))
(make element gi: "TR"
(make element gi: "TD"
attributes: '(("ALIGN" "LEFT")
("VALIGN" "TOP")
("WIDTH" "5"))
;; where terms would have gone
(make entity-ref name: "nbsp"))
(make element gi: "TD"
attributes: '(("ALIGN" "LEFT")
("VALIGN" "TOP")
("WIDTH" "5"))
;; just a little spacer
(make entity-ref name: "nbsp"))
(make element gi: "TD"
attributes: '(("ALIGN" "LEFT")
("VALIGN" "TOP"))
(process-node-list listitem))))
(make element gi: "TR"
(make element gi: "TD"
attributes: '(("ALIGN" "LEFT")
("VALIGN" "TOP"))
(make element gi: "A"
attributes: (list
(list "NAME" (element-id)))
(empty-sosofo))
(process-node-list terms))
(make element gi: "TD"
attributes: '(("ALIGN" "LEFT")
("VALIGN" "TOP")
("WIDTH" "5"))
;; just a little spacer
(make entity-ref name: "nbsp"))
(make element gi: "TD"
attributes: '(("ALIGN" "LEFT")
("VALIGN" "TOP"))
(process-node-list listitem))))))
(element (varlistentry term)
(make sequence
(if %css-decoration%
(make element gi: "SPAN"
attributes: '(("STYLE" "white-space: nowrap"))
(process-children-trim))
(make element gi: "NOBR"
(process-children-trim)))
(if (not (last-sibling?))
(literal ", ")
(literal ""))))
(element (varlistentry listitem)
(process-children))
)
(define (simplelist-table majororder cols members)
(let* ((termcount (node-list-length members))
(rows (quotient (+ termcount (- cols 1)) cols))
(htmlrows (let rowloop ((rownum 1))
(if (> rownum rows)
(empty-sosofo)
(make sequence
(simplelist-row rownum majororder
rows cols members)
(rowloop (+ rownum 1)))))))
(make sequence
(if %spacing-paras%
(make element gi: "P" (empty-sosofo))
(empty-sosofo))
(make element gi: "TABLE"
attributes: '(("BORDER" "0"))
(if %html40%
(make element gi: "TBODY"
htmlrows)
htmlrows))
(if %spacing-paras%
(make element gi: "P" (empty-sosofo))
(empty-sosofo)))))
(define (simplelist-row rownum majororder rows cols members)
(make element gi: "TR"
(let colloop ((colnum 1))
(if (> colnum cols)
(empty-sosofo)
(make sequence
(simplelist-entry rownum colnum majororder rows cols members)
(colloop (+ colnum 1)))))))
(define (simplelist-entry rownum colnum majororder rows cols members)
(let ((membernum (if (equal? majororder 'row)
(+ (* (- rownum 1) cols) colnum)
(+ (* (- colnum 1) rows) rownum)))
(attlist (if %simplelist-column-width%
(list (list "WIDTH" %simplelist-column-width%))
'())))
(let loop ((nl members) (count membernum))
(if (<= count 1)
(make element gi: "TD"
attributes: attlist
(if (node-list-empty? nl)
(make entity-ref name: "nbsp")
(process-node-list (node-list-first nl))))
(loop (node-list-rest nl) (- count 1))))))
(element simplelist
(let ((type (attribute-string "type"))
(cols (if (attribute-string "columns")
(if (> (string->number (attribute-string "columns")) 0)
(string->number (attribute-string "columns"))
1)
1))
(members (select-elements (children (current-node)) (normalize "member"))))
(cond
((equal? type (normalize "inline"))
(process-children))
((equal? type (normalize "vert"))
(simplelist-table 'column cols members))
((equal? type (normalize "horiz"))
(simplelist-table 'row cols members)))))
(element member
(let ((type (inherited-attribute-string (normalize "type"))))
(if (equal? type (normalize "inline"))
(make sequence
(process-children-trim)
(if (not (last-sibling?))
(literal ", ")
(literal "")))
(process-children))))
(element segmentedlist (process-children))
(element (segmentedlist title) ($lowtitle$ 6))
(element segtitle (empty-sosofo))
(mode seglist-in-seg
(element segtitle
(process-children)))
(element seglistitem (process-children))
(element seg
(let* ((seg-num (child-number (current-node)))
(seglist (parent (parent (current-node))))
(segtitle (nth-node (select-elements
(descendants seglist) (normalize "segtitle")) seg-num)))
;; Note: segtitle is only going to be the right thing in a well formed
;; SegmentedList. If there are too many Segs or too few SegTitles,
;; you'll get something odd...maybe an error
(with-mode seglist-in-seg
(make element gi: "P"
(make element gi: "B"
(sosofo-append (process-node-list segtitle))
(literal ": "))
(process-children)))))
(element calloutlist
(let* ((nsep (gentext-label-title-sep (gi)))
(id (attribute-string (normalize "id")))
(titlesosofo (make sequence
(literal (gentext-element-name (gi)))
(if (string=? (element-label) "")
(literal nsep)
(literal " " (element-label) nsep))
(element-title-sosofo))))
(make element gi: "DIV"
attributes: (list
(list "CLASS" (gi)))
(if (node-list-empty?
(select-elements (children (current-node)) (normalize "title")))
(empty-sosofo)
(make element gi: "P"
(make element gi: "B"
(if id
(make sequence
(make element gi: "A"
attributes: (list (list "NAME" id))
(empty-sosofo))
titlesosofo)
titlesosofo))))
(make element gi: "DL"
attributes: '(("COMPACT" "COMPACT"))
(process-children)))))
(element (calloutlist title) (empty-sosofo))
(element callout
(process-children))
(element (calloutlist callout)
(process-children))
(element (calloutlist callout para)
(let ((footnotes (select-elements (descendants (current-node))
(normalize "footnote"))))
(make sequence
(if (= (child-number) 1)
(let* ((ilevel (length (hierarchical-number-recursive
(normalize "calloutlist"))))
(arearefs (inherited-attribute-string (normalize "arearefs")))
(idlist (split arearefs)))
(make sequence
(make element gi: "DT"
(let loop ((ids idlist))
(if (null? ids)
(empty-sosofo)
(make sequence
($callout-mark$ (element-with-id (car ids)) #f)
(loop (cdr ids))))))
(make element gi: "DD"
(process-children))))
(make element gi: "DD"
(make element gi: "P"
(process-children))))
(if (or %footnotes-at-end% (node-list-empty? footnotes))
(empty-sosofo)
(make element gi: "BLOCKQUOTE"
attributes: (list
(list "CLASS" "FOOTNOTES"))
(with-mode footnote-mode
(process-node-list footnotes)))))))
|