Blame SOURCES/gdp-both.dsl

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