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