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
|
;; -*- Scheme -*-
;;
;; $Id: common.dsl.in,v 1.3 2002/02/04 16:46:23 hholzgra Exp $
;;
;; This file contains stylesheet customization common to the HTML
;; and print versions.
;;
;; Stylesheets Localization
(define %default-language% "@LANG@")
(define %root-filename% "index")
(define %use-id-as-filename% #t)
(define %gentext-nav-tblwidth% "100%")
(define %refentry-function% #t)
(define %refentry-generate-name% #f)
(define %funcsynopsis-style% 'ansi)
(define ($legalnotice-link-file$ legalnotice)
(string-append "copyright" %html-ext%))
(define %generate-legalnotice-link% #t)
(define %footnotes-at-end% #t)
(define %force-chapter-toc% #t)
(define newline "\U-000D")
(define %number-programlisting-lines% #f)
(define %linenumber-mod% 1)
(define %shade-verbatim% #t)
(define %prefers-ordinal-label-name-format% @NUMBER_FIRST@)
(define ($generate-book-lot-list$) (list))
(define %gentext-ja-edited-by% "Edited by")
(define (php-code code)
(make processing-instruction
data: (string-append "php " code "?")))
(define quicksort
(quicksort::generic null? car cdr append cons '()))
(define nl-quicksort
(quicksort::generic node-list-empty?
node-list-first
node-list-rest
node-list
node-list
(empty-node-list)))
(define quicksort::generic
(lambda(is-null? first others concat add empty)
(letrec ((collect
;; Collect is an helper function doing the real work
(lambda (pivot ls lgroup rgroup less?)
(if (is-null? ls)
(concat (impl lgroup less?)
(add pivot (impl rgroup less?)))
(if (less? pivot (first ls))
(collect pivot (others ls) lgroup
(add (first ls) rgroup)
less?)
(collect pivot (others ls)
(add (first ls) lgroup)
rgroup
less?)))))
(impl
;; impl first test some trivial sorting case and then call
;; the procedure collect
(lambda (ls less?)
(if (or (is-null? ls) (is-null? (others ls)))
ls
(collect (first ls) (others ls) empty empty less?)))))
;; we return the new defined procedure
impl)))
;; definition for japanese
(define ja-chapter-name "\U-7B2C;")
(define ja-sect1-name "\U-7B2C;")
(define ja-sect2-name "\U-7B2C;")
(define ja-section-name "\U-7B2C;")
(define ja-figure-name "Figure ")
(define ja-refsynopsisdiv-name "Synopsis")
(define (ja-label-title-sep)
(list
(list (normalize "chapter") " \U-7AE0; ")
(list (normalize "sect1") ". ")
(list (normalize "sect2") ". ")
(list (normalize "section") ". ")
))
(define (gentext-ja-label-title-sep gind)
(let* ((giname (if (string? gind) gind (gi gind)))
(name (normalize giname))
(sep (assoc name (ja-label-title-sep))))
(if sep
(car (cdr sep))
"")))
;; Polish definitions
(define (gentext-pl-nav-next next)
(make sequence (literal "Nast\U-0119;pny")))
(define (book-titlepage-recto-elements)
(list (normalize "title")
(normalize "subtitle")
(normalize "graphic")
(normalize "mediaobject")
(normalize "corpauthor")
(normalize "authorgroup")
(normalize "author")
(normalize "editor")
(normalize "pubdate")
(normalize "copyright")
(normalize "abstract")
(normalize "legalnotice")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; render function prototypes, esp. with optional arguments
;;;; for new docbook4 methodsynopsis tag and friends
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; helper function generating closing optional brackets
(define (methodsynopsis-generate-closing-optionals nl)
(if (node-list-empty? nl)
(empty-sosofo) ;; empty list -> do nothing
(make sequence ;; process list node
(if (attribute-string (normalize "choice") (node-list-first nl))
(if (string=? "opt" (attribute-string (normalize "choice") (node-list-first nl)))
(literal %arg-choice-opt-close-str%) ;; is optional parameter -> close a bracket
(empty-sosofo)
)
(empty-sosofo)
)
(methodsynopsis-generate-closing-optionals (node-list-rest nl)) ;; process rest of list
)
)
)
;; render methodsynopsis
(element methodsynopsis
(make sequence
(process-children) ;; render content
(methodsynopsis-generate-closing-optionals (children (current-node))) ;; close optional brackets
(literal ")") ;; close parameter list
)
)
;; render return type
(element (methodsynopsis type)
(make sequence
(process-children-trim)
(literal " ")
)
)
;; render function name
(element (methodsynopsis methodname)
(make sequence
($bold-seq$
(process-children-trim)
)
(literal " ( ") ;; start parameter list
)
)
;; render parameters
(element (methodsynopsis methodparam)
(make sequence
;; special case -> first parameter is optional
(if (equal? (gi (ipreced (current-node))) (normalize "methodparam"))
(empty-sosofo) ;; have prev. parameters -> is not first
(if (equal? (attribute-string (normalize "choice")) "opt")
(literal %arg-choice-opt-open-str%) ;; generate opening bracket
(empty-sosofo)
)
)
(process-children-trim)
;; have more parameters following me?
(if (equal? (gi (ifollow (current-node))) (normalize "methodparam"))
(make sequence
;; is next parameter optional?
(if (equal? (attribute-string (normalize "choice") (ifollow (current-node))) "opt")
(make sequence
(literal " ")
(literal %arg-choice-opt-open-str%)
)
(empty-sosofo)
)
;; parameter list separator
(literal ", ")
)
(empty-sosofo)
)
)
)
(element (methodsynopsis void)
(literal "void")
)
;; render parameter type
(element (methodparam type)
(make sequence
(process-children-trim)
(literal " ")
)
)
;; render parameter name
(element (methodparam parameter)
(make sequence
(process-children-trim)
)
)
|