source: stylesheets/pdf/lfs-admon.xsl@ 192ac08

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 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 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 192ac08 was 192ac08, checked in by Matthew Burgess <matthew@…>, 17 years ago

Import the admonition graphics from the DocBook-XSL package.

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

  • Property mode set to 100644
File size: 3.7 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:fo="http://www.w3.org/1999/XSL/Format"
5 version="1.0">
6
7
8 <!-- Graphics in admonitions -->
9 <xsl:param name="admon.graphics" select="1"/>
10 <xsl:param name="admon.graphics.path" select="'images/'"/>
11
12 <!-- Admonition block properties -->
13 <xsl:template match="important|warning|caution">
14 <xsl:choose>
15 <xsl:when test="$admon.graphics != 0">
16 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
17 space-before.maximum="0.8em" border-style="solid" border-width="1pt"
18 border-color="#500" background-color="#FFFFE6">
19 <xsl:call-template name="graphical.admonition"/>
20 </fo:block>
21 </xsl:when>
22 <xsl:otherwise>
23 <xsl:call-template name="nongraphical.admonition"/>
24 </xsl:otherwise>
25 </xsl:choose>
26 </xsl:template>
27
28 <xsl:template match="note|tip">
29 <xsl:choose>
30 <xsl:when test="$admon.graphics != 0">
31 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
32 space-before.maximum="0.8em" border-style="solid" border-width="1pt"
33 border-color="#E0E0E0" background-color="#FFFFE6">
34 <xsl:call-template name="graphical.admonition"/>
35 </fo:block>
36 </xsl:when>
37 <xsl:otherwise>
38 <xsl:call-template name="nongraphical.admonition"/>
39 </xsl:otherwise>
40 </xsl:choose>
41 </xsl:template>
42
43 <!-- Admonitions text properties -->
44 <xsl:attribute-set name="admonition.properties">
45 <xsl:attribute name="margin-right">6pt</xsl:attribute>
46 </xsl:attribute-set>
47
48 <!-- Adding left space to the graphics and color to the titles -->
49 <xsl:template name="graphical.admonition">
50 <xsl:variable name="id">
51 <xsl:call-template name="object.id"/>
52 </xsl:variable>
53 <xsl:variable name="graphic.width">
54 <xsl:apply-templates select="." mode="admon.graphic.width"/>
55 </xsl:variable>
56 <fo:block id="{$id}">
57 <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt"
58 provisional-label-separation="18pt" xsl:use-attribute-sets="list.block.spacing">
59 <fo:list-item>
60 <fo:list-item-label end-indent="label-end()">
61 <fo:block margin-left="18pt">
62 <fo:external-graphic width="auto" height="auto"
63 content-width="{$graphic.width}" >
64 <xsl:attribute name="src">
65 <xsl:call-template name="admon.graphic"/>
66 </xsl:attribute>
67 </fo:external-graphic>
68 </fo:block>
69 </fo:list-item-label>
70 <fo:list-item-body start-indent="body-start()">
71 <xsl:if test="$admon.textlabel != 0 or title">
72 <fo:block xsl:use-attribute-sets="admonition.title.properties">
73 <xsl:if test="ancestor-or-self::important">
74 <xsl:attribute name="color">#500</xsl:attribute>
75 </xsl:if>
76 <xsl:if test="ancestor-or-self::warning">
77 <xsl:attribute name="color">#500</xsl:attribute>
78 </xsl:if>
79 <xsl:if test="ancestor-or-self::caution">
80 <xsl:attribute name="color">#500</xsl:attribute>
81 </xsl:if>
82 <xsl:apply-templates select="." mode="object.title.markup"/>
83 </fo:block>
84 </xsl:if>
85 <fo:block xsl:use-attribute-sets="admonition.properties">
86 <xsl:apply-templates/>
87 </fo:block>
88 </fo:list-item-body>
89 </fo:list-item>
90 </fo:list-block>
91 </fo:block>
92 </xsl:template>
93
94</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.