forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Wheller <s...@inwords.co.za>
Subject Re: Docbook as forrest-plugin
Date Mon, 25 Oct 2004 17:46:45 GMT
On Monday 25 October 2004 18:47, Ross Gardler wrote:
> > Project Specific Customizations? Use case Docbook Customization Layers.
>
> Sorry I am not familiar with Docbook, can you expand on this a little.

The basic idea is that one does not want to add customizations to the DTD or 
XSL's distributed by the Docbook Project. So you make a custom layer that 
acts as your driver. Instead of calling the "docbook.xsl" you call "your.xsl" 
that imports or includes the "docbook.xsl." The custom layer passes params 
and templates that overide or extend defaults.

This is great since you can customize at lib and when the next release of the 
DTD or XSL's arrives just knockout the old version from under your system and 
use the new version without having to track all your customizations and redo 
them in the new versions of the DTD or XSL.

Example of my HTML Custom Layer

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">
    <!-- This file is a customization layer for HTML only -->
    <!-- ======================= -->
    <!-- Imports -->
    <!--
    PATH MAPPED BY 
    catalog.xml href="/usr/share/xml/docbook/stylesheet/nwalsh/current/html/"
    Comment/Uncomment xsl:imports as required.
    -->
    
    <!--<xsl:import href="html-docbook.xsl"/>-->
    <xsl:import href="html-profile-chunk.xsl"/>
    <xsl:include href="common-cust.xsl"/>
    
    <!-- ======================= -->
    <!-- Parameters -->
    <!-- ======================= -->
    <xsl:param name="profile.condition" select="'html'"/>
    <xsl:param name="base.dir" select="'../dist/html-docs/'"/>
    <xsl:param name="generate.legalnotice.link" select="1"/>
    <xsl:param name="chunker.output.indent" select="'yes'"/>
    <xsl:param name="body.font.master" select="12"/>
    <xsl:param name="html.stylesheet" select="'corpstyle.css'"/>
    <xsl:param name="navig.graphics" select="1"/>
    <xsl:param name="navig.graphics.path" select="'../images'"/>
    <xsl:param name="navig.graphics.extension" select="'.gif'"/>
    <xsl:param name="navig.showtitles" select="1"/>
    
   <!-- Admon Graphics -->
    <xsl:param name="admon.graphics" select="1"/>
    <xsl:param name="admon.textlabel" select="0"/>
    <xsl:param name="admon.graphics.path" select="'../images/admon/'"/>
    <xsl:param name="admon.graphics.extension" select="'.png'"/>
    
    <!-- Callout Graphics -->
    <xsl:param name="callout.unicode" select="1"/>
    <xsl:param name="callout.graphics" select="0"/>
    <xsl:param name="callout.graphics.path" 
select="'../../images/callouts/'"/>
    <xsl:param name="callout.graphics.extension" select="'.png'"/>
</xsl:stylesheet>

Here is the common-cust.xsl it hold customizations that are common to both 
HTML and FO.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">
    
    <!-- ======================= -->
    <!-- Parameters -->
    <!-- ======================= -->
    
    <!-- Extensions -->
    <xsl:param name="use.extensions" select="1"/>
    <xsl:param name="saxon.extensions" select="1"/>
    <xsl:param name="tablecolumns.extension" select="1"/>
    <xsl:param name="callouts.extensions" select="1"/>
    
    <!-- General Formatting-->
    <xsl:param name="draft.mode" select="'no'"/>
    <xsl:param name="variablelist.as.blocks" select="1"/>
    <xsl:param name="shade.verbatim" select="1"/>
    <xsl:param name="hyphenate">false</xsl:param>
    <xsl:param name="alignment">left</xsl:param>
    
    <!-- Enumeration -->
    <xsl:param name="label.from.part" select="'1'"></xsl:param>
    
    <!-- Cross References -->
    <xsl:param name="insert.xref.page.number" select="1"/>
    <xsl:param name="xref.with.number.and.title" select="0"/>
    
    <!-- Indexes -->
    <xsl:param name="generate.index" select="1"/>
    
    <!-- Glossaries -->
    <xsl:param name="glossterm.auto.link" select="1"/>
    <xsl:param name="firstterm.only.link" select="1"/>
    <xsl:param name="glossary.collection">glossary.xml</xsl:param>
    <xsl:param name="glossentry.show.acronym" select="'primary'"/>
    
    <!-- Captions -->
    <xsl:param name="formal.title.placement">
        figure before
        example before 
        equation before 
        table before 
        procedure before
    </xsl:param>
    
    <!-- ======================= -->
    <!-- Templates -->
    <!-- ======================= -->

    <!-- Inline Formatting -->
    <xsl:template match="filename">
      <xsl:call-template name="inline.boldmonoseq"/>
    </xsl:template>
    <xsl:template match="application">
      <xsl:call-template name="inline.boldseq"/>
    </xsl:template>
    <xsl:template match="guibutton">
      <xsl:call-template name="inline.boldseq"/>
    </xsl:template>
    <xsl:template match="guilabel">
      <xsl:call-template name="inline.italicseq"/>
    </xsl:template>
    
    
</xsl:stylesheet>
-- 
Sean Wheller
Technical Author
sean@inwords.co.za
http://www.inwords.co.za

Mime
View raw message