ldp-docbook-stylesheets-0.0.20040321.orig/ 0000755 0001750 0001750 00000000000 10156701305 020163 5 ustar djpig djpig 0000000 0000000 ldp-docbook-stylesheets-0.0.20040321.orig/DSSSL/ 0000755 0001750 0001750 00000000000 10156701167 021061 5 ustar djpig djpig 0000000 0000000 ldp-docbook-stylesheets-0.0.20040321.orig/DSSSL/ldp.dsl 0000644 0001750 0001750 00000024672 10156677226 022367 0 ustar djpig djpig 0000000 0000000
]]>
]]>
]>
;; ------------------------------------------------------------------------
;; ldp.dsl - LDP Customized DSSSL Stylesheet
;; v1.12, 2003-03-19
;; Copyright (C) 2000-2003
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;; ------------------------------------------------------------------------
;; customize the print stylesheet
(declare-characteristic preserve-sdata?
;; this is necessary because right now jadetex does not understand
;; symbolic entities, whereas things work well with numeric entities.
"UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
#f)
(define %generate-article-toc%
;; Should a Table of Contents be produced for Articles?
#t)
(define (toc-depth nd)
4)
(define %generate-article-titlepage-on-separate-page%
;; Should the article title page be on a separate page?
#t)
(define %section-autolabel%
;; Are sections enumerated?
#t)
(define %footnote-ulinks%
;; Generate footnotes for ULinks?
#f)
(define %bop-footnotes%
;; Make "bottom-of-page" footnotes?
#f)
(define %body-start-indent%
;; Default indent of body text
0pi)
(define %para-indent-firstpara%
;; First line start-indent for the first paragraph
0pt)
(define %para-indent%
;; First line start-indent for paragraphs (other than the first)
0pt)
(define %block-start-indent%
;; Extra start-indent for block-elements
0pt)
(define formal-object-float
;; Do formal objects float?
#t)
(define %hyphenation%
;; Allow automatic hyphenation?
#t)
(define %admon-graphics%
;; Use graphics in admonitions?
#f)
(define %default-quadding%
;; Full justification.
'justify)
(define (book-titlepage-verso-elements)
;;added publisher, releaseinfo to the default list
(list (normalize "title")
(normalize "subtitle")
(normalize "corpauthor")
(normalize "authorgroup")
(normalize "author")
(normalize "publisher")
(normalize "releaseinfo")
(normalize "editor")
(normalize "edition")
(normalize "pubdate")
(normalize "copyright")
(normalize "isbn")
(normalize "abstract")
(normalize "legalnotice")
(normalize "revhistory")))
(declare-characteristic preserve-sdata?
;; this is necessary because right now jadetex does not understand
;; symbolic entities, whereas things work well with numeric entities.
"UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
#f)
(declare-flow-object-class element
;; for redhat
"UNREGISTERED::James Clark//Flow Object Class::element")
(define %generate-legalnotice-link%
;; put the legal notice in a separate file
#t)
(define %admon-graphics-path%
;; use graphics in admonitions, set their
"../images/")
(define %admon-graphics%
#t)
(define %funcsynopsis-decoration%
;; make funcsynopsis look pretty
#t)
(define %html-ext%
;; when producing HTML files, use this extension
".html")
(define %generate-book-toc%
;; Should a Table of Contents be produced for books?
#t)
(define %generate-article-toc%
;; Should a Table of Contents be produced for articles?
#t)
(define %generate-part-toc%
;; Should a Table of Contents be produced for parts?
#t)
(define %generate-book-titlepage%
;; produce a title page for books
#t)
(define %generate-article-titlepage%
;; produce a title page for articles
#t)
(define (chunk-skip-first-element-list)
;; forces the Table of Contents on separate page
'())
(define (list-element-list)
;; fixes bug in Table of Contents generation
'())
(define %root-filename%
;; The filename of the root HTML document (e.g, "index").
"index")
(define %shade-verbatim%
;; verbatim sections will be shaded if t(rue)
#t)
(define %use-id-as-filename%
;; Use ID attributes as name for component HTML files?
#t)
(define %graphic-extensions%
;; graphic extensions allowed
'("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" ))
(define %graphic-default-extension%
"gif")
(define %section-autolabel%
;; For enumerated sections (1.1, 1.1.1, 1.2, etc.)
#t)
(define (toc-depth nd)
;; more depth (2 levels) to toc; instead of flat hierarchy
2)
(element emphasis
;; make role=strong equate to bold for emphasis tag
(if (equal? (attribute-string "role") "strong")
(make element gi: "STRONG" (process-children))
(make element gi: "EM" (process-children))))
(define (book-titlepage-recto-elements)
;; elements on a book's titlepage
(list (normalize "title")
(normalize "subtitle")
(normalize "graphic")
(normalize "mediaobject")
(normalize "corpauthor")
(normalize "authorgroup")
(normalize "author")
(normalize "othercredit")
(normalize "contrib")
(normalize "edition")
(normalize "releaseinfo")
(normalize "publisher")
(normalize "editor")
(normalize "copyright")
(normalize "pubdate")
(normalize "revhistory")
(normalize "abstract")
(normalize "legalnotice")))
(define (article-titlepage-recto-elements)
;; elements on an article's titlepage
(list (normalize "title")
(normalize "subtitle")
(normalize "authorgroup")
(normalize "author")
(normalize "othercredit")
(normalize "releaseinfo")
(normalize "copyright")
(normalize "pubdate")
(normalize "revhistory")
(normalize "abstract")
(normalize "legalnotice")))
(define (process-contrib #!optional (sosofo (process-children)))
;; print out with othercredit information; for translators, etc.
(make sequence
(make element gi: "SPAN"
attributes: (list (list "CLASS" (gi)))
(process-children))))
(define (process-othercredit #!optional (sosofo (process-children)))
;; print out othercredit information; for translators, etc.
(let ((author-name (author-string))
(author-contrib (select-elements (children (current-node))
(normalize "contrib"))))
(make element gi: "P"
attributes: (list (list "CLASS" (gi)))
(make element gi: "B"
(literal author-name)
(literal " - "))
(process-node-list author-contrib))))
(mode article-titlepage-recto-mode
(element contrib (process-contrib))
(element othercredit (process-othercredit))
)
(mode book-titlepage-recto-mode
(element contrib (process-contrib))
(element othercredit (process-othercredit))
)
(define (article-title nd)
(let* ((artchild (children nd))
(artheader (select-elements artchild (normalize "artheader")))
(artinfo (select-elements artchild (normalize "articleinfo")))
(ahdr (if (node-list-empty? artheader)
artinfo
artheader))
(ahtitles (select-elements (children ahdr)
(normalize "title")))
(artitles (select-elements artchild (normalize "title")))
(titles (if (node-list-empty? artitles)
ahtitles
artitles)))
(if (node-list-empty? titles)
""
(node-list-first titles))))
(mode subtitle-mode
;; do not print subtitle on subsequent pages
(element subtitle (empty-sosofo)))
;; Redefinition of $verbatim-display$
;; Origin: dbverb.dsl
;; Different foreground and background colors for verbatim elements
;; Author: Philippe Martin (feloy@free.fr) 2001-04-07
(define ($verbatim-display$ indent line-numbers?)
(let ((verbatim-element (gi))
(content (make element gi: "PRE"
attributes: (list
(list "CLASS" (gi)))
(if (or indent line-numbers?)
($verbatim-line-by-line$ indent line-numbers?)
(process-children)))))
(if %shade-verbatim%
(make element gi: "TABLE"
attributes: (shade-verbatim-attr-element verbatim-element)
(make element gi: "TR"
(make element gi: "TD"
(make element gi: "FONT"
attributes: (list
(list "COLOR" (car (shade-verbatim-element-colors
verbatim-element))))
content))))
content)))
;;
;; Customize this function
;; to change the foreground and background colors
;; of the different verbatim elements
;; Return (list "foreground color" "background color")
;;
(define (shade-verbatim-element-colors element)
(case element
(("SYNOPSIS") (list "#000000" "#6495ED"))
;; ...
;; Add your verbatim elements here
;; ...
(else (list "#000000" "#E0E0E0"))))
(define (shade-verbatim-attr-element element)
(list
(list "BORDER"
(cond
((equal? element (normalize "SCREEN")) "1")
(else "0")))
(list "BGCOLOR" (car (cdr (shade-verbatim-element-colors element))))
(list "WIDTH" ($table-width$))))
;; End of $verbatim-display$ redefinition
ldp-docbook-stylesheets-0.0.20040321.orig/XSL/ 0000755 0001750 0001750 00000000000 10156700722 020633 5 ustar djpig djpig 0000000 0000000 ldp-docbook-stylesheets-0.0.20040321.orig/XSL/doc/ 0000755 0001750 0001750 00000000000 10027374766 021414 5 ustar djpig djpig 0000000 0000000 ldp-docbook-stylesheets-0.0.20040321.orig/XSL/doc/tldp-xsl-howto.xml 0000644 0001750 0001750 00000023601 10027355005 025026 0 ustar djpig djpig 0000000 0000000
TLDP-XSL HOWTO
David
Horton
This document provides instructions for installing the TLDP XSL
style sheets and using them to produce various output formats from DocBook
XML source files.
Introduction
About TLDP-XSL
The TLDP-XSL package is a customization layer for the standard
DocBook XSL style sheets. The customizations include things like
automatic numbering for chapters and sections as well as controlling how
documents are broken into multiple HTML pages. For additional
information about these customizations, please refer to the comments
within the XSL files in the html and
fo directories of the tldp-xsl package.
Legal Information
Copyright (c) 2003 David Horton
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation
License, Version 1.2 or any later version published by the Free
Software Foundation; with no Invariant Sections, no Front-Cover Texts,
and no Back-Cover Texts. A copy of the license is included in the file
license.txt.
This documentation is provided as-is with no warranty of any kind,
either expressed or implied, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose. Use
the concepts, examples and information at your own risk. The author(s)
do not take any responsibility for damages that may arise from the use
of this document.
All copyrights are held by their respective owners, unless
specifically noted otherwise. Use of a term in this document should not
be regarded as affecting the validity of any trademark or service mark.
Naming of particular products or brands should not be seen as
endorsements.
Installing
Installation is very straightforward and simply involves copying the
TLDP-XSL style sheets into the appropriate directories of the DocBook XSL
style sheet package.
Prerequisites
The following tasks should be completed prior to installation of
the TLDP-XSL style sheets:
Download Norman Walsh's docbook-xsl style
sheet package and copy the contents of the package into an
appropriate directory on the target system. The actual directory
path is not critical, just make a note of where the files are
placed.
Download the latest version of the tldp-xsl
package.
Installation
Once the prerequisites are taken care of, installation is
easy.
Copy all of the files from the tldp-xsl package
html directory into the
html directory of Norman Walsh's style
sheets.
Copy the file from the tldp-xsl package
fo directory into the fo
directory of Norman Walsh's style sheets.
Processing
Using the XSL style sheets to produce HTML output requires an XSLT
processor. Producing other output types, like PDF, requires a Formatting
Objects (FO) processor. These style sheets have been tested with xsltproc,
the Saxon-6.5.2 XSLT processor and the Apache fop-0.20.5 formatting
objects processor, but any processor that is compatible with the target
system should work equally well.
Processor installation is beyond the scope of this document.
Please refer to the instructions included with the chosen
product.
There are several different XSL style sheets in the tldp-xsl package
and each one is intended to address a particular formatting task. The
style sheets and their intended uses are summarized below:
fo/tldp-print.xsl works with a formatting
objects (FO) processor to create PDF and other non-HTML formatted
documents. This type of document is good to use when printed output is
desired.
html/tldp-single-page.xsl places all
document output on a single HTML page. This works well for short,
on-line documents like FAQ's or mini-HOWTO's.
html/tldp-sections.xsl divides the document
into sections with each section having a separate HTML page. This is
good for producing HOWTO documents for on-line viewing.
html/tldp-chapters.xsl divides the document
into chapters, each having a separate HTML page. This style sheet can
be used as an alternative to tldp-sections.xsl to
provide better continuity in the document.
the tldp-common.xsl file is intended to be
used by other XSL style sheets and should not be
called directly in an attempt to produce HTML output.
The sections below give some examples of how to use the XSL style
sheets to produce different types of output with various processors.
Please be aware that file names and paths may be different on the target
system and will need to be adjusted accordingly.
HTML Output Examples
This example shows the style sheets being used to create a
single-page HTML document with xsltproc on a
GNU/Linux platform:
xsltproc -o faq.html ~/docbook-xsl/html/tldp-one-page.xsl faq.xml
Here is an example using the style sheets with Instant Saxon on a
Windows platform to create multiple-page HTML output with each section
on its own HTML page:
cd output_dir
saxon c:\source_dir\howto.xml c:\docbook-xsl\html\tldp-sections.xsl
It is also possible to create multiple-page HTML documents with
each chapter on its own HTML page as show in this example:
xsltproc ~/docbook-xsl/html/tldp-chapters.xsl ~/xml-files/howto.xml
Examples of Other File Formats
The following example uses the tldp-print.xsl
style sheet with Apache
FOP to create a .PDF document:
fop -xml guide.xml -xsl ~/docbook-xsl/fo/tldp-print.xsl -pdf guide.pdf
The tldp-print.xsl stylesheet and Apache FOP
may also be used to produce formatted output in an on-screen window or
send formatted output directly to a printer. Examples of this are shown
below:
fop -xml howto.xml -xsl ~/docbook-xsl/fo/tldp-print.xsl -awt
fop -xml howto.xml -xsl ~/docbook-xsl/fo/tldp-print.xsl -print
It is theoretically possible to produce other types of output,
however the examples shown above are give the best results at this time.
Check the Apache FOP home
page to see which other output types are supported and what the
current limitations are for those formats.
Styling HTML With CSS
HTML produced by the tldp-xsl package contains a
link tag that refers to a cascading style sheet called
style.css. To add some style to HTML output simply
copy any valid CSS file with the name style.css into
the directory that contains the HTML document. A sample
style.css is included in the doc
directory of this package and is used to style the HTML version of this
howto. Browsers that do not support CSS should probably ignore the link
with no ill effects.
For information on CSS visit http://www.w3c.org/Style/CSS.
Feedback
Please send feedback concerning this document and the tldp-xsl style
sheets to dhorton@NOSPAM.member.fsf.org