source: stylesheets/pdf/lfs-mixed.xsl@ 3bb2e88

6.0
Last change on this file since 3bb2e88 was 3bb2e88, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

Commented out the general URLs split. In the final book version we want individualized URL split when needed.

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

  • Property mode set to 100644
File size: 6.6 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 <!-- Split URLs -->
8 <xsl:template name="hyphenate-url">
9 <xsl:param name="url" select="''"/>
10 <xsl:choose>
11 <xsl:when test="ancestor::varlistentry">
12 <xsl:choose>
13 <xsl:when test="string-length($url) > 88">
14 <xsl:value-of select="substring($url, 1, 50)"/>
15 <xsl:param name="rest" select="substring($url, 51)"/>
16 <xsl:value-of select="substring-before($rest, '/')"/>
17 <xsl:text> /</xsl:text>
18 <xsl:value-of select="substring-after($rest, '/')"/>
19 </xsl:when>
20 <xsl:otherwise>
21 <xsl:value-of select="$url"/>
22 </xsl:otherwise>
23 </xsl:choose>
24 </xsl:when>
25 <xsl:otherwise>
26 <xsl:value-of select="$url"/>
27 <!-- <xsl:value-of select="substring-before($url, '//')"/>
28 <xsl:text>// </xsl:text>
29 <xsl:call-template name="split-url">
30 <xsl:with-param name="url2" select="substring-after($url, '//')"/>
31 </xsl:call-template>-->
32 </xsl:otherwise>
33 </xsl:choose>
34 </xsl:template>
35
36 <!--<xsl:template name="split-url">
37 <xsl:choose>
38 <xsl:when test="contains($url2, '/')">
39 <xsl:param name="url2" select="''"/>
40 <xsl:value-of select="substring-before($url2, '/')"/>
41 <xsl:text> /</xsl:text>
42 <xsl:call-template name="split-url">
43 <xsl:with-param name="url2" select="substring-after($url2, '/')"/>
44 </xsl:call-template>
45 </xsl:when>
46 <xsl:otherwise>
47 <xsl:value-of select="$url2"/>
48 </xsl:otherwise>
49 </xsl:choose>
50 </xsl:template>-->
51
52 <!-- Shade screen -->
53 <xsl:param name="shade.verbatim" select="1"/>
54
55 <!-- Graphics in admonitions -->
56 <xsl:param name="admon.graphics" select="1"/>
57 <xsl:param name="admon.graphics.path"
58 select="'/usr/share/xml/docbook/xsl-stylesheets-1.65.1/images/'"/>
59
60 <!-- Admonition block properties -->
61 <xsl:template match="important|warning|caution">
62 <xsl:choose>
63 <xsl:when test="$admon.graphics != 0">
64 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
65 space-before.maximum="0.8em" border-style="solid" border-width="1pt"
66 border-color="#500" background-color="#FFFFE6">
67 <xsl:call-template name="graphical.admonition"/>
68 </fo:block>
69 </xsl:when>
70 <xsl:otherwise>
71 <xsl:call-template name="nongraphical.admonition"/>
72 </xsl:otherwise>
73 </xsl:choose>
74 </xsl:template>
75
76 <xsl:template match="note|tip">
77 <xsl:choose>
78 <xsl:when test="$admon.graphics != 0">
79 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
80 space-before.maximum="0.8em" border-style="solid" border-width="1pt"
81 border-color="#E0E0E0" background-color="#FFFFE6">
82 <xsl:call-template name="graphical.admonition"/>
83 </fo:block>
84 </xsl:when>
85 <xsl:otherwise>
86 <xsl:call-template name="nongraphical.admonition"/>
87 </xsl:otherwise>
88 </xsl:choose>
89 </xsl:template>
90
91 <!-- Admonitions text properties -->
92 <xsl:attribute-set name="admonition.properties">
93 <xsl:attribute name="margin-right">6pt</xsl:attribute>
94 </xsl:attribute-set>
95
96 <!-- Adding left space to the graphics and color to the titles -->
97 <xsl:template name="graphical.admonition">
98 <xsl:variable name="id">
99 <xsl:call-template name="object.id"/>
100 </xsl:variable>
101 <xsl:variable name="graphic.width">
102 <xsl:call-template name="admon.graphic.width"/>
103 </xsl:variable>
104 <fo:block id="{$id}">
105 <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt"
106 provisional-label-separation="18pt" xsl:use-attribute-sets="list.block.spacing">
107 <fo:list-item>
108 <fo:list-item-label end-indent="label-end()">
109 <fo:block margin-left="4pt">
110 <fo:external-graphic width="auto" height="auto"
111 content-width="{$graphic.width}" >
112 <xsl:attribute name="src">
113 <xsl:call-template name="admon.graphic"/>
114 </xsl:attribute>
115 </fo:external-graphic>
116 </fo:block>
117 </fo:list-item-label>
118 <fo:list-item-body start-indent="body-start()">
119 <xsl:if test="$admon.textlabel != 0 or title">
120 <fo:block xsl:use-attribute-sets="admonition.title.properties">
121 <xsl:if test="ancestor-or-self::important">
122 <xsl:attribute name="color">#500</xsl:attribute>
123 </xsl:if>
124 <xsl:if test="ancestor-or-self::warning">
125 <xsl:attribute name="color">#500</xsl:attribute>
126 </xsl:if>
127 <xsl:if test="ancestor-or-self::caution">
128 <xsl:attribute name="color">#500</xsl:attribute>
129 </xsl:if>
130 <xsl:apply-templates select="." mode="object.title.markup"/>
131 </fo:block>
132 </xsl:if>
133 <fo:block xsl:use-attribute-sets="admonition.properties">
134 <xsl:apply-templates/>
135 </fo:block>
136 </fo:list-item-body>
137 </fo:list-item>
138 </fo:list-block>
139 </fo:block>
140 </xsl:template>
141
142 <!-- How is rendered by default a variablelist -->
143 <xsl:param name="variablelist.as.blocks" select="1"/>
144
145 <!-- Adding space before segmentedlist -->
146 <xsl:template match="segmentedlist">
147 <!--<xsl:variable name="presentation">
148 <xsl:call-template name="pi-attribute">
149 <xsl:with-param name="pis"
150 select="processing-instruction('dbfo')"/>
151 <xsl:with-param name="attribute" select="'list-presentation'"/>
152 </xsl:call-template>
153 </xsl:variable>
154 <xsl:choose>
155 <xsl:when test="$presentation = 'table'">
156 <xsl:apply-templates select="." mode="seglist-table"/>
157 </xsl:when>
158 <xsl:when test="$presentation = 'list'">
159 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
160 space-before.maximum="0.8em">
161 <xsl:apply-templates/>
162 </fo:block>
163 </xsl:when>
164 <xsl:when test="$segmentedlist.as.table != 0">
165 <xsl:apply-templates select="." mode="seglist-table"/>
166 </xsl:when>
167 <xsl:otherwise>-->
168 <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
169 space-before.maximum="0.8em">
170 <xsl:apply-templates/>
171 </fo:block>
172 <!--</xsl:otherwise>
173 </xsl:choose>-->
174 </xsl:template>
175
176</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.