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 (52 lines) | stat: -rw-r--r-- 1,530 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
;; $Id: dbtitle.dsl,v 1.4 1999/04/13 12:56:54 nwalsh Exp $
;;
;; This file is part of the Modular DocBook Stylesheet distribution.
;; See ../README or http://www.berkshire.net/~norm/dsssl/
;;

(define title-style
  (style
   font-family-name: %title-font-family%
   font-weight: 'bold
   quadding: 'start))

;; So we can pass different sosofo's to this routine and get identical
;; treatment (see REFNAME in dbrfntry.dsl)
;;
(define ($lowtitlewithsosofo$ tlevel sosofo)
  (let ((hs (HSIZE (- 3 tlevel))))
    (make paragraph
	  font-family-name: %title-font-family%
	  font-weight: 'bold
	  font-size: hs
	  line-spacing: (* hs %line-spacing-factor%)
	  space-before: (* hs %head-before-factor%)
	  space-after: (* hs %head-after-factor%)
	  start-indent: %body-start-indent%
	  quadding: 'start
	  keep-with-next?: #t
	  heading-level: (if %generate-heading-level% (+ tlevel 2) 0)
	  sosofo)))

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

(define ($runinhead$)
  (let* ((title    (data (current-node)))
	 (titlelen (string-length title))
	 (lastchar (string-ref title (- titlelen 1)))
	 (punct    (if (member lastchar %content-title-end-punct%)
		       ""
		       %default-title-end-punct%)))
    (make sequence
      font-weight: 'bold
      (process-children)
      (literal punct " "))))

(element title ($lowtitle$ 2))         ;; the default TITLE format
(element titleabbrev (empty-sosofo))
(element subtitle (empty-sosofo))

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