]> ;; this is necessary because right now jadetex does not understand ;; symbolic entities, whereas things work well with numeric entities. (declare-characteristic preserve-sdata? "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" #f) ;;========================= ;;Header HTML 4.0.1 ;;========================= (define %html-pubid% "-//W3C//DTD HTML 4.01//EN") (define %html-header-tags% '(("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; charset=ISO-8859-2"))) ; '(("META" ("NAME" "HTTP-EQUIV") ("CONTENT" "Content-Type") ("NAME" "CONTENT") ("CONTENT" "text/html; charset=ISO-8859-2")) ) ; '(("META" ("NAME" "Content-Type") ("CONTENT" "text/html; charset=ISO-8859-2"))) ;;========================= ;;Common Stuff ;;========================= ;;Should there be a link to the legalnotice? (define %generate-legalnotice-link% #t) ;;What graphics extensions allowed? (define %graphic-extensions% '("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" )) ;;What is the default extension for images? (define %graphic-default-extension% "png") ;;Use element ids as filenames? (define %use-id-as-filename% #f) ;;========================= ;;Book Stuff ;;========================= ;;Do you want a TOC for Books? (define %generate-book-toc% #t) ;;What depth should the TOC generate? ;;!Only top level of appendixes! (define (toc-depth nd) (if (string=? (gi nd) (normalize "book")) 3 (if (string=? (gi nd) (normalize "appendix")) 0 2))) ;;What elements should have an LOT? (define ($generate-book-lot-list$) (list (normalize "equation"))) ;;Do you want a title page for your Book? (define %generate-book-titlepage% #t) ;;========================= ;;Part Stuff ;;========================= ;;Should parts have TOCs? (define %generate-part-toc% #t) ;;Should part TOCs be on their titlepages? (define %generate-part-toc-on-titlepage% #t) ;;Do you want a title page for your part? (define %generate-part-titlepage% #t) ;;Should the Part intro be on the part title page? (define %generate-partintro-on-titlepage% #t) (define %para-autolabel% #t) ;;======================== ;;Chapter Stuff ;;======================= ;;No TOCs in Chapters (define $generate-chapter-toc$ (lambda () #f)) ;;========================= ;;Navigation ;;========================= ;;Should there be navigation at top? (define %header-navigation% #t) ;;Should there be navigation at bottom? (define %footer-navigation% #t) ;;Use tables to create the navigation? (define %gentext-nav-use-tables% #t) ;;If tables are used for navigation, ;;how wide should they be? (define %gentext-nav-tblwidth% "100%") ;;Add arrows to navigation (comment these ;;out if you want admon graphics here) (define (gentext-en-nav-prev prev) (make sequence (literal "<<< Previous"))) ;;Add arrows to navigation (comment these ;;out if you want admon graphics here) (define (gentext-en-nav-next next) (make sequence (literal "Next >>>"))) (define %root-filename% "index") ;(define %html-prefix% ; "doc_") (define %css-decoration% #f) (define ($object-titles-after$) (list (normalize "figure") (normalize "table"))) ;;========================= ;;Tables and Lists ;;========================= ;;Should Variable lists be tables? (define %always-format-variablelist-as-table% #f) ;;What is the length of the 'Term' in a variablelist? (define %default-variablelist-termlength% 20) ;;When true | If the terms are shorter than ;;the termlength above then the variablelist ;;will be formatted as a table. (define %may-format-variablelist-as-table% #f) ;;This overrides the tgroup definition ;;(copied from 1.20, dbtable.dsl). ;;It changes the table background color, ;;cell spacing and cell padding. ;;This is based on gtk-doc additions - thanks! (element tgroup (let* ((wrapper (parent (current-node))) (frameattr (attribute-string (normalize "frame") wrapper)) (pgwide (attribute-string (normalize "pgwide") wrapper)) (footnotes (select-elements (descendants (current-node)) (normalize "footnote"))) (border (if (equal? frameattr (normalize "none")) '(("BORDER" "0")) '(("BORDER" "1")))) ; (bgcolor '(("BGCOLOR" "#E0E0E0"))) (width (if (equal? pgwide "1") (list (list "WIDTH" ($table-width$))) '())) (head (select-elements (children (current-node)) (normalize "thead"))) (body (select-elements (children (current-node)) (normalize "tbody"))) (feet (select-elements (children (current-node)) (normalize "tfoot")))) (make element gi: "TABLE" attributes: (append border width ; bgcolor '(("CELLSPACING" "0")) '(("CELLPADDING" "4")) (if %cals-table-class% (list (list "CLASS" %cals-table-class%)) '())) (process-node-list head) (process-node-list body) (process-node-list feet) (make-table-endnotes)))) ;;=================== ;; Admon Graphics ;;=================== ;;Should Admon Graphics be used? (define %admon-graphics% #t) ;;Where are those admon graphics? (define %admon-graphics-path% "./stylesheet-images/") ;;Given an admonition node, returns the ;;name of the graphic that should ;;be used for that admonition. ;;Define admon graphics usage ;;NOTE these will change to pngs ;;soon in the GDP when Tigert gets ;;the time to make special ones for us! (define ($admon-graphic$ #!optional (nd (current-node))) (cond ((equal? (gi nd) (normalize "tip")) (string-append %admon-graphics-path% "tip.gif")) ((equal? (gi nd) (normalize "note")) (string-append %admon-graphics-path% "note.gif")) ((equal? (gi nd) (normalize "important")) (string-append %admon-graphics-path% "important.gif")) ((equal? (gi nd) (normalize "caution")) (string-append %admon-graphics-path% "caution.gif")) ((equal? (gi nd) (normalize "warning")) (string-append %admon-graphics-path% "warning.gif")) (else (error (string-append (gi nd) " is not an admonition."))))) ;;Given an admonition node, returns ;;the width of the graphic that will ;;be used for that admonition. (define ($admon-graphic-width$ #!optional (nd (current-node))) "25") ;;========================= ;;Labels ;;========================= ;;Enumerate Chapters? (define %chapter-autolabel% #f) ;;Enumerate Sections? (define %section-autolabel% #f) ;;========================= ;; HTML Attributes ;;========================= ;;What attributes should be hung off ;;of 'body'? (define %body-attr% (list )) ; (list ; (list "BGCOLOR" "#FFFFFF") ; (list "TEXT" "#000000") ; (list "LINK" "#0000FF") ; (list "VLINK" "#840084") ; (list "ALINK" "#0000FF"))) ;;Default extension for filenames? (define %html-ext% ".html") ;;Use a CSS stylesheet? ;;Which one? Should work on ;;this one soon ;(define %stylesheet% ; "./mycss.css") ;;Use it ;(define %stylesheet-type% ;"text/css") ;;======================== ;;Title Pages for Books ;;======================= (define (book-titlepage-recto-elements) (list (normalize "title") (normalize "subtitle") (normalize "corpauthor") (normalize "authorgroup") (normalize "author") (normalize "orgname") (normalize "graphic") (normalize "copyright") (normalize "legalnotice") (normalize "releaseinfo") (normalize "publisher") (normalize "isbn"))) ;;======================== ;;Title Pages for Articles ;;======================== (define %generate-article-titlepage% #t) ;;Should Articles have a TOC? (define %generate-article-toc% #t) ;;Which elements should appear ;;on title page? (define (article-titlepage-recto-elements) (list (normalize "title") (normalize "subtitle") (normalize "authorgroup") (normalize "copyright") (normalize "legalnotice") (normalize "date") (normalize "author") (normalize "abstract"))) ;;How should elements on title page look? (mode article-titlepage-recto-mode ;;Author name is too big - change it! (element author (let ((author-name (author-string)) (author-affil (select-elements (children (current-node)) (normalize "affiliation")))) (make sequence (make element gi: "H4" attributes: (list (list "CLASS" (gi))) (make element gi: "A" attributes: (list (list "NAME" (element-id))) (literal author-name))) (process-node-list author-affil)))) ;;Address? (element address (make sequence (make element gi: "DIV" attributes: (list (list "CLASS" (gi))) (process-children)))) ;;Get rid of spam-producing "mailto" links ;;and get rid of email indentation (element email (make sequence (make element gi: "DIV" attributes: (list (list "CLASS" (gi))) (process-children)))) ;;Point Abstract to custom table function ;;(See $dcm-abstract-object$ below. For default ;;use $semiformal-object$ ; (element abstract ; (make element gi: "DIV" ; ($dcm-abstract-object$))) ; ; (element (abstract title) (empty-sosofo)) ;;subtitle sizing (element subtitle (make element gi: "H4" attributes: (list (list "CLASS" (gi))) (process-children-trim)))) ;;================= ;; INLINES ;;================= ;Define my own series of fonts for various elements (element application ($mono-seq$)) (element command ($bold-seq$)) (element filename ($mono-seq$)) (element function ($mono-seq$)) (element guibutton ($bold-seq$)) (element guiicon ($bold-seq$)) (element guilabel ($bold-mono-seq$)) (element guimenu ($bold-seq$)) (element guimenuitem ($bold-seq$)) (element guisubmenu ($bold-seq$)) (element hardware ($bold-mono-seq$)) (element keycap ($bold-seq$)) (element literal ($mono-seq$)) (element parameter ($italic-mono-seq$)) (element prompt ($mono-seq$)) (element symbol ($charseq$)) (element emphasis ($italic-seq$)) ;;Show comment element? (define %show-comments% #t) ;;Redefine comment element for LSB (element comment (if %show-comments% (make element gi: "TABLE" attributes: ($shade-verbatim-attr$) (make element gi: "TR" (make element gi: "TD" (literal "RATIONALE:") (make element gi: "P" (process-children))))) (empty-sosofo))) ;;In DocBook V4.0 comment became remark (element remark (if %show-comments% (make element gi: "TABLE" attributes: ($shade-verbatim-attr$) (make element gi: "TR" (make element gi: "TD" (literal "RATIONALE:") (make element gi: "P" (process-children))))) (empty-sosofo))) ;;==================== ;; General Formatting ;;==================== ;;Formal Paras are ugly by default! ;;Make the title run in - otherwise ;;you should use a sect! (element formalpara (make element gi: "DIV" attributes: (list (list "CLASS" (gi))) (make element gi: "P" (process-children)))) ;;This is the old one ;(element (formalpara title) ;($lowtitle$ 5)) ;;This is the new one (element (formalpara title) (make element gi: "B" ($runinhead$))) ;; Handle qanda labelling with Q: A: (define (qanda-defaultlabel) (normalize "qanda")) ;;From FreeBSD Sheets (Thanks!) Display Q and A in bigger bolder fonts (element question (let* ((chlist (children (current-node))) (firstch (node-list-first chlist)) (restch (node-list-rest chlist))) (make element gi: "DIV" attributes: (list (list "CLASS" (gi))) (make element gi: "P" (make element gi: "BIG" (make element gi: "A" attributes: (list (list "NAME" (element-id))) (empty-sosofo)) (make element gi: "B" (literal (question-answer-label (current-node)) " ") (process-node-list (children firstch))))) (process-node-list restch)))) ;;Literal Elements ;;Indent Literal layouts? (define %indent-literallayout-lines% #f) ;;Indent Programlistings? (define %indent-programlisting-lines% #f) ;;Number lines in Programlistings? (define %number-programlisting-lines% #f) ;;Should verbatim items be 'shaded' with a table? (define %shade-verbatim% #t) ;;Define shade-verbatim attributes (define ($shade-verbatim-attr$) (list (list "BORDER" "0") (list "BGCOLOR" "#E0E0E0") (list "WIDTH" ($table-width$)))) ;;=================== ;; Entities ;;=================== ;;Netscape doesn't handle trademark ;;entity right at all!! Get rid of it. ;;Make a TM in a superscipt font. (element trademark (make sequence (process-children) (make element gi: "sup" (literal "TM")))) ;;=================== ;; New Definitions ;;================== (define ($dcm-abstract-object$) (make element gi: "TABLE" attributes: '(("BORDER" "0") ("BGCOLOR" "#E0E0E0") ("WIDTH" "50%") ("CELLSPACING" "0") ("CELLPADDING" "0") ("ALIGN" "CENTER")) (make element gi: "TR" (make element gi: "TD" attributes: '(("VALIGN" "TOP")) (process-children))))) ;;Redefine Titlepage Separator on Articles ;(define (article-titlepage-separator side) ; (make empty-element gi: "HR" ; attributes: '(("WIDTH" "75%") ; ("ALIGN" "CENTER") ; ("COLOR" "#000000") ; ("SIZE" "1")))) (define rootchunk #t) (define (chunk-element-list) (list (normalize "preface") (normalize "chapter") (normalize "appendix") (normalize "article") (normalize "glossary") (normalize "bibliography") (normalize "index") (normalize "colophon") (normalize "setindex") (normalize "reference") (normalize "refentry") (normalize "part") (normalize "sect1") (normalize "section") (normalize "book") ;; just in case nothing else matches... (normalize "set") ;; sets are definitely chunks... )) ;;Do you want Callouts to be graphics? (define %callout-graphics% #f) ;;Make Callout graphics PNGs (define %callout-graphics-path% "./imagelib/callouts/") ;; Redefine $callout-bug$ to support the %callout-graphic-ext% ;; variable. (define ($callout-bug$ conumber) (let ((number (if conumber (format-number conumber "1") "0"))) (if conumber (if %callout-graphics% (if (<= conumber %callout-graphics-number-limit%) (make empty-element gi: "IMG" attributes: (list (list "SRC" (root-rel-path (string-append %callout-graphics-path% number %callout-graphics-ext%))) (list "HSPACE" "0") (list "VSPACE" "0") (list "BORDER" "0") (list "ALT" (string-append "(" number ")")))) (make element gi: "B" (literal "(" (format-number conumber "1") ")"))) (make element gi: "B" (literal "(" (format-number conumber "1") ")"))) (make element gi: "B" (literal "(??)"))))) (define ($section-title$) (let* ((sect (current-node)) (info (info-element)) (subtitles (select-elements (children info) (normalize "subtitle"))) (renderas (inherited-attribute-string (normalize "renderas") sect)) (hlevel ;; the apparent section level; (if renderas ;; if not real section level, (string->number ;; then get the apparent level (substring renderas 4 5)) ;; from "renderas", (SECTLEVEL))) ;; else use the real level (h1elem (string-append "H" (number->string (+ hlevel 1)))) (h2elem (string-append "H" (number->string (+ hlevel 2)))) (name (element-id)) (isep (gentext-intra-label-sep (gi sect))) (nsep (gentext-label-title-sep (gi sect)))) (make sequence (make element gi: h1elem attributes: (list (list "CLASS" (gi sect))) (make element gi: "A" attributes: (list (list "NAME" name)) (if (string=? (element-label (current-node)) "") (empty-sosofo) (literal (element-label (current-node)) nsep)) (element-title-sosofo sect))) (if (node-list-empty? subtitles) (empty-sosofo) (with-mode subtitle-mode (make element gi: h2elem (process-node-list subtitles)))) ($proc-section-info$ info))))