-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHP-HOWTO.dsl
402 lines (332 loc) · 11.4 KB
/
HP-HOWTO.dsl
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
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!-- Cas HTML -->
<!ENTITY html-ss
PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN"
CDATA DSSSL>
<!-- Cas PS -->
<!ENTITY print-ss
PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN"
CDATA DSSSL>
]>
<style-sheet>
<!-- Pour le HTML -->
<style-specification id="html" use="html-stylesheet">
<style-specification-body>
;; Courtoisement du projet de documentation FreeBSD
;; Use tables to build the navigation headers and footers?
(define %gentext-nav-use-tables% #t)
;; Default extension for HTML output files
(define %html-ext% ".html")
;; Name for the root HTML document
(define %root-filename% "index")
;; Should verbatim environments be shaded?
(define %shade-verbatim% #t)
;; Write a manifest?
(define html-manifest #t)
;; Are sections enumerated?
(define %section-autolabel% #t)
;; Use graphics in admonitions?
(define %admon-graphics% #t)
;; Path to admonition graphics
(define %admon-graphics-path% "images/")
;; l'extension par défaut en mode HTML
(define %graphic-default-extension% "png")
;; From ldp.dsl
;; Should a Table of Contents be produced for parts?
(define %generate-part-toc% #t)
;; Use ID attributes as name for component HTML files? (Greg Ferguson)
(define %use-id-as-filename% #t)
(define (list-element-list)
;; fixes bug in Table of Contents generation
'())
(element emphasis
;; make role=strong equate to bold for emphasis tag
(if (equal? (attribute-string "role") "strong")
(make element gi: "STRONG" (process-children))
(make element gi: "EM" (process-children))))
;; Custom headers
(define %html-header-tags%
'(("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; charset=iso-8859-1")) ("META" ("NAME" "Author") ("CONTENT" "Bruno Cornec")) ("META" ("NAME" "KeyWords") ("CONTENT" "Linux,HP,HP-UX,Hewlett,Packard")))
)
;; ---------------------
;; Navigation Icons
;; ---------------------
;;
;; Redefine links as graphic icons instead of text
;;
;; (Overrides definitions in common/dbl1en.dsl)
;;
(define (gentext-en-nav-prev prev)
(make empty-element gi: "IMG"
attributes: '(("SRC" "../images/prev.png")
("BORDER" "0")
("ALT" "[EN:Previous:EN][FR:Précédent:FR]"))))
(define (gentext-en-nav-next next)
(make empty-element gi: "IMG"
attributes: '(("SRC" "../images/next.png")
("BORDER" "0")
("ALT" "[EN:Next:EN][FR:Suivant:FR]"))))
(define (gentext-en-nav-up up)
(make empty-element gi: "IMG"
attributes: '(("SRC" "../images/up.png")
("BORDER" "0")
("ALT" "[EN:Up:EN][FR:Haut:FR]"))))
(define (gentext-en-nav-home home)
(make empty-element gi: "IMG"
attributes: '(("SRC" "../images/home.png")
("BORDER" "0")
("ALT" "[EN:Home:EN][FR:Accueil:FR]"))))
;;
;;
;;=================================================================
;; End of navigation icons section
;;=================================================================
;;=================================================================
;; NAVIGATION HEADER TABLES
;;=================================================================
;;
;;
;; Rearrange navigation header to put bigger jumps at outside edge
;;
;; (Overrides stuff defined in html/dbnavig.dsl)
;;
;;
;;=================================================================
;;=================================================================
;;
;;
(define (default-header-nav-tbl-ff elemnode prev next prevsib nextsib)
(let* ((r1? (nav-banner? elemnode))
(r1-sosofo (make element gi: "TR"
(make element gi: "TH"
attributes: (list
(list "COLSPAN" "5")
(list "ALIGN" "center")
(list "VALIGN" "bottom"))
(nav-banner elemnode))))
(r2? (or (not (node-list-empty? prev))
(not (node-list-empty? next))
(not (node-list-empty? prevsib))
(not (node-list-empty? nextsib))
(nav-context? elemnode)))
(r2-sosofo (make element gi: "TR"
;; constructs Fast-Backward link
(make element gi: "TD"
attributes: (list
(list "WIDTH" "10%")
(list "ALIGN" "left")
(list "VALIGN" "top"))
(if (node-list-empty? prevsib)
(make entity-ref name: "nbsp")
(make element gi: "A"
attributes: (list
(list "HREF"
(href-to
prevsib)))
(gentext-nav-prev-sibling prevsib))))
;; constructs Previous link
(make element gi: "TD"
attributes: (list
(list "WIDTH" "10%")
(list "ALIGN" "left")
(list "VALIGN" "top"))
(if (node-list-empty? prev)
(make entity-ref name: "nbsp")
(make element gi: "A"
attributes: (list
(list "HREF"
(href-to
prev)))
(gentext-nav-prev prev))))
;; center part: navigation context, title, etc.
(make element gi: "TD"
attributes: (list
(list "WIDTH" "60%")
(list "ALIGN" "center")
(list "VALIGN" "bottom"))
(nav-context elemnode))
;; constructs Next link
(make element gi: "TD"
attributes: (list
(list "WIDTH" "10%")
(list "ALIGN" "right")
(list "VALIGN" "top"))
(if (node-list-empty? next)
(make entity-ref name: "nbsp")
(make element gi: "A"
attributes: (list
(list "HREF"
(href-to
next)))
(gentext-nav-next next))))
;; constructs Fast-Forward link
(make element gi: "TD"
attributes: (list
(list "WIDTH" "10%")
(list "ALIGN" "right")
(list "VALIGN" "top"))
(if (node-list-empty? nextsib)
(make entity-ref name: "nbsp")
(make element gi: "A"
attributes: (list
(list "HREF"
(href-to
nextsib)))
(gentext-nav-next-sibling nextsib))))
)))
(if (or r1? r2?)
(make element gi: "DIV"
attributes: '(("CLASS" "NAVHEADER"))
(make element gi: "TABLE"
attributes: (list
(list "WIDTH" %gentext-nav-tblwidth%)
(list "BORDER" "0")
(list "CELLPADDING" "0")
(list "CELLSPACING" "0"))
(if r1? r1-sosofo (empty-sosofo))
(if r2? r2-sosofo (empty-sosofo)))
(make empty-element gi: "HR"
attributes: (list
(list "ALIGN" "LEFT")
(list "WIDTH" %gentext-nav-tblwidth%))))
(empty-sosofo))))
;;
;;
;;=================================================================
</style-specification-body>
</style-specification>
<!-- pour le PS -->
<style-specification id="print" use="print-stylesheet">
<style-specification-body>
;; Bookmark generation for PDF
(declare-characteristic heading-level
"UNREGISTERED::James Clark//Characteristic::heading-level" 2)
;;; To make URLs line wrap we use the TeX 'url' package.
;;; See also: jadetex.cfg
;; First we need to declare the 'formatting-instruction' flow class.
;; (declare-flow-object-class formatting-instruction
;; "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction")
;; Then redefine ulink to use it.
;; (element ulink
;; (make sequence
;; (if (node-list-empty? (children (current-node)))
;; ; ulink url="...", /ulink
;; (make formatting-instruction
;; data: (string-append "\\url{"
;; (attribute-string (normalize "url"))
;; "}"))
;; (if (equal? (attribute-string (normalize "url"))
;; (data-of (current-node)))
;; ; ulink url="http://...", http://..., /ulink
;; (make formatting-instruction data:
;; (string-append "\\url{"
;; (attribute-string (normalize "url"))
;; "}"))
;; ; ulink url="http://...", some text, /ulink
;; (make sequence
;; ($charseq$)
;; (literal " (")
;; (make formatting-instruction data:
;; (string-append "\\url{"
;; (attribute-string (normalize "url"))
;; "}"))
;; (literal ")"))))))
;;; And redefine filename to use it too.
;; (element filename
;; (make formatting-instruction
;; data: (string-append "\\path{" (data-of (current-node)) "}")))
;; Ne montre pas les liens
(define %show-ulinks% #f)
;; Are sections enumerated?
(define %section-autolabel% #t)
;; Use graphics in admonitions?
(define %admon-graphics% #t)
;; Path to admonition graphics
(define %admon-graphics-path% "images/")
(define ($admon-graphic$ #!optional (nd (current-node)))
(cond ((equal? (gi nd) (normalize "tip"))
(string-append %admon-graphics-path% "tip.eps"))
((equal? (gi nd) (normalize "note"))
(string-append %admon-graphics-path% "note.eps"))
((equal? (gi nd) (normalize "important"))
(string-append %admon-graphics-path% "important.eps"))
((equal? (gi nd) (normalize "caution"))
(string-append %admon-graphics-path% "caution.eps"))
((equal? (gi nd) (normalize "warning"))
(string-append %admon-graphics-path% "warning.eps"))
(else (error (string-append (gi nd) " is not an admonition.")))))
[FR:
;; Format de papier - uniquement pour le français.
(define %paper-type% "A4")
:FR]
[EN:
:EN]
;; Pas recto-verso
(define %two-side% #f)
;; liens Pour URLs ?
(define %footnote-ulinks% #t)
;; Make "bottom-of-page" footnotes?
(define bop-footnotes #t)
(define tex-backend #t)
;; Allow justification
(define %default-quadding% 'justify)
;; Allow automatic hyphenation?
(define %hyphenation% #t)
;; l'extension par défaut en mode print
(define %graphic-default-extension% "eps")
;; Courtoisement de Norman Walsh
(define (book-titlepage-recto-elements)
(list (normalize "title")
(normalize "subtitle")
(normalize "graphic")
(normalize "mediaobject")
(normalize "corpauthor")
(normalize "authorgroup")
(normalize "author")
(normalize "editor")
;;(normalize "copyright")
(normalize "printhistory") ;; add this...
;; (normalize "revhistory")
;;(normalize "abstract")
;;(normalize "releaseinfo")
(normalize "pubdate")
;;(normalize "legalnotice")
))
;; From ldp.dsl
(define %body-start-indent%
;; Default indent of body text
0pi)
(define %para-indent-firstpara%
;; First line start-indent for the first paragraph
0pt)
(define %para-indent%
;; First line start-indent for paragraphs (other than the first)
0pt)
(define %block-start-indent%
;; Extra start-indent for block-elements
0pt)
</style-specification-body>
</style-specification>
<!-- Pour le PDF -->
<style-specification id="pdf" use="print">
<style-specification-body>
;; l'extension par défaut en mode HTML
(define %graphic-default-extension% "png")
;; Pour PDF
(declare-characteristic heading-level
"UNREGISTERED::James Clark//Characteristic::heading-level" 2)
(define %generate-heading-level% #t)
</style-specification-body>
</style-specification>
<!-- Pour le TXT -->
<style-specification id="txt" use="html">
<style-specification-body>
;; Un seul morceau
(define nochunks #t)
;; pas de manifest
(define %html-manifest% #f)
</style-specification-body>
</style-specification>
<external-specification id="html-stylesheet" document="html-ss">
<external-specification id="print-stylesheet" document="print-ss">
</style-sheet>