diff options
author | Matthew Burgess <matthew@linuxfromscratch.org> | 2013-10-08 20:03:29 +0000 |
---|---|---|
committer | Matthew Burgess <matthew@linuxfromscratch.org> | 2013-10-08 20:03:29 +0000 |
commit | 15c7d39533a1eb1da0748011f3378fd0f02ed14d (patch) | |
tree | a7ed12df60c5ffd4d00a570804c51470bfb8b0f5 /stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/admon.xsl | |
parent | 09a35dd7178070f01a7961d2ded39e11ba2aac83 (diff) |
Update stylesheets to docbook-xsl-1.78.1.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/admon.xsl')
-rw-r--r-- | stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/admon.xsl | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/admon.xsl b/stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/admon.xsl new file mode 100644 index 000000000..67bf158d0 --- /dev/null +++ b/stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/admon.xsl @@ -0,0 +1,129 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + version='1.0'> + +<!-- ******************************************************************** + $Id: admon.xsl 9647 2012-10-26 17:42:03Z bobstayton $ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://docbook.sf.net/release/xsl/current/ for + copyright and other information. + + ******************************************************************** --> + +<xsl:template match="note|important|warning|caution|tip"> + <xsl:choose> + <xsl:when test="$admon.graphics != 0"> + <xsl:call-template name="graphical.admonition"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="nongraphical.admonition"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="*" mode="admon.graphic.width"> + <xsl:param name="node" select="."/> + <xsl:text>36pt</xsl:text> +</xsl:template> + +<xsl:template name="admon.graphic"> + <xsl:param name="node" select="."/> + + <xsl:variable name="filename"> + <xsl:value-of select="$admon.graphics.path"/> + <xsl:choose> + <xsl:when test="local-name($node)='note'">note</xsl:when> + <xsl:when test="local-name($node)='warning'">warning</xsl:when> + <xsl:when test="local-name($node)='caution'">caution</xsl:when> + <xsl:when test="local-name($node)='tip'">tip</xsl:when> + <xsl:when test="local-name($node)='important'">important</xsl:when> + <xsl:otherwise>note</xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$admon.graphics.extension"/> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$fop.extensions != 0 + or $arbortext.extensions != 0"> + <xsl:value-of select="$filename"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>url(</xsl:text> + <xsl:value-of select="$filename"/> + <xsl:text>)</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="graphical.admonition"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:variable name="graphic.width"> + <xsl:apply-templates select="." mode="admon.graphic.width"/> + </xsl:variable> + + <fo:block id="{$id}" + xsl:use-attribute-sets="graphical.admonition.properties"> + <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt" + provisional-label-separation="18pt"> + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block> + <fo:external-graphic width="auto" height="auto" + content-width="{$graphic.width}" > + <xsl:attribute name="src"> + <xsl:call-template name="admon.graphic"/> + </xsl:attribute> + </fo:external-graphic> + </fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <xsl:if test="$admon.textlabel != 0 or title or info/title"> + <fo:block xsl:use-attribute-sets="admonition.title.properties"> + <xsl:apply-templates select="." mode="object.title.markup"> + <xsl:with-param name="allow-anchors" select="1"/> + </xsl:apply-templates> + </fo:block> + </xsl:if> + <fo:block xsl:use-attribute-sets="admonition.properties"> + <xsl:apply-templates/> + </fo:block> + </fo:list-item-body> + </fo:list-item> + </fo:list-block> + </fo:block> +</xsl:template> + +<xsl:template name="nongraphical.admonition"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <fo:block id="{$id}" + xsl:use-attribute-sets="nongraphical.admonition.properties"> + <xsl:if test="$admon.textlabel != 0 or title or info/title"> + <fo:block keep-with-next.within-column='always' + xsl:use-attribute-sets="admonition.title.properties"> + <xsl:apply-templates select="." mode="object.title.markup"> + <xsl:with-param name="allow-anchors" select="1"/> + </xsl:apply-templates> + </fo:block> + </xsl:if> + + <fo:block xsl:use-attribute-sets="admonition.properties"> + <xsl:apply-templates/> + </fo:block> + </fo:block> +</xsl:template> + +<xsl:template match="note/title"></xsl:template> +<xsl:template match="important/title"></xsl:template> +<xsl:template match="warning/title"></xsl:template> +<xsl:template match="caution/title"></xsl:template> +<xsl:template match="tip/title"></xsl:template> + +</xsl:stylesheet> |