Blame SOURCES/gdp-both.dsl

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