From: Norman W. <nw...@us...> - 2006-01-16 13:56:22
|
Update of /cvsroot/docbook/xsl2/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1112 Modified Files: admonitions.xsl Log Message: Revert to HTML tables for alignment; omit ghost:titles in the graphical case. Index: admonitions.xsl =================================================================== RCS file: /cvsroot/docbook/xsl2/html/admonitions.xsl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -U2 -r1.5 -r1.6 --- admonitions.xsl 28 Dec 2005 13:51:48 -0000 1.5 +++ admonitions.xsl 16 Jan 2006 13:56:07 -0000 1.6 @@ -6,13 +6,15 @@ xmlns:m="http://docbook.org/xslt/ns/mode" xmlns:fn="http://www.w3.org/2005/xpath-functions" + xmlns:ghost="http://docbook.org/ns/docbook/ephemeral" xmlns:db="http://docbook.org/ns/docbook" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" - exclude-result-prefixes="h f m fn db doc xs" + exclude-result-prefixes="h f m fn db doc xs ghost" version="2.0"> -<xsl:variable name="admon.graphics" select="0"/> -<xsl:variable name="admon.graphics.path" select="'../xsl/images/'"/> -<xsl:variable name="admon.graphics.extension" select="'.png'"/> +<xsl:param name="admon.graphics" select="0"/> +<xsl:param name="admon.graphics.path" select="'../xsl/images/'"/> +<xsl:param name="admon.graphics.extension" select="'.png'"/> +<xsl:param name="admon.default.titles" select="1"/> <xsl:template match="db:note|db:important|db:warning|db:caution|db:tip"> @@ -78,29 +80,40 @@ </xsl:variable> + <!-- I'd really rather not do this with a table, but getting the --> + <!-- alignment with and without a title without using a table is --> + <!-- painfully complicated. That said, the vertical spacing is --> + <!-- awfully complicated with a table. --> + <div class="{f:admonition-class(.)}"> <xsl:call-template name="id"/> <xsl:call-template name="class"/> - - <div class="admon-title"> - <span class="admon-graphic"> - <img alt="{$alt}"> - <xsl:attribute name="src"> - <xsl:call-template name="admonition-graphic"/> - </xsl:attribute> - </img> - </span> - - <xsl:if test="db:info/db:title"> - <span class="admon-title-text"> - <xsl:call-template name="titlepage"> - <xsl:with-param name="content" select="$titlepage"/> - </xsl:call-template> - </span> - </xsl:if> - </div> - - <div class="admon-text"> - <xsl:apply-templates/> - </div> + <table border="0" cellspacing="0" cellpadding="4"> + <tbody> + <tr> + <td valign="top"> + <span class="admon-graphic"> + <img alt="{$alt}"> + <xsl:attribute name="src"> + <xsl:call-template name="admonition-graphic"/> + </xsl:attribute> + </img> + </span> + </td> + <td> + <xsl:if test="db:info/db:title[not(@ghost:title) + or $admon.default.titles != 0]"> + <div class="admon-title-text"> + <xsl:call-template name="titlepage"> + <xsl:with-param name="content" select="$titlepage"/> + </xsl:call-template> + </div> + </xsl:if> + <div class="admon-text"> + <xsl:apply-templates/> + </div> + </td> + </tr> + </tbody> + </table> </div> </xsl:template> |