File: dbtitle.dsl

package info (click to toggle)
docbook-stylesheets 1.49-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 7,576 kB
  • ctags: 33
  • sloc: perl: 444; xml: 115; makefile: 98; sh: 27
file content (67 lines) | stat: -rw-r--r-- 1,668 bytes parent folder | download
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
;; $Id: dbtitle.dsl,v 1.6 1999/07/02 17:28:29 nwalsh Exp $
;;
;; This file is part of the Modular DocBook Stylesheet distribution.
;; See ../README or http://www.berkshire.net/~norm/dsssl/
;;

;; So we can pass different sosofo's to this routine and get identical
;; treatment (see REFNAME in dbrfntry.dsl)
;;
(define ($lowtitlewithsosofo$ tlevel sosofo)
  (let ((tgi (cond
	      ((equal? tlevel 1) "H1")
	      ((equal? tlevel 2) "H2")
	      ((equal? tlevel 3) "H3")
	      ((equal? tlevel 4) "H4")
	      ((equal? tlevel 5) "H5")
	      (else "P"))))
    (if (< tlevel 6)
	(make element gi: tgi
	      sosofo)
	(make element gi: "P"
	      (make element gi: "B"
		    sosofo)))))

(define ($lowtitle$ tlevel)
  ($lowtitlewithsosofo$ tlevel (process-children)))

(define ($runinhead$)
  (let* ((title    (data (current-node)))
	 (titlelen (string-length title))
	 (lastchar (if (> titlelen 0)
		       (string-ref title (- titlelen 1))
		       "."))
	 (punct    (if (or (= titlelen 0) 
			   (member lastchar %content-title-end-punct%))
		       ""
		       %default-title-end-punct%)))
    (make element gi: "B"
	  (process-children)
	  (literal punct " "))))

(element title 
  (make element gi: "P"
	(make element gi: "B"
	      (process-children-trim))))

(element titleabbrev (empty-sosofo))

(mode title-mode
  (element title
    (process-children)))

(mode subtitle-mode
  (element subtitle
    (make sequence
      (literal (if (first-sibling?)
		   ""
		   "; "))
      (process-children))))

(mode head-title-mode
  ;; TITLE in an HTML HEAD
  (default
    (process-children))

  (element graphic (empty-sosofo))
  (element inlinegraphic (empty-sosofo)))