Blame SOURCES/gdp-both.dsl

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