Blame Manuals/Docbook/repository.dsl

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