source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/admon.xsl@ 58675ce

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 58675ce was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 4.6 KB
Line 
1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4 version='1.0'>
5
6<!-- ********************************************************************
7 $Id: admon.xsl 9647 2012-10-26 17:42:03Z bobstayton $
8 ********************************************************************
9
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://docbook.sf.net/release/xsl/current/ for
12 copyright and other information.
13
14 ******************************************************************** -->
15
16<xsl:template match="note|important|warning|caution|tip">
17 <xsl:choose>
18 <xsl:when test="$admon.graphics != 0">
19 <xsl:call-template name="graphical.admonition"/>
20 </xsl:when>
21 <xsl:otherwise>
22 <xsl:call-template name="nongraphical.admonition"/>
23 </xsl:otherwise>
24 </xsl:choose>
25</xsl:template>
26
27<xsl:template match="*" mode="admon.graphic.width">
28 <xsl:param name="node" select="."/>
29 <xsl:text>36pt</xsl:text>
30</xsl:template>
31
32<xsl:template name="admon.graphic">
33 <xsl:param name="node" select="."/>
34
35 <xsl:variable name="filename">
36 <xsl:value-of select="$admon.graphics.path"/>
37 <xsl:choose>
38 <xsl:when test="local-name($node)='note'">note</xsl:when>
39 <xsl:when test="local-name($node)='warning'">warning</xsl:when>
40 <xsl:when test="local-name($node)='caution'">caution</xsl:when>
41 <xsl:when test="local-name($node)='tip'">tip</xsl:when>
42 <xsl:when test="local-name($node)='important'">important</xsl:when>
43 <xsl:otherwise>note</xsl:otherwise>
44 </xsl:choose>
45 <xsl:value-of select="$admon.graphics.extension"/>
46 </xsl:variable>
47
48 <xsl:choose>
49 <xsl:when test="$fop.extensions != 0
50 or $arbortext.extensions != 0">
51 <xsl:value-of select="$filename"/>
52 </xsl:when>
53 <xsl:otherwise>
54 <xsl:text>url(</xsl:text>
55 <xsl:value-of select="$filename"/>
56 <xsl:text>)</xsl:text>
57 </xsl:otherwise>
58 </xsl:choose>
59</xsl:template>
60
61<xsl:template name="graphical.admonition">
62 <xsl:variable name="id">
63 <xsl:call-template name="object.id"/>
64 </xsl:variable>
65 <xsl:variable name="graphic.width">
66 <xsl:apply-templates select="." mode="admon.graphic.width"/>
67 </xsl:variable>
68
69 <fo:block id="{$id}"
70 xsl:use-attribute-sets="graphical.admonition.properties">
71 <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt"
72 provisional-label-separation="18pt">
73 <fo:list-item>
74 <fo:list-item-label end-indent="label-end()">
75 <fo:block>
76 <fo:external-graphic width="auto" height="auto"
77 content-width="{$graphic.width}" >
78 <xsl:attribute name="src">
79 <xsl:call-template name="admon.graphic"/>
80 </xsl:attribute>
81 </fo:external-graphic>
82 </fo:block>
83 </fo:list-item-label>
84 <fo:list-item-body start-indent="body-start()">
85 <xsl:if test="$admon.textlabel != 0 or title or info/title">
86 <fo:block xsl:use-attribute-sets="admonition.title.properties">
87 <xsl:apply-templates select="." mode="object.title.markup">
88 <xsl:with-param name="allow-anchors" select="1"/>
89 </xsl:apply-templates>
90 </fo:block>
91 </xsl:if>
92 <fo:block xsl:use-attribute-sets="admonition.properties">
93 <xsl:apply-templates/>
94 </fo:block>
95 </fo:list-item-body>
96 </fo:list-item>
97 </fo:list-block>
98 </fo:block>
99</xsl:template>
100
101<xsl:template name="nongraphical.admonition">
102 <xsl:variable name="id">
103 <xsl:call-template name="object.id"/>
104 </xsl:variable>
105
106 <fo:block id="{$id}"
107 xsl:use-attribute-sets="nongraphical.admonition.properties">
108 <xsl:if test="$admon.textlabel != 0 or title or info/title">
109 <fo:block keep-with-next.within-column='always'
110 xsl:use-attribute-sets="admonition.title.properties">
111 <xsl:apply-templates select="." mode="object.title.markup">
112 <xsl:with-param name="allow-anchors" select="1"/>
113 </xsl:apply-templates>
114 </fo:block>
115 </xsl:if>
116
117 <fo:block xsl:use-attribute-sets="admonition.properties">
118 <xsl:apply-templates/>
119 </fo:block>
120 </fo:block>
121</xsl:template>
122
123<xsl:template match="note/title"></xsl:template>
124<xsl:template match="important/title"></xsl:template>
125<xsl:template match="warning/title"></xsl:template>
126<xsl:template match="caution/title"></xsl:template>
127<xsl:template match="tip/title"></xsl:template>
128
129</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.