source: trunk/lib/docbook/custom-styles/docbook/plain/xsl/customized.chunked.xsl @ 3342

Last change on this file since 3342 was 3342, checked in by Nicklas Nordborg, 16 years ago

Turn off image scaling for HTML output.

  • Property svn:eol-style set to native
File size: 7.7 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                xmlns:date="http://exslt.org/dates-and-times"
5                exclude-result-prefixes="date"
6                version='1.0'>
7
8<xsl:import href="../../../lib/docbook/docbook/xsl/html/chunk.xsl" />
9
10<!-- (MM20040315) xsl parameters moved from ant-build-docbook.xml to here -->
11<xsl:param name="table.borders.with.css" select="1"/>
12<xsl:param name="html.stylesheet">css/docbook.css</xsl:param>
13<xsl:param name="html.stylesheet.type">text/css</xsl:param>       
14<xsl:param name="section.label.includes.component.label" select="1" />         
15<xsl:param name="section.autolabel" select="1" />
16<xsl:param name="section.autolabel.max.depth" select="2" />
17<xsl:param name="chunk.first.sections" select="1" />
18<xsl:param name="chunk.section.depth" select="2" />
19<xsl:param name="chunk.fast" select="1" />
20<xsl:param name="toc.max.depth" select="4"/>
21<xsl:param name="toc.section.depth" select="3" />
22<xsl:param name="generate.section.toc.level" select="1" />
23<xsl:param name="generate.toc">
24appendix  toc,title
25article/appendix  nop
26article   toc,title
27book      toc,title
28chapter   toc,title
29part      toc,title
30preface   toc,title
31qandadiv  toc
32qandaset  toc
33reference toc,title
34sect1     toc
35sect2     toc
36sect3     toc
37sect4     toc
38sect5     toc
39section   toc
40set       toc,title
41</xsl:param>
42<!-- Turn off image scaling when generating HTML output -->
43<xsl:param name="make.graphic.viewport" select="0"/>
44<xsl:param name="ignore.image.scaling" select="1"/>
45
46<xsl:param name="callout.graphics" select="1" />
47<xsl:param name="callout.graphics.path">gfx/admonitions/callouts/</xsl:param>
48<xsl:param name="callout.graphics.extension">.gif</xsl:param>
49<xsl:param name="admon.graphics" select="1"/>
50<xsl:param name="admon.graphics.path">gfx/admonitions/</xsl:param>
51<xsl:param name="admon.graphics.extension">.gif</xsl:param>
52<xsl:param name="admon.style">margin-left: 2em; margin-right: 2em;</xsl:param>
53<xsl:param name="admonition.title.properties">text-align: left</xsl:param>
54
55<xsl:param name="keep.relative.image.uris" select="false"/>
56<xsl:param name="use.id.as.filename" select="1"/>
57
58<xsl:param name="chunker.output.encoding">utf-8</xsl:param>
59<xsl:param name="chunker.output.indent">yes</xsl:param>
60<xsl:param name="chunker.message.nofilename">1</xsl:param>
61
62<!-- (MM20040315) base.dir and root.filename are coming from the ant-build-docbook.xml -->
63<xsl:param name="base.dir">@base.dir@/</xsl:param>
64<xsl:param name="root.filename">@root.filename@</xsl:param>
65
66<!-- doc.revision and doc.last.modified -->
67<xsl:param name="doc.revision">@doc.revision@</xsl:param>
68<xsl:param name="doc.last.modified">@doc.last.modified@</xsl:param>
69<xsl:param name="base.version">@base.version@</xsl:param>
70
71<!-- convert url-only references to a format that is wrappable -->
72
73<xsl:template match="ulink" name="ulink">
74  <xsl:choose>
75  <xsl:when test="count(child::node())=0">
76  <a>
77      <xsl:if test="@id">
78        <xsl:attribute name="name">
79          <xsl:value-of select="@id"/>
80        </xsl:attribute>
81      </xsl:if>
82      <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
83      <xsl:if test="$ulink.target != ''">
84        <xsl:attribute name="target">
85          <xsl:value-of select="$ulink.target"/>
86        </xsl:attribute>
87      </xsl:if> 
88    <xsl:if test="count(child::node())=0">
89        <xsl:call-template name="insertInvisibleBreaks">
90            <xsl:with-param name="url" select="@url" />
91            <xsl:with-param name="breakat" select="translate(@url, '/-_:', '____')" />
92        </xsl:call-template>
93    </xsl:if>
94  </a>
95  </xsl:when>
96  <xsl:otherwise>
97  <xsl:apply-imports/>
98  </xsl:otherwise>
99  </xsl:choose>
100</xsl:template> 
101
102<xsl:template name="insertInvisibleBreaks">
103    <xsl:param name="url" />
104    <xsl:param name="breakat" />
105    <!-- <xsl:message><xsl:value-of select="concat('param:', $url, $breakat)" /></xsl:message> -->
106    <xsl:choose>
107        <xsl:when test="contains($breakat, '_')">
108            <xsl:value-of select="substring($url, 1, string-length(substring-before($breakat, '_'))+1)" /><wbr/>
109            <xsl:call-template name="insertInvisibleBreaks">
110                <xsl:with-param name="url" select="substring($url, string-length(substring-before($breakat, '_'))+2)"/>
111                <xsl:with-param name="breakat" select="substring($breakat, string-length(substring-before($breakat, '_'))+2)"/>
112            </xsl:call-template>
113        </xsl:when>
114        <xsl:otherwise>
115            <xsl:value-of select="$url" />
116        </xsl:otherwise>
117    </xsl:choose>
118</xsl:template>
119
120<!-- Base specific templates -->
121
122<xsl:template match="helptext">
123  <xsl:choose>
124    <xsl:when test="@webonly = '0'"> 
125      <xsl:apply-templates />
126    </xsl:when>
127  </xsl:choose>
128</xsl:template>
129
130<xsl:template match="seeother|other">
131</xsl:template>
132
133<xsl:template match="nohelp">
134  <xsl:apply-templates />
135</xsl:template>
136
137<xsl:template name="user.footer.navigation">
138  <div 
139    class="navfooter"
140    align="left">
141    <p>
142    <i>
143      <xsl:if test="$doc.revision" >
144        Version: <xsl:value-of select="$base.version"/> (build #<xsl:value-of select="$doc.revision"/>)<br/>
145      </xsl:if>
146      <xsl:if test="$doc.last.modified" >
147        Book last modified: <xsl:value-of select="$doc.last.modified" />
148      </xsl:if>
149    </i></p>
150  </div>
151</xsl:template>
152
153  <xsl:template name="convertpath">
154    <xsl:param name="path" select="''" />
155    <xsl:choose>
156      <xsl:when test="contains($path, '/')">
157        <xsl:text>../</xsl:text>
158        <xsl:call-template name="convertpath">
159          <xsl:with-param name="path" select="substring-after($path, '/')" />
160        </xsl:call-template>
161      </xsl:when>
162    </xsl:choose>
163  </xsl:template>
164
165  <xsl:template name="pathtorootdir">
166    <xsl:variable name="dir">
167      <xsl:call-template name="dbhtml-dir">
168        <xsl:with-param name="context" select="." />
169      </xsl:call-template>
170    </xsl:variable>
171    <xsl:call-template name="convertpath">
172      <xsl:with-param name="path" select="$dir" />
173    </xsl:call-template>
174  </xsl:template>
175
176  <xsl:template name="output.html.stylesheets">
177    <xsl:param name="stylesheets" select="''" />
178    <xsl:variable name="pathtorootdir">
179      <xsl:call-template name="pathtorootdir" />
180    </xsl:variable>
181    <xsl:choose>
182      <xsl:when test="contains($stylesheets, ' ')">
183        <link rel="stylesheet"
184          href="{substring-before(concat($pathtorootdir, $stylesheets), ' ')}">
185          <xsl:if test="$html.stylesheet.type != ''">
186            <xsl:attribute name="type">
187              <xsl:value-of select="$html.stylesheet.type" />
188            </xsl:attribute>
189          </xsl:if>
190        </link>
191        <xsl:call-template name="output.html.stylesheets">
192          <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')" />
193        </xsl:call-template>
194      </xsl:when>
195      <xsl:when test="$stylesheets != ''">
196        <link rel="stylesheet" href="{concat($pathtorootdir,$stylesheets)}">
197          <xsl:if test="$html.stylesheet.type != ''">
198            <xsl:attribute name="type">
199              <xsl:value-of select="$html.stylesheet.type" />
200            </xsl:attribute>
201          </xsl:if>
202        </link>
203      </xsl:when>
204    </xsl:choose>
205  </xsl:template>
206 
207  <xsl:template name="admon.graphic">
208    <xsl:param name="node" select="." />
209    <xsl:variable name="pathtorootdir">
210      <xsl:call-template name="pathtorootdir"/>
211    </xsl:variable>
212    <xsl:value-of select="concat($pathtorootdir, $admon.graphics.path)" />
213    <xsl:choose>
214      <xsl:when test="local-name($node)='note'">note</xsl:when>
215      <xsl:when test="local-name($node)='warning'">warning</xsl:when>
216      <xsl:when test="local-name($node)='caution'">caution</xsl:when>
217      <xsl:when test="local-name($node)='tip'">tip</xsl:when>
218      <xsl:when test="local-name($node)='important'">important</xsl:when>
219      <xsl:otherwise>note</xsl:otherwise>
220    </xsl:choose>
221    <xsl:value-of select="$admon.graphics.extension" />
222  </xsl:template>
223
224</xsl:stylesheet>
225
226
Note: See TracBrowser for help on using the repository browser.