source: trunk/mondo-doc/mondorescue-howto.dsl @ 824

Last change on this file since 824 was 326, checked in by bcornec, 13 years ago

Build process fo documentation

File size: 11.2 KB
Line 
1<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
2<!-- HTML -->
3<!ENTITY html-ss
4         PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN"
5         CDATA DSSSL>
6<!-- PS -->
7<!ENTITY print-ss
8        PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN"
9        CDATA DSSSL>
10]>
11
12<style-sheet>
13
14<!-- HTML -->
15<style-specification id="html" use="html-stylesheet">
16<style-specification-body>
17
18;; From documentation projet of FreeBSD
19
20;; Use tables to build the navigation headers and footers?
21(define %gentext-nav-use-tables% #t)
22
23;; Default extension for HTML output files
24(define %html-ext% ".html")
25
26;; Name for the root HTML document
27(define %root-filename% "index")
28
29;; Should verbatim environments be shaded?
30(define %shade-verbatim% #t)
31
32;; Write a manifest?
33(define html-manifest #t)
34
35;; Are sections enumerated?
36(define %section-autolabel% #t)
37
38;; Use graphics in admonitions?
39(define %admon-graphics% #t)
40
41;; Path to admonition graphics
42(define %admon-graphics-path% "images/")
43
44;; l'extension par défaut en mode HTML
45(define %graphic-default-extension% "png")
46
47;; From ldp.dsl
48;; Should a Table of Contents be produced for parts?
49(define %generate-part-toc% #t)
50
51;; Use ID attributes as name for component HTML files? (Greg Ferguson)
52(define %use-id-as-filename% #t)
53
54(define (list-element-list)
55  ;; fixes bug in Table of Contents generation
56  '())
57
58(element emphasis
59  ;; make role=strong equate to bold for emphasis tag
60  (if (equal? (attribute-string "role") "strong")
61     (make element gi: "STRONG" (process-children))
62     (make element gi: "EM" (process-children))))
63
64
65;; Custom headers
66
67(define %html-header-tags%
68  '(("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; charset=iso-8859-1")) ("META" ("NAME" "Author") ("CONTENT" "Bruno Cornec")) ("META" ("NAME" "KeyWords") ("CONTENT" "Linux,Disaster Recovery, Mondo, Mindi, MondoRescue")))
69    )
70
71;; ---------------------
72;;    Navigation Icons
73;; ---------------------
74;;
75;; Redefine links as graphic icons instead of text
76;;
77;; (Overrides definitions in common/dbl1en.dsl)
78;;
79(define (gentext-en-nav-prev prev)
80    (make empty-element gi: "IMG"
81           attributes: '(("SRC" "images/prev.png")
82   ("BORDER" "0")
83                        ("ALT" "Previous"))))
84
85(define (gentext-en-nav-next next)
86    (make empty-element gi: "IMG"
87           attributes: '(("SRC" "images/next.png")
88   ("BORDER" "0")
89                        ("ALT" "Next"))))
90
91(define (gentext-en-nav-up up)
92    (make empty-element gi: "IMG"
93           attributes: '(("SRC" "images/up.png")
94   ("BORDER" "0")
95                        ("ALT" "Up"))))
96
97(define (gentext-en-nav-home home)
98    (make empty-element gi: "IMG"
99           attributes: '(("SRC" "images/home.png")
100   ("BORDER" "0")
101                        ("ALT" "Home"))))
102
103;;
104;;
105;;=================================================================
106;;         End of navigation icons section
107;;=================================================================
108
109
110;;=================================================================
111;;    NAVIGATION HEADER TABLES
112;;=================================================================
113;;
114;;
115;; Rearrange navigation header to put bigger jumps at outside edge
116;;
117;; (Overrides stuff defined in html/dbnavig.dsl)
118;;
119;;
120;;=================================================================
121;;=================================================================
122;;
123;;
124
125(define (default-header-nav-tbl-ff elemnode prev next prevsib nextsib)
126  (let* ((r1? (nav-banner? elemnode))
127  (r1-sosofo (make element gi: "TR"
128     (make element gi: "TH"
129    attributes: (list
130          (list "COLSPAN" "5")
131          (list "ALIGN" "center")
132          (list "VALIGN" "bottom"))
133    (nav-banner elemnode))))
134  (r2? (or (not (node-list-empty? prev))
135    (not (node-list-empty? next))
136    (not (node-list-empty? prevsib))
137    (not (node-list-empty? nextsib))
138    (nav-context? elemnode)))
139  (r2-sosofo (make element gi: "TR"
140
141;; constructs Fast-Backward link
142
143     (make element gi: "TD"
144    attributes: (list
145          (list "WIDTH" "10%")
146          (list "ALIGN" "left")
147          (list "VALIGN" "top"))
148    (if (node-list-empty? prevsib)
149        (make entity-ref name: "nbsp")
150        (make element gi: "A"
151       attributes: (list
152             (list "HREF"
153            (href-to
154             prevsib)))
155       (gentext-nav-prev-sibling prevsib))))
156
157;; constructs Previous link
158     (make element gi: "TD"
159    attributes: (list
160          (list "WIDTH" "10%")
161          (list "ALIGN" "left")
162          (list "VALIGN" "top"))
163    (if (node-list-empty? prev)
164        (make entity-ref name: "nbsp")
165        (make element gi: "A"
166       attributes: (list
167             (list "HREF"
168            (href-to
169             prev)))
170       (gentext-nav-prev prev))))
171
172;; center part: navigation context, title, etc.
173
174     (make element gi: "TD"
175    attributes: (list
176          (list "WIDTH" "60%")
177          (list "ALIGN" "center")
178          (list "VALIGN" "bottom"))
179    (nav-context elemnode))
180;; constructs Next link
181     (make element gi: "TD"
182    attributes: (list
183          (list "WIDTH" "10%")
184          (list "ALIGN" "right")
185          (list "VALIGN" "top"))
186    (if (node-list-empty? next)
187        (make entity-ref name: "nbsp")
188        (make element gi: "A"
189       attributes: (list
190             (list "HREF"
191            (href-to
192             next)))
193       (gentext-nav-next next))))
194
195;; constructs Fast-Forward link
196
197     (make element gi: "TD"
198    attributes: (list
199          (list "WIDTH" "10%")
200          (list "ALIGN" "right")
201          (list "VALIGN" "top"))
202    (if (node-list-empty? nextsib)
203        (make entity-ref name: "nbsp")
204        (make element gi: "A"
205       attributes: (list
206             (list "HREF"
207            (href-to
208             nextsib)))
209       (gentext-nav-next-sibling nextsib))))
210                                                       )))
211    (if (or r1? r2?)
212 (make element gi: "DIV"
213       attributes: '(("CLASS" "NAVHEADER"))
214   (make element gi: "TABLE"
215  attributes: (list
216        (list "WIDTH" %gentext-nav-tblwidth%)
217        (list "BORDER" "0")
218        (list "CELLPADDING" "0")
219        (list "CELLSPACING" "0"))
220  (if r1? r1-sosofo (empty-sosofo))
221  (if r2? r2-sosofo (empty-sosofo)))
222   (make empty-element gi: "HR"
223  attributes: (list
224        (list "ALIGN" "LEFT")
225        (list "WIDTH" %gentext-nav-tblwidth%))))
226 (empty-sosofo))))
227
228;;
229;;
230;;=================================================================
231
232
233</style-specification-body>
234</style-specification>
235
236<!-- PS -->
237<style-specification id="print" use="print-stylesheet">
238<style-specification-body>
239
240;; Bookmark generation for PDF
241(declare-characteristic heading-level
242  "UNREGISTERED::James Clark//Characteristic::heading-level" 2)
243
244;;; To make URLs line wrap we use the TeX 'url' package.
245;;; See also: jadetex.cfg
246;; First we need to declare the 'formatting-instruction' flow class.
247;; (declare-flow-object-class formatting-instruction
248;; "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction")
249;; Then redefine ulink to use it.
250;; (element ulink
251;;   (make sequence
252;;     (if (node-list-empty? (children (current-node)))
253;;         ; ulink url="...", /ulink
254;;         (make formatting-instruction
255;;           data: (string-append "\\url{"
256;;                                (attribute-string (normalize "url"))
257;;                                "}"))
258;;         (if (equal? (attribute-string (normalize "url"))
259;;                     (data-of (current-node)))
260;;         ; ulink url="http://...", http://..., /ulink
261;;             (make formatting-instruction data:
262;;                   (string-append "\\url{"
263;;                                  (attribute-string (normalize "url"))
264;;                                  "}"))
265;;         ; ulink url="http://...", some text, /ulink
266;;             (make sequence
267;;               ($charseq$)
268;;               (literal " (")
269;;               (make formatting-instruction data:
270;;                     (string-append "\\url{"
271;;                                    (attribute-string (normalize "url"))
272;;                                    "}"))
273;;               (literal ")"))))))
274;;; And redefine filename to use it too.
275;; (element filename
276;;   (make formatting-instruction
277;;     data: (string-append "\\path{" (data-of (current-node)) "}")))
278
279
280;; Ne montre pas les liens
281(define %show-ulinks% #f)
282
283;; Are sections enumerated?
284(define %section-autolabel% #t)
285
286;; Use graphics in admonitions?
287(define %admon-graphics% #t)
288
289;; Path to admonition graphics
290(define %admon-graphics-path% "images/")
291
292(define ($admon-graphic$ #!optional (nd (current-node)))
293      (cond ((equal? (gi nd) (normalize "tip"))
294             (string-append %admon-graphics-path% "tip.png"))
295            ((equal? (gi nd) (normalize "note"))
296             (string-append %admon-graphics-path% "note.png"))
297            ((equal? (gi nd) (normalize "important"))
298             (string-append %admon-graphics-path% "important.png"))
299            ((equal? (gi nd) (normalize "caution"))
300             (string-append %admon-graphics-path% "caution.png"))
301            ((equal? (gi nd) (normalize "warning"))
302             (string-append %admon-graphics-path% "warning.png"))
303            (else (error (string-append (gi nd) " is not an admonition.")))))
304
305
306
307
308
309;; No recto-verso
310(define %two-side% #f)
311
312;; links for URLs ?
313(define %footnote-ulinks% #t)
314
315;; Make "bottom-of-page" footnotes?
316(define bop-footnotes #t)
317(define tex-backend #t)
318
319;; Allow justification
320(define %default-quadding% 'justify)
321
322;; Allow automatic hyphenation?
323(define %hyphenation% #t)
324
325;; défaut extension (print mode)
326(define %graphic-default-extension% "eps")
327
328;; From Norman Walsh
329(define (book-titlepage-recto-elements)
330  (list (normalize "title")
331        (normalize "subtitle")
332        (normalize "graphic")
333        (normalize "mediaobject")
334        (normalize "corpauthor")
335        (normalize "authorgroup")
336        (normalize "author")
337        (normalize "editor")
338        ;;(normalize "copyright")
339        (normalize "printhistory") ;; add this...
340        ;; (normalize "revhistory")
341        ;;(normalize "abstract")
342        ;;(normalize "releaseinfo")
343        (normalize "pubdate")
344        ;;(normalize "legalnotice")
345    ))                   
346
347;; From ldp.dsl
348(define %body-start-indent%
349  ;; Default indent of body text
350  0pi)
351
352(define %para-indent-firstpara%
353  ;; First line start-indent for the first paragraph
354  0pt)
355
356(define %para-indent%
357  ;; First line start-indent for paragraphs (other than the first)
358  0pt)
359
360(define %block-start-indent%
361  ;; Extra start-indent for block-elements
362  0pt)
363
364
365</style-specification-body>
366</style-specification>
367
368<!-- Pour le PDF -->
369<style-specification id="pdf" use="print">
370<style-specification-body>
371
372;; l'extension par défaut en mode HTML
373(define %graphic-default-extension% "png")
374
375;; Pour PDF
376(declare-characteristic heading-level
377   "UNREGISTERED::James Clark//Characteristic::heading-level" 2)
378(define %generate-heading-level% #t)
379
380</style-specification-body>
381</style-specification>
382
383<!-- Pour le TXT -->
384<style-specification id="txt" use="html">
385<style-specification-body>
386
387;; One page
388(define nochunks #t)
389
390;; no manifest
391(define %html-manifest% #f)
392
393</style-specification-body>
394</style-specification>
395
396<external-specification id="html-stylesheet" document="html-ss">
397<external-specification id="print-stylesheet" document="print-ss">
398
399</style-sheet>
Note: See TracBrowser for help on using the repository browser.