5a9b54
5a9b54
5a9b54
5a9b54
5a9b54
5a9b54
]]>
5a9b54
5a9b54
5a9b54
5a9b54
]]>
5a9b54
]>
5a9b54
5a9b54
5a9b54
;;#######################################################################
5a9b54
;;#                                                                     #
5a9b54
;;#                 The GNOME Documentation Project's                   #
5a9b54
;;#                  Custion DocBook Stylesheet Layer                   #
5a9b54
;;#                    by Dave Mason dcm@redhat.com                     #
5a9b54
;;#            Based on Norman Walsh's Modular Stylesheets              #
5a9b54
;;#                                                                     #
5a9b54
;;#            This is intended as a drop-in replacement for            #
5a9b54
;;#            the cygnus-both.dsl file in DocBook Tools.               #
5a9b54
;;#           Just copy it to the location dbtools created              #
5a9b54
;;#                   and rename it cygnus-both.dsl                     #
5a9b54
;;#                                                                     #
5a9b54
;;#                       This is Version 1.0-4                         #
5a9b54
;;#                  patched to fix RTF output (#49677)                 #
5a9b54
;;#                patched to work with docbook-dsssl-1.72              #
5a9b54
;;#                 patched for ADDRESS output (#50605)                 #
5a9b54
;;#                      removed comment and remark                     #
5a9b54
;;#                      disabled use-id-as-filename                    #
5a9b54
;;#               don't define %graphic-default-extension%              #
5a9b54
;;#######################################################################
5a9b54
-->
5a9b54
5a9b54
<style-sheet>
5a9b54
5a9b54
5a9b54
<style-specification id="print" use="docbook">
5a9b54
<style-specification-body> 
5a9b54
5a9b54
;;==========================================================================
5a9b54
;;                               PRINT
5a9b54
;;==========================================================================
5a9b54
5a9b54
;;======================================
5a9b54
;;General Options
5a9b54
;;======================================
5a9b54
5a9b54
;;Do you want to print on both sides of the paper?
5a9b54
(define %two-side% 
5a9b54
 #t)
5a9b54
5a9b54
;;Do you want enumerated sections? (E.g, 1.1, 1.1.1, 1.2, etc.)
5a9b54
(define %section-autolabel% 
5a9b54
 #f)
5a9b54
5a9b54
;;Show URL links? If the text of the link and the URL are identical,
5a9b54
;;the parenthetical URL is suppressed.
5a9b54
(define %show-ulinks%
5a9b54
 #t)
5a9b54
5a9b54
;Make Ulinks footnotes to stop bleeding in the edges - this increases
5a9b54
;'jade --> print' time tremendously keep this in mind before
5a9b54
;complaining!
5a9b54
(define %footnote-ulinks%
5a9b54
  #t)
5a9b54
5a9b54
;;Tex Backend on
5a9b54
(define tex-backend 
5a9b54
 #t)
5a9b54
5a9b54
;;Define Line Spacing
5a9b54
(define %line-spacing-factor% 1.1)
5a9b54
5a9b54
;;Define the Paragraph Style
5a9b54
(define para-style
5a9b54
  (style
5a9b54
   font-size: %bf-size%
5a9b54
   font-weight: 'medium
5a9b54
   font-posture: 'upright
5a9b54
   font-family-name: %body-font-family%
5a9b54
   line-spacing: (* %bf-size% %line-spacing-factor%)))
5a9b54
5a9b54
(define ($object-titles-after$)
5a9b54
  (list (normalize "figure")))
5a9b54
5a9b54
;;======================================
5a9b54
;;Book Options
5a9b54
;;======================================
5a9b54
5a9b54
5a9b54
;;Do you want a title page for a Book?
5a9b54
(define %generate-book-titlepage%
5a9b54
 #t)
5a9b54
5a9b54
;;Do you want a separate page for the title?
5a9b54
(define %generate-book-titlepage-on-separate-page%
5a9b54
 #t)
5a9b54
5a9b54
;;Generate Book TOC?
5a9b54
(define %generate-book-toc% 
5a9b54
 #t)
5a9b54
5a9b54
;;What depth should the TOC generate?
5a9b54
;;!Only top level of appendixes!
5a9b54
(define (toc-depth nd)
5a9b54
  (if (string=? (gi nd) (normalize "book"))
5a9b54
      3
5a9b54
      (if (string=? (gi nd) (normalize "appendix"))
5a9b54
        0
5a9b54
        1)))
5a9b54
5a9b54
;;Do you want a TOC for the element part?
5a9b54
(define %generate-part-toc% 
5a9b54
 #f)
5a9b54
5a9b54
;;Do you want the part toc on the part titlepage or separate?
5a9b54
(define %generate-part-toc-on-titlepage%
5a9b54
 #t)
5a9b54
5a9b54
;;Generate Part Title Page?
5a9b54
(define %generate-part-titlepage% 
5a9b54
  #f)
5a9b54
5a9b54
;;Do you want the Part intro on the part title page?
5a9b54
(define %generate-partintro-on-titlepage%
5a9b54
  #t)
5a9b54
5a9b54
;;What elements should have a LOT?
5a9b54
(define ($generate-book-lot-list$)
5a9b54
  (list (normalize "equation")))
5a9b54
5a9b54
;;Do you want chapters enumerated?
5a9b54
(define %chapter-autolabel% 
5a9b54
 #t)
5a9b54
5a9b54
;;Do you want Chapter's and Appendix's 
5a9b54
;;to have automatic labels?
5a9b54
(define %chap-app-running-head-autolabel% 
5a9b54
  #t)
5a9b54
5a9b54
5a9b54
;;======================================
5a9b54
;;Article Options
5a9b54
;;======================================
5a9b54
5a9b54
;;Do you want a title page for an Article?
5a9b54
(define %generate-article-titlepage%
5a9b54
 #t)
5a9b54
5a9b54
;;Generate Article TOC?
5a9b54
(define %generate-article-toc% 
5a9b54
 #t)
5a9b54
5a9b54
;;Do you want a separate page for the title?
5a9b54
(define %generate-article-titlepage-on-separate-page%
5a9b54
 #t)
5a9b54
5a9b54
;;Do you want the article toc on the titlepage or separate?
5a9b54
(define %generate-article-toc-on-titlepage%
5a9b54
 #t)
5a9b54
5a9b54
;;Do you want to start new page numbers with each article?
5a9b54
(define %article-page-number-restart%
5a9b54
 #f)
5a9b54
5a9b54
;;Titlepage Separate?
5a9b54
(define (chunk-skip-first-element-list)
5a9b54
  '())
5a9b54
5a9b54
;;Titlepage Not Separate
5a9b54
;(define (chunk-skip-first-element-list)
5a9b54
;  (list (normalize "sect1")
5a9b54
;	(normalize "section")))
5a9b54
5a9b54
;;======================================
5a9b54
;;Columns
5a9b54
;;======================================
5a9b54
5a9b54
;;How many columns do you want?
5a9b54
(define %page-n-columns%
5a9b54
 1)
5a9b54
5a9b54
;;How much space between columns?
5a9b54
(define %page-column-sep%
5a9b54
 0.2in)
5a9b54
5a9b54
;;How many Columns on the titlepage?
5a9b54
(define %titlepage-n-columns%
5a9b54
  1)
5a9b54
5a9b54
;;Balance columns?
5a9b54
(define %page-balance-colums%
5a9b54
#t)
5a9b54
5a9b54
;;======================================
5a9b54
;;Fonts
5a9b54
;;======================================
5a9b54
5a9b54
;;Defines the general size of the text in the document. normal(10),
5a9b54
;;presbyopic(12), and large-type(24). 
5a9b54
(define %visual-acuity%
5a9b54
 "normal")
5a9b54
5a9b54
;;What font would you like for titles?
5a9b54
(define %title-font-family% 
5a9b54
  "Helvetica")
5a9b54
5a9b54
;;What font would you like for the body?
5a9b54
(define %body-font-family% 
5a9b54
 "Palatino")
5a9b54
5a9b54
;;What font would you like for mono-seq?
5a9b54
(define %mono-font-family% 
5a9b54
 "Courier New")
5a9b54
5a9b54
;;If the base fontsize is 10pt, and '%hsize-bump-factor%' is
5a9b54
;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc
5a9b54
(define %hsize-bump-factor% 
5a9b54
 1.1)
5a9b54
5a9b54
;;What size do you want the body fonts?
5a9b54
(define %bf-size%
5a9b54
 (case %visual-acuity%
5a9b54
    (("tiny") 8pt)
5a9b54
    (("normal") 10pt)
5a9b54
    (("presbyopic") 12pt)
5a9b54
    (("large-type") 24pt)))
5a9b54
5a9b54
(define-unit em %bf-size%)
5a9b54
5a9b54
;;======================================
5a9b54
;;Margins
5a9b54
;;======================================
5a9b54
5a9b54
(define %left-right-margin% 6pi)
5a9b54
5a9b54
;;How much indentation for the body?
5a9b54
(define %body-start-indent% 
5a9b54
 4pi)
5a9b54
5a9b54
;;How big is the left margin? (relative to physical page)
5a9b54
(define %left-margin% 
5a9b54
 8pi) ;white-paper-column
5a9b54
5a9b54
;;How big is the right margin? (relative to physical page)
5a9b54
(define %right-margin% 
5a9b54
 8pi) ;white-paper-column
5a9b54
5a9b54
;;How big do you want the margin at the top?
5a9b54
(define %top-margin%
5a9b54
(if (equal? %visual-acuity% "large-type")
5a9b54
      7.5pi
5a9b54
      6pi))
5a9b54
5a9b54
;;How big do you want the margin at the bottom?
5a9b54
(define %bottom-margin% 
5a9b54
 (if (equal? %visual-acuity% "large-type")
5a9b54
      7.5pi 
5a9b54
      5pi))
5a9b54
5a9b54
;;Define the text width. (Change the elements in the formula rather
5a9b54
;;than the formula itself)
5a9b54
;(define %text-width% (- %page-width% (* %left-right-margin% 2)))
5a9b54
(define %text-width%  (- %page-width% (+ %left-margin% %right-margin%)))
5a9b54
5a9b54
;;Define the body width. (Change the elements in the formula rather
5a9b54
;;than the formula itself)
5a9b54
(define %body-width% 
5a9b54
 (- %text-width% %body-start-indent%))
5a9b54
5a9b54
;;Define distance between paragraphs
5a9b54
(define %para-sep% 
5a9b54
 (/ %bf-size% 2.0))
5a9b54
5a9b54
;;Define distance between block elements (figures, tables, etc.).
5a9b54
(define %block-sep% 
5a9b54
 (* %para-sep% 2.0))
5a9b54
5a9b54
;;Indent block elements?
5a9b54
(define %block-start-indent% 
5a9b54
  0pt)
5a9b54
;0pt
5a9b54
5a9b54
;;======================================
5a9b54
;;Admon Graphics
5a9b54
;;======================================
5a9b54
5a9b54
;;Do you want admon graohics on?
5a9b54
(define %admon-graphics%
5a9b54
 #f)
5a9b54
5a9b54
;;Where are the admon graphics?
5a9b54
(define %admon-graphics-path%
5a9b54
 "../images/")
5a9b54
5a9b54
;;======================================
5a9b54
;;Quadding
5a9b54
;;======================================
5a9b54
5a9b54
;;What quadding do you want by default; start, center, justify, or end?
5a9b54
(define %default-quadding%
5a9b54
 'justify)
5a9b54
5a9b54
;;What quadding for component titles(Chapter, Appendix, etc)?
5a9b54
(define %component-title-quadding% 
5a9b54
 'start)
5a9b54
5a9b54
;;What quadding for section titles?
5a9b54
(define %section-title-quadding% 
5a9b54
 'start)
5a9b54
5a9b54
;;What quadding for section sub-titles?
5a9b54
(define %section-subtitle-quadding%
5a9b54
 'start)
5a9b54
5a9b54
;;What quadding for article title?
5a9b54
(define %article-title-quadding% 
5a9b54
 'center)
5a9b54
5a9b54
;;What quadding for article sub-titles?
5a9b54
(define %article-subtitle-quadding%
5a9b54
 'center)
5a9b54
5a9b54
;;What quadding for division subtitles?
5a9b54
(define %division-subtitle-quadding% 
5a9b54
  'start)
5a9b54
5a9b54
;;What quadding for component subtitles?
5a9b54
(define %component-subtitle-quadding% 
5a9b54
  'start)
5a9b54
5a9b54
5a9b54
5a9b54
5a9b54
;;======================================
5a9b54
;;Paper Options
5a9b54
;;======================================
5a9b54
5a9b54
;;What size paper do you need? A4, USletter, USlandscape, or RedHat?
5a9b54
(define %paper-type%
5a9b54
 "USletter")
5a9b54
5a9b54
;;Now define those paper types' width
5a9b54
(define %page-width%
5a9b54
 (case %paper-type%
5a9b54
    (("A4") 210mm)
5a9b54
    (("USletter") 8.5in)
5a9b54
    (("USlandscape") 11in)))
5a9b54
5a9b54
;;Now define those paper types' height
5a9b54
(define %page-height%
5a9b54
 (case %paper-type%
5a9b54
    (("A4") 297mm)
5a9b54
    (("USletter") 11in)
5a9b54
    (("USlandscape") 8.5in)))
5a9b54
5a9b54
;;======================================
5a9b54
;;Functions
5a9b54
;;======================================
5a9b54
5a9b54
(define (OLSTEP)
5a9b54
  (case
5a9b54
   (modulo (length (hierarchical-number-recursive "ORDEREDLIST")) 4)
5a9b54
	((1) 1.2em)
5a9b54
	((2) 1.2em)
5a9b54
	((3) 1.6em)
5a9b54
	((0) 1.4em)))
5a9b54
5a9b54
(define (ILSTEP) 1.0em)
5a9b54
5a9b54
(define (PROCSTEP ilvl)
5a9b54
  (if (> ilvl 1) 1.8em 1.4em))
5a9b54
5a9b54
(define (PROCWID ilvl)
5a9b54
  (if (> ilvl 1) 1.8em 1.4em))
5a9b54
5a9b54
5a9b54
(define ($comptitle$)
5a9b54
  (make paragraph
5a9b54
	font-family-name: %title-font-family%
5a9b54
	font-weight: 'bold
5a9b54
	font-size: (HSIZE 2)
5a9b54
	line-spacing: (* (HSIZE 2) %line-spacing-factor%)
5a9b54
	space-before: (* (HSIZE 2) %head-before-factor%)
5a9b54
	space-after: (* (HSIZE 2) %head-after-factor%)
5a9b54
	start-indent: 0pt
5a9b54
	first-line-start-indent: 0pt
5a9b54
	quadding: 'start
5a9b54
	keep-with-next?: #t
5a9b54
	(process-children-trim)))
5a9b54
5a9b54
;;Callouts are confusing in Postscript... fix them.
5a9b54
(define %callout-fancy-bug% 
5a9b54
 #f)
5a9b54
5a9b54
5a9b54
;;By default perils are centered and dropped into a box with a really
5a9b54
;;big border - I have simply decreased the border thickness -
5a9b54
;;unfortunately it takes all this to do it - sigh.
5a9b54
(define ($peril$)
5a9b54
  (let* ((title     (select-elements 
5a9b54
		     (children (current-node)) (normalize "title")))
5a9b54
	 (has-title (not (node-list-empty? title)))
5a9b54
	 (adm-title (if has-title 
5a9b54
			(make sequence
5a9b54
			  (with-mode title-sosofo-mode
5a9b54
			    (process-node-list (node-list-first title))))
5a9b54
			(literal
5a9b54
			 (gentext-element-name 
5a9b54
			  (current-node)))))
5a9b54
	 (hs (HSIZE 2)))
5a9b54
  (if %admon-graphics%
5a9b54
      ($graphical-admonition$)
5a9b54
      (make display-group
5a9b54
	space-before: %block-sep%
5a9b54
	space-after: %block-sep%
5a9b54
	font-family-name: %admon-font-family%
5a9b54
	font-size: (- %bf-size% 1pt)
5a9b54
	font-weight: 'medium
5a9b54
	font-posture: 'upright
5a9b54
	line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%)
5a9b54
	(make box
5a9b54
	  display?: #t
5a9b54
	  box-type: 'border
5a9b54
	  line-thickness: .5pt
5a9b54
	  start-indent: (+ (inherited-start-indent) (* 2 (ILSTEP)) 2pt)
5a9b54
	  end-indent: (inherited-end-indent)
5a9b54
	  (make paragraph
5a9b54
	    space-before: %para-sep%
5a9b54
	    space-after: %para-sep%
5a9b54
	    start-indent: 1em
5a9b54
	    end-indent: 1em
5a9b54
	    font-family-name: %title-font-family%
5a9b54
	    font-weight: 'bold
5a9b54
	    font-size: hs
5a9b54
	    line-spacing: (* hs %line-spacing-factor%)
5a9b54
	    quadding: 'center
5a9b54
	    keep-with-next?: #t
5a9b54
	    adm-title)
5a9b54
	  (process-children))))))
5a9b54
5a9b54
5a9b54
;;======================================
5a9b54
;;Non-printing Elements
5a9b54
;;======================================
5a9b54
(element TITLEABBREV (empty-sosofo))
5a9b54
(element SUBTITLE (empty-sosofo))
5a9b54
(element SETINFO (empty-sosofo))
5a9b54
(element BOOKINFO (empty-sosofo))
5a9b54
(element BIBLIOENTRY (empty-sosofo))
5a9b54
(element BIBLIOMISC (empty-sosofo))
5a9b54
(element BOOKBIBLIO (empty-sosofo))
5a9b54
(element SERIESINFO (empty-sosofo))
5a9b54
(element DOCINFO (empty-sosofo))
5a9b54
(element ARTHEADER (empty-sosofo))
5a9b54
;;(element ADDRESS (empty-sosofo))
5a9b54
5a9b54
;;Show comment element?
5a9b54
(define %show-comments%
5a9b54
  #t)
5a9b54
5a9b54
;;======================================
5a9b54
;;Formalpara titles
5a9b54
;;======================================
5a9b54
5a9b54
5a9b54
;;Change the way Formal Paragraph titles are displayed. The commented
5a9b54
;;out section will run the titles in the paragraphs. 
5a9b54
(element (formalpara title)
5a9b54
  ;(make sequence
5a9b54
  ;font-weight: 'bold
5a9b54
  ;($runinhead$))
5a9b54
  ($lowtitle$ 5 7))
5a9b54
5a9b54
;;======================================
5a9b54
;;Inlines
5a9b54
;;======================================
5a9b54
5a9b54
(element application ($mono-seq$))
5a9b54
(element command ($bold-seq$))
5a9b54
(element filename ($mono-seq$))
5a9b54
(element function ($mono-seq$))
5a9b54
(element guibutton ($bold-seq$))
5a9b54
(element guiicon ($bold-seq$))
5a9b54
(element guilabel ($italic-seq$))
5a9b54
(element guimenu ($bold-seq$))
5a9b54
(element guimenuitem ($bold-seq$))
5a9b54
(element hardware ($bold-mono-seq$))
5a9b54
(element keycap ($bold-seq$))
5a9b54
(element literal ($mono-seq$))
5a9b54
(element parameter ($italic-mono-seq$))
5a9b54
(element prompt ($mono-seq$))
5a9b54
(element symbol ($charseq$))
5a9b54
(element emphasis ($italic-seq$))
5a9b54
5a9b54
</style-specification-body>
5a9b54
</style-specification>
5a9b54
5a9b54
5a9b54
5a9b54
;;===========================================================================
5a9b54
;;                                HTML
5a9b54
;;===========================================================================
5a9b54
-->
5a9b54
5a9b54
<style-specification id="html" use="docbook">
5a9b54
<style-specification-body> 
5a9b54
5a9b54
;; this is necessary because right now jadetex does not understand
5a9b54
;; symbolic entities, whereas things work well with numeric entities.
5a9b54
(declare-characteristic preserve-sdata?
5a9b54
          "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
5a9b54
          #f)
5a9b54
5a9b54
5a9b54
;;=========================
5a9b54
;;Header HTML 4.0.1
5a9b54
;;=========================
5a9b54
5a9b54
(define %html-pubid% "-//W3C//DTD HTML 4.01//EN")
5a9b54
5a9b54
;;=========================
5a9b54
;;Common Stuff
5a9b54
;;=========================
5a9b54
5a9b54
;;Should there be a link to the legalnotice?
5a9b54
(define %generate-legalnotice-link%
5a9b54
  #t)
5a9b54
5a9b54
;;What graphics extensions allowed?
5a9b54
(define %graphic-extensions% 
5a9b54
'("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" ))
5a9b54
5a9b54
;;What is the default extension for images?
5a9b54
(define %graphic-default-extension% "png")
5a9b54
5a9b54
;;Use element ids as filenames?
5a9b54
(define %use-id-as-filename%
5a9b54
 #f)
5a9b54
5a9b54
5a9b54
;;=========================
5a9b54
;;Book Stuff
5a9b54
;;=========================
5a9b54
5a9b54
;;Do you want a TOC for Books?
5a9b54
(define %generate-book-toc% 
5a9b54
  #t)
5a9b54
5a9b54
;;What depth should the TOC generate?
5a9b54
;;!Only top level of appendixes!
5a9b54
(define (toc-depth nd)
5a9b54
  (if (string=? (gi nd) (normalize "book"))
5a9b54
      3
5a9b54
      (if (string=? (gi nd) (normalize "appendix"))
5a9b54
        0
5a9b54
        1)))
5a9b54
5a9b54
;;What elements should have an LOT?
5a9b54
(define ($generate-book-lot-list$)
5a9b54
  (list (normalize "equation")))
5a9b54
5a9b54
;;Do you want a title page for your Book?
5a9b54
(define %generate-book-titlepage%
5a9b54
#t)
5a9b54
5a9b54
;;=========================
5a9b54
;;Part Stuff
5a9b54
;;=========================
5a9b54
5a9b54
;;Should parts have TOCs?
5a9b54
(define %generate-part-toc% 
5a9b54
  #t)
5a9b54
5a9b54
;;Should part TOCs be on their titlepages?
5a9b54
(define %generate-part-toc-on-titlepage%
5a9b54
  #t)
5a9b54
5a9b54
;;Do you want a title page for your part?
5a9b54
(define %generate-part-titlepage% 
5a9b54
  #t)
5a9b54
5a9b54
;;Should the Part intro be on the part title page?
5a9b54
(define %generate-partintro-on-titlepage%
5a9b54
 #t)
5a9b54
5a9b54
(define %para-autolabel%
5a9b54
 #t)
5a9b54
5a9b54
;;========================
5a9b54
;;Chapter Stuff
5a9b54
;;=======================
5a9b54
5a9b54
;;No TOCs in Chapters
5a9b54
(define $generate-chapter-toc$
5a9b54
 (lambda ()
5a9b54
    #f))
5a9b54
5a9b54
;;=========================
5a9b54
;;Navigation
5a9b54
;;=========================
5a9b54
5a9b54
;;Should there be navigation at top?
5a9b54
(define %header-navigation%
5a9b54
 #t)
5a9b54
5a9b54
;;Should there be navigation at bottom?
5a9b54
(define %footer-navigation%
5a9b54
  #t)
5a9b54
5a9b54
;;Use tables to create the navigation?
5a9b54
(define %gentext-nav-use-tables%
5a9b54
 #t)
5a9b54
5a9b54
;;If tables are used for navigation, 
5a9b54
;;how wide should they be? 
5a9b54
(define %gentext-nav-tblwidth% 
5a9b54
"100%")
5a9b54
5a9b54
;;Add arrows to navigation (comment these 
5a9b54
;;out if you want admon graphics here)
5a9b54
(define (gentext-en-nav-prev prev) 
5a9b54
  (make sequence (literal "<<< Previous")))
5a9b54
5a9b54
;;Add arrows to navigation (comment these 
5a9b54
;;out if you want admon graphics here)
5a9b54
(define (gentext-en-nav-next next)
5a9b54
  (make sequence (literal "Next >>>")))
5a9b54
5a9b54
5a9b54
;;=========================
5a9b54
;;Tables and Lists
5a9b54
;;=========================
5a9b54
5a9b54
;;Should Variable lists be tables?
5a9b54
(define %always-format-variablelist-as-table%
5a9b54
 #f)
5a9b54
5a9b54
;;What is the length of the 'Term' in a variablelist?
5a9b54
(define %default-variablelist-termlength%
5a9b54
  20)
5a9b54
5a9b54
;;When true | If the terms are shorter than 
5a9b54
;;the termlength above then the variablelist 
5a9b54
;;will be formatted as a table.
5a9b54
(define %may-format-variablelist-as-table%
5a9b54
#f)
5a9b54
5a9b54
;;This overrides the tgroup definition 
5a9b54
;;(copied from 1.20, dbtable.dsl).
5a9b54
;;It changes the table background color, 
5a9b54
;;cell spacing and cell padding.
5a9b54
;;This is based on gtk-doc additions - thanks!
5a9b54
5a9b54
(element tgroup
5a9b54
  (let* ((wrapper   (parent (current-node)))
5a9b54
	 (frameattr (attribute-string (normalize "frame") wrapper))
5a9b54
	 (pgwide    (attribute-string (normalize "pgwide") wrapper))
5a9b54
	 (footnotes (select-elements (descendants (current-node)) 
5a9b54
				     (normalize "footnote")))
5a9b54
	 (border (if (equal? frameattr (normalize "none"))
5a9b54
		     '(("BORDER" "0"))
5a9b54
		     '(("BORDER" "1"))))
5a9b54
	 (bgcolor '(("BGCOLOR" "#E0E0E0")))
5a9b54
	 (width (if (equal? pgwide "1")
5a9b54
		    (list (list "WIDTH" ($table-width$)))
5a9b54
		    '()))
5a9b54
	 (head (select-elements (children (current-node)) (normalize "thead")))
5a9b54
	 (body (select-elements (children (current-node)) (normalize "tbody")))
5a9b54
	 (feet (select-elements (children (current-node)) (normalize "tfoot"))))
5a9b54
    (make element gi: "TABLE"
5a9b54
	  attributes: (append
5a9b54
		       border
5a9b54
		       width
5a9b54
		       bgcolor
5a9b54
		       '(("CELLSPACING" "0"))
5a9b54
		       '(("CELLPADDING" "4"))
5a9b54
		       (if %cals-table-class%
5a9b54
			   (list (list "CLASS" %cals-table-class%))
5a9b54
			   '()))
5a9b54
	  (process-node-list head)
5a9b54
	  (process-node-list body)
5a9b54
	  (process-node-list feet)
5a9b54
	  (make-table-endnotes))))
5a9b54
5a9b54
;;===================
5a9b54
;; Admon Graphics
5a9b54
;;===================
5a9b54
5a9b54
;;Should Admon Graphics be used?
5a9b54
(define %admon-graphics%
5a9b54
  #t)
5a9b54
5a9b54
;;Where are those admon graphics?
5a9b54
(define %admon-graphics-path%
5a9b54
  "./stylesheet-images/")
5a9b54
5a9b54
;;Given an admonition node, returns the 
5a9b54
;;name of the graphic that should
5a9b54
;;be used for that admonition.
5a9b54
;;Define admon graphics usage
5a9b54
;;NOTE these will change to pngs 
5a9b54
;;soon in the GDP when Tigert gets 
5a9b54
;;the time to make special ones for us!
5a9b54
(define ($admon-graphic$ #!optional (nd (current-node)))
5a9b54
  (cond ((equal? (gi nd) (normalize "tip"))
5a9b54
	 (string-append %admon-graphics-path% "tip.gif"))
5a9b54
	((equal? (gi nd) (normalize "note"))
5a9b54
	 (string-append %admon-graphics-path% "note.gif"))
5a9b54
	((equal? (gi nd) (normalize "important"))
5a9b54
	 (string-append %admon-graphics-path% "important.gif"))
5a9b54
	((equal? (gi nd) (normalize "caution"))
5a9b54
	 (string-append %admon-graphics-path% "caution.gif"))
5a9b54
	((equal? (gi nd) (normalize "warning"))
5a9b54
	 (string-append %admon-graphics-path% "warning.gif"))
5a9b54
	(else (error (string-append (gi nd) " is not an admonition.")))))
5a9b54
5a9b54
;;Given an admonition node, returns 
5a9b54
;;the width of the graphic that will
5a9b54
;;be used for that admonition.
5a9b54
(define ($admon-graphic-width$ #!optional (nd (current-node)))
5a9b54
  "25")
5a9b54
5a9b54
;;=========================
5a9b54
;;Labels
5a9b54
;;=========================
5a9b54
5a9b54
;;Enumerate Chapters?
5a9b54
(define %chapter-autolabel% 
5a9b54
 #f)
5a9b54
5a9b54
;;Enumerate Sections?
5a9b54
(define %section-autolabel%
5a9b54
 #f)
5a9b54
5a9b54
;;=========================
5a9b54
;;    HTML Attributes
5a9b54
;;=========================
5a9b54
5a9b54
;;What attributes should be hung off 
5a9b54
;;of 'body'?
5a9b54
(define %body-attr%
5a9b54
 (list
5a9b54
   (list "BGCOLOR" "#FFFFFF")
5a9b54
   (list "TEXT" "#000000")
5a9b54
   (list "LINK" "#0000FF")
5a9b54
   (list "VLINK" "#840084")
5a9b54
   (list "ALINK" "#0000FF")))
5a9b54
5a9b54
;;Default extension for filenames?
5a9b54
(define %html-ext% 
5a9b54
  ".html")
5a9b54
5a9b54
;;Use a CSS stylesheet?
5a9b54
;;Which one? Should work on 
5a9b54
;;this one soon
5a9b54
;(define %stylesheet% 
5a9b54
;        "./gnome.css")
5a9b54
5a9b54
;;Use it
5a9b54
;(define %stylesheet-type% 
5a9b54
;"text/css")
5a9b54
5a9b54
5a9b54
;;========================
5a9b54
;;Title Pages for Books
5a9b54
;;=======================
5a9b54
5a9b54
(define (book-titlepage-recto-elements)
5a9b54
  (list (normalize "title")
5a9b54
	(normalize "subtitle")
5a9b54
	(normalize "corpauthor")
5a9b54
	(normalize "authorgroup")
5a9b54
	(normalize "author")
5a9b54
	(normalize "orgname")
5a9b54
	(normalize "graphic")
5a9b54
	(normalize "copyright")
5a9b54
	(normalize "legalnotice")
5a9b54
	(normalize "releaseinfo")
5a9b54
	(normalize "publisher")
5a9b54
	(normalize "isbn")))
5a9b54
5a9b54
;;========================
5a9b54
;;Title Pages for Articles
5a9b54
;;========================
5a9b54
5a9b54
;;Should Articles have a TOC?
5a9b54
(define %generate-article-toc% 
5a9b54
  #t)
5a9b54
5a9b54
;;Which elements should appear 
5a9b54
;;on title page?
5a9b54
(define (article-titlepage-recto-elements)
5a9b54
  (list (normalize "title")
5a9b54
	(normalize "subtitle")
5a9b54
        (normalize "authorgroup")
5a9b54
        (normalize "copyright")
5a9b54
        (normalize "legalnotice")
5a9b54
        (normalize "abstract")))
5a9b54
5a9b54
;;How should elements on title page look?
5a9b54
(mode article-titlepage-recto-mode
5a9b54
5a9b54
;;Author name is too big - change it!
5a9b54
  (element author
5a9b54
    (let ((author-name  (author-string))
5a9b54
	  (author-affil (select-elements (children (current-node)) 
5a9b54
					 (normalize "affiliation"))))
5a9b54
      (make sequence      
5a9b54
	(make element gi: "H4"
5a9b54
	      attributes: (list (list "CLASS" (gi)))
5a9b54
	      (make element gi: "A"
5a9b54
		    attributes: (list (list "NAME" (element-id)))
5a9b54
		    (literal author-name)))
5a9b54
	(process-node-list author-affil))))
5a9b54
5a9b54
;;Address?
5a9b54
  (element address 
5a9b54
    (make sequence
5a9b54
      (make element gi: "DIV"
5a9b54
            attributes: (list (list "CLASS" (gi)))
5a9b54
            (process-children))))
5a9b54
5a9b54
;;Get rid of spam-producing "mailto" links
5a9b54
;;and get rid of email indentation  
5a9b54
  (element email
5a9b54
    (make sequence
5a9b54
      (make element gi: "DIV"
5a9b54
            attributes: (list (list "CLASS" (gi)))
5a9b54
            (process-children))))
5a9b54
5a9b54
;;Point Abstract to custom table function 
5a9b54
;;(See $dcm-abstract-object$ below. For default
5a9b54
;;use $semiformal-object$
5a9b54
  (element abstract
5a9b54
    (make element gi: "DIV"
5a9b54
          ($dcm-abstract-object$)))
5a9b54
5a9b54
  (element (abstract title) (empty-sosofo))
5a9b54
5a9b54
;;subtitle sizing
5a9b54
(element subtitle 
5a9b54
  (make element gi: "H4"
5a9b54
        attributes: (list (list "CLASS" (gi)))
5a9b54
        (process-children-trim))))
5a9b54
5a9b54
;;=================
5a9b54
;;    INLINES
5a9b54
;;=================
5a9b54
5a9b54
;Define my own series of fonts for various elements
5a9b54
(element application ($mono-seq$))
5a9b54
(element command ($bold-seq$))
5a9b54
(element filename ($mono-seq$))
5a9b54
(element function ($mono-seq$))
5a9b54
(element guibutton ($bold-seq$))
5a9b54
(element guiicon ($bold-seq$))
5a9b54
(element guilabel ($bold-mono-seq$))
5a9b54
(element guimenu ($bold-seq$))
5a9b54
(element guimenuitem ($bold-seq$))
5a9b54
(element guisubmenu ($bold-seq$))
5a9b54
(element hardware ($bold-mono-seq$))
5a9b54
(element keycap ($bold-seq$))
5a9b54
(element literal ($mono-seq$))
5a9b54
(element parameter ($italic-mono-seq$))
5a9b54
(element prompt ($mono-seq$))
5a9b54
(element symbol ($charseq$))
5a9b54
(element emphasis ($italic-seq$))
5a9b54
5a9b54
;;Show comment element?
5a9b54
(define %show-comments%
5a9b54
  #t)
5a9b54
5a9b54
;;====================
5a9b54
;; General Formatting
5a9b54
;;====================
5a9b54
5a9b54
;;Formal Paras are ugly by default!
5a9b54
;;Make the title run in - otherwise 
5a9b54
;;you should use a sect!
5a9b54
(element formalpara
5a9b54
  (make element gi: "DIV"
5a9b54
	attributes: (list
5a9b54
		     (list "CLASS" (gi)))
5a9b54
  	(make element gi: "P"
5a9b54
	      (process-children))))
5a9b54
5a9b54
;;This is the old one 
5a9b54
;(element (formalpara title) 
5a9b54
;($lowtitle$ 5))
5a9b54
5a9b54
;;This is the new one
5a9b54
(element (formalpara title) 
5a9b54
  (make element gi: "B"
5a9b54
	($runinhead$)))
5a9b54
5a9b54
;;Make captions come after objects in the list
5a9b54
(define ($object-titles-after$)
5a9b54
  (list (normalize "figure")))
5a9b54
5a9b54
5a9b54
;; Handle qanda labelling with Q: A:
5a9b54
(define (qanda-defaultlabel)
5a9b54
  (normalize "qanda"))
5a9b54
5a9b54
;;From FreeBSD Sheets (Thanks!) Display Q and A in bigger bolder fonts
5a9b54
5a9b54
(element question
5a9b54
  (let* ((chlist   (children (current-node)))
5a9b54
	 (firstch  (node-list-first chlist))
5a9b54
	 (restch   (node-list-rest chlist)))
5a9b54
    (make element gi: "DIV"
5a9b54
	  attributes: (list (list "CLASS" (gi)))
5a9b54
	  (make element gi: "P" 
5a9b54
		(make element gi: "BIG"
5a9b54
		      (make element gi: "A"
5a9b54
			    attributes: (list
5a9b54
					 (list "NAME" (element-id)))
5a9b54
			    (empty-sosofo))
5a9b54
		      (make element gi: "B"
5a9b54
			    (literal (question-answer-label
5a9b54
				      (current-node)) " ")
5a9b54
			    (process-node-list (children firstch)))))
5a9b54
	  (process-node-list restch))))
5a9b54
5a9b54
;;Literal Elements
5a9b54
5a9b54
;;Indent Literal layouts?
5a9b54
(define %indent-literallayout-lines% 
5a9b54
  #f)
5a9b54
5a9b54
;;Indent Programlistings?
5a9b54
(define %indent-programlisting-lines%
5a9b54
  #f)
5a9b54
5a9b54
;;Number lines in Programlistings?
5a9b54
(define %number-programlisting-lines%
5a9b54
 #f)
5a9b54
5a9b54
;;Should verbatim items be 'shaded' with a table?
5a9b54
(define %shade-verbatim% 
5a9b54
 #t)
5a9b54
5a9b54
;;Define shade-verbatim attributes
5a9b54
(define ($shade-verbatim-attr$)
5a9b54
 (list
5a9b54
  (list "BORDER" "0")
5a9b54
  (list "BGCOLOR" "#E0E0E0")
5a9b54
  (list "WIDTH" ($table-width$))))
5a9b54
5a9b54
;;===================
5a9b54
;;    Entities
5a9b54
;;===================
5a9b54
5a9b54
;;Netscape doesn't handle trademark 
5a9b54
;;entity right at all!! Get rid of it.
5a9b54
;;Make a TM in a superscipt font.
5a9b54
(element trademark
5a9b54
  (make sequence
5a9b54
    (process-children)
5a9b54
    (make element gi: "sup"
5a9b54
    (literal "TM"))))
5a9b54
5a9b54
5a9b54
;;===================
5a9b54
;; New Definitions
5a9b54
;;==================
5a9b54
5a9b54
(define ($dcm-abstract-object$)
5a9b54
   (make element gi: "TABLE"
5a9b54
        attributes: '(("BORDER" "0")
5a9b54
                      ("BGCOLOR" "#E0E0E0")
5a9b54
                      ("WIDTH" "50%")
5a9b54
                      ("CELLSPACING" "0")
5a9b54
                      ("CELLPADDING" "0")
5a9b54
                      ("ALIGN" "CENTER"))
5a9b54
        (make element gi: "TR"
5a9b54
              (make element gi: "TD"
5a9b54
                    attributes: '(("VALIGN" "TOP"))
5a9b54
                    (make element gi: "B"
5a9b54
                    (literal "Abstract"))))
5a9b54
        (make element gi: "TR"
5a9b54
              (make element gi: "TD"
5a9b54
                    attributes: '(("VALIGN" "TOP"))
5a9b54
                    (process-children)))))
5a9b54
5a9b54
;;Redefine Titlepage Separator on Articles
5a9b54
5a9b54
(define (article-titlepage-separator side)
5a9b54
  (make empty-element gi: "HR"
5a9b54
  attributes: '(("WIDTH" "75%")
5a9b54
                 ("ALIGN" "CENTER")
5a9b54
                 ("COLOR" "#000000")
5a9b54
                 ("SIZE" "1"))))
5a9b54
5a9b54
5a9b54
5a9b54
5a9b54
(define (chunk-element-list)
5a9b54
  (list (normalize "preface")
5a9b54
	(normalize "chapter")
5a9b54
	(normalize "appendix") 
5a9b54
	(normalize "article")
5a9b54
	(normalize "glossary")
5a9b54
	(normalize "bibliography")
5a9b54
	(normalize "index")
5a9b54
	(normalize "colophon")
5a9b54
	(normalize "setindex")
5a9b54
	(normalize "reference")
5a9b54
	(normalize "refentry")
5a9b54
	(normalize "part")
5a9b54
	(normalize "sect1") 
5a9b54
	(normalize "section") 
5a9b54
	(normalize "book") ;; just in case nothing else matches...
5a9b54
	(normalize "set")  ;; sets are definitely chunks...
5a9b54
	))
5a9b54
5a9b54
;;Do you want Callouts to be graphics?
5a9b54
(define %callout-graphics%
5a9b54
#f)
5a9b54
5a9b54
5a9b54
;;Make Callout graphics PNGs
5a9b54
(define %callout-graphics-path%
5a9b54
  "./imagelib/callouts/")
5a9b54
5a9b54
  ;; Redefine $callout-bug$ to support the %callout-graphic-ext%
5a9b54
  ;; variable.
5a9b54
  (define ($callout-bug$ conumber)
5a9b54
    (let ((number (if conumber (format-number conumber "1") "0")))
5a9b54
      (if conumber
5a9b54
          (if %callout-graphics%
5a9b54
              (if (<= conumber %callout-graphics-number-limit%)
5a9b54
                  (make empty-element gi: "IMG"
5a9b54
                        attributes: (list (list "SRC"
5a9b54
                                                (root-rel-path
5a9b54
                                                 (string-append
5a9b54
                                                  %callout-graphics-path%
5a9b54
                                                  number
5a9b54
                                                  %callout-graphics-ext%)))
5a9b54
                                          (list "HSPACE" "0")
5a9b54
                                          (list "VSPACE" "0")
5a9b54
                                          (list "BORDER" "0")
5a9b54
                                          (list "ALT"
5a9b54
                                                (string-append
5a9b54
                                                 "(" number ")"))))
5a9b54
                  (make element gi: "B"
5a9b54
                        (literal "(" (format-number conumber "1") ")")))
5a9b54
              (make element gi: "B"
5a9b54
                    (literal "(" (format-number conumber "1") ")")))
5a9b54
          (make element gi: "B"
5a9b54
         (literal "(??)")))))
5a9b54
5a9b54
</style-specification-body>
5a9b54
</style-specification>
5a9b54
5a9b54
<external-specification id="docbook" document="docbook.dsl">
5a9b54
5a9b54
</style-sheet>