njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> <!-- -*- sgml -*- --> |
| 2 | <xsl:stylesheet |
| 3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
| 4 | |
| 5 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/> |
| 6 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/> |
| 7 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/manifest.xsl"/> |
| 8 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-code.xsl"/> |
| 9 | <xsl:import href="vg-common.xsl"/> |
| 10 | |
| 11 | <!-- use 8859-1 encoding --> |
| 12 | <xsl:output method="html" encoding="ISO-8859-1" indent="yes"/> |
| 13 | |
| 14 | <xsl:param name="use.id.as.filename" select="'1'"/> |
| 15 | <xsl:param name="chunker.output.indent" select="'yes'"/> |
| 16 | <!-- use our custom html stylesheet --> |
| 17 | <xsl:param name="html.stylesheet" select="'vg_basic.css'"/> |
sewardj | 779d704 | 2005-08-03 16:39:08 +0000 | [diff] [blame] | 18 | <!-- set chunking at the chapter level only --> |
| 19 | <xsl:param name="chunk.section.depth" select="'0'"/> |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 20 | |
| 21 | <!-- use our custom header --> |
| 22 | <xsl:template name="header.navigation"> |
| 23 | <xsl:param name="prev" select="/foo"/> |
| 24 | <xsl:param name="next" select="/foo"/> |
| 25 | <xsl:param name="nav.context"/> |
| 26 | |
| 27 | <xsl:variable name="home" select="/*[1]"/> |
| 28 | <xsl:variable name="up" select="parent::*"/> |
| 29 | |
| 30 | <xsl:variable name="row1" select="$navig.showtitles != 0"/> |
| 31 | <xsl:variable name="row2" select="count($prev) > 0 |
| 32 | or (count($up) > 0 |
| 33 | and generate-id($up) != generate-id($home) ) |
| 34 | or count($next) > 0"/> |
| 35 | |
| 36 | <div> |
| 37 | <!-- never show header nav stuff on title page --> |
| 38 | <xsl:if test="count($prev)>0"> |
| 39 | <xsl:if test="$row1 or $row2"> |
| 40 | <table class="nav" width="100%" cellspacing="3" cellpadding="3" border="0" summary="Navigation header"> |
| 41 | <xsl:if test="$row2"> |
| 42 | <tr> |
| 43 | <!-- prev --> |
| 44 | <td width="22px" align="center" valign="middle"> |
| 45 | <xsl:if test="count($prev)>0"> |
| 46 | <a accesskey="p"> |
| 47 | <xsl:attribute name="href"> |
| 48 | <xsl:call-template name="href.target"> |
| 49 | <xsl:with-param name="object" select="$prev"/> |
| 50 | </xsl:call-template> |
| 51 | </xsl:attribute> |
| 52 | <img src="images/prev.png" width="18" height="21" border="0"> |
| 53 | <xsl:attribute name="alt"> |
| 54 | <xsl:call-template name="gentext"> |
| 55 | <xsl:with-param name="key">nav-prev</xsl:with-param> |
| 56 | </xsl:call-template> |
| 57 | </xsl:attribute> |
| 58 | </img> |
| 59 | </a> |
| 60 | </xsl:if> |
| 61 | </td> |
| 62 | <!-- up --> |
| 63 | <xsl:if test="count($up)>0"> |
| 64 | <td width="25px" align="center" valign="middle"> |
| 65 | <a accesskey="u"> |
| 66 | <xsl:attribute name="href"> |
| 67 | <xsl:call-template name="href.target"> |
| 68 | <xsl:with-param name="object" select="$up"/> |
| 69 | </xsl:call-template> |
| 70 | </xsl:attribute> |
| 71 | <img src="images/up.png" width="21" height="18" border="0"> |
| 72 | <xsl:attribute name="alt"> |
| 73 | <xsl:call-template name="gentext"> |
| 74 | <xsl:with-param name="key">nav-up</xsl:with-param> |
| 75 | </xsl:call-template> |
| 76 | </xsl:attribute> |
| 77 | </img> |
| 78 | </a> |
| 79 | </td> |
| 80 | </xsl:if> |
| 81 | <!-- home --> |
| 82 | <xsl:if test="$home != . or $nav.context = 'toc'"> |
| 83 | <td width="31px" align="center" valign="middle"> |
| 84 | <a accesskey="h"> |
| 85 | <xsl:attribute name="href"> |
| 86 | <xsl:call-template name="href.target"> |
| 87 | <xsl:with-param name="object" select="$home"/> |
| 88 | </xsl:call-template> |
| 89 | </xsl:attribute> |
| 90 | <img src="images/home.png" width="27" height="20" border="0"> |
| 91 | <xsl:attribute name="alt"> |
| 92 | <xsl:call-template name="gentext"> |
| 93 | <xsl:with-param name="key">nav-up</xsl:with-param> |
| 94 | </xsl:call-template> |
| 95 | </xsl:attribute> |
| 96 | </img> |
| 97 | </a> |
| 98 | </td> |
| 99 | </xsl:if> |
| 100 | <!-- chapter|section heading --> |
| 101 | <th align="center" valign="middle"> |
| 102 | <xsl:apply-templates select="$up" mode="object.title.markup"/> |
| 103 | <!-- |
| 104 | <xsl:choose> |
| 105 | <xsl:when test="count($up) > 0 and generate-id($up) != generate-id($home)"> |
| 106 | <xsl:apply-templates select="$up" mode="object.title.markup"/> |
| 107 | </xsl:when> |
| 108 | <xsl:otherwise> |
sewardj | 779d704 | 2005-08-03 16:39:08 +0000 | [diff] [blame] | 109 | <xsl:text>Valgrind User`s Manual</xsl:text> |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 110 | </xsl:otherwise> |
| 111 | </xsl:choose> |
| 112 | --> |
| 113 | </th> |
| 114 | <!-- next --> |
| 115 | <td width="22px" align="center" valign="middle"> |
| 116 | <xsl:if test="count($next)>0"> |
| 117 | <a accesskey="n"> |
| 118 | <xsl:attribute name="href"> |
| 119 | <xsl:call-template name="href.target"> |
| 120 | <xsl:with-param name="object" select="$next"/> |
| 121 | </xsl:call-template> |
| 122 | </xsl:attribute> |
| 123 | <img src="images/next.png" width="18" height="21" border="0"> |
| 124 | <xsl:attribute name="alt"> |
| 125 | <xsl:call-template name="gentext"> |
| 126 | <xsl:with-param name="key">nav-next</xsl:with-param> |
| 127 | </xsl:call-template> |
| 128 | </xsl:attribute> |
| 129 | </img> |
| 130 | </a> |
| 131 | </xsl:if> |
| 132 | </td> |
| 133 | </tr> |
| 134 | </xsl:if> |
| 135 | </table> |
| 136 | </xsl:if> |
| 137 | </xsl:if> |
| 138 | </div> |
| 139 | </xsl:template> |
| 140 | |
| 141 | |
| 142 | <!-- our custom footer --> |
| 143 | <xsl:template name="footer.navigation"> |
| 144 | <xsl:param name="prev" select="/foo"/> |
| 145 | <xsl:param name="next" select="/foo"/> |
| 146 | <xsl:param name="nav.context"/> |
| 147 | |
| 148 | <xsl:variable name="home" select="/*[1]"/> |
| 149 | <xsl:variable name="up" select="parent::*"/> |
| 150 | |
| 151 | <xsl:variable name="row1" select="count($prev) > 0 |
| 152 | or count($up) > 0 |
| 153 | or count($next) > 0"/> |
| 154 | |
| 155 | <xsl:variable name="row2" select="($prev != 0) |
sewardj | 779d704 | 2005-08-03 16:39:08 +0000 | [diff] [blame] | 156 | or (generate-id($home) != generate-id(.) or $nav.context = 'toc') |
| 157 | or ($chunk.tocs.and.lots != 0 and $nav.context != 'toc') |
| 158 | or ($next != 0)"/> |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 159 | <div> |
| 160 | <xsl:if test="$row1 or $row2"> |
| 161 | <br /> |
| 162 | <table class="nav" width="100%" cellspacing="3" cellpadding="2" border="0" summary="Navigation footer"> |
| 163 | <xsl:if test="$row1"> |
| 164 | <tr> |
| 165 | <td rowspan="2" width="40%" align="left"> |
| 166 | <xsl:if test="count($prev)>0"> |
| 167 | <a accesskey="p"> |
| 168 | <xsl:attribute name="href"> |
| 169 | <xsl:call-template name="href.target"> |
| 170 | <xsl:with-param name="object" select="$prev"/> |
| 171 | </xsl:call-template> |
| 172 | </xsl:attribute> |
| 173 | <xsl:text><< </xsl:text> |
| 174 | <xsl:apply-templates select="$prev" mode="object.title.markup"/> |
| 175 | </a> |
| 176 | </xsl:if> |
| 177 | <xsl:text> </xsl:text> |
| 178 | </td> |
| 179 | <td width="20%" align="center"> |
| 180 | <xsl:choose> |
| 181 | <xsl:when test="count($up)>0"> |
| 182 | <a accesskey="u"> |
| 183 | <xsl:attribute name="href"> |
| 184 | <xsl:call-template name="href.target"> |
| 185 | <xsl:with-param name="object" select="$up"/> |
| 186 | </xsl:call-template> |
| 187 | </xsl:attribute> |
| 188 | <xsl:call-template name="navig.content"> |
| 189 | <xsl:with-param name="direction" select="'up'"/> |
| 190 | </xsl:call-template> |
| 191 | </a> |
| 192 | </xsl:when> |
| 193 | <xsl:otherwise> </xsl:otherwise> |
| 194 | </xsl:choose> |
| 195 | </td> |
| 196 | <td rowspan="2" width="40%" align="right"> |
| 197 | <xsl:text> </xsl:text> |
| 198 | <xsl:if test="count($next)>0"> |
| 199 | <a accesskey="n"> |
| 200 | <xsl:attribute name="href"> |
| 201 | <xsl:call-template name="href.target"> |
| 202 | <xsl:with-param name="object" select="$next"/> |
| 203 | </xsl:call-template> |
| 204 | </xsl:attribute> |
| 205 | <xsl:apply-templates select="$next" mode="object.title.markup"/> |
| 206 | <xsl:text> >></xsl:text> |
| 207 | </a> |
| 208 | </xsl:if> |
| 209 | </td> |
| 210 | </tr> |
| 211 | </xsl:if> |
| 212 | |
| 213 | <xsl:if test="$row2"> |
| 214 | <tr> |
| 215 | <td width="20%" align="center"> |
| 216 | <xsl:choose> |
| 217 | <xsl:when test="$home != . or $nav.context = 'toc'"> |
| 218 | <a accesskey="h"> |
| 219 | <xsl:attribute name="href"> |
| 220 | <xsl:call-template name="href.target"> |
| 221 | <xsl:with-param name="object" select="$home"/> |
| 222 | </xsl:call-template> |
| 223 | </xsl:attribute> |
| 224 | <xsl:call-template name="navig.content"> |
| 225 | <xsl:with-param name="direction" select="'home'"/> |
| 226 | </xsl:call-template> |
| 227 | </a> |
| 228 | <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"> |
| 229 | <xsl:text> | </xsl:text> |
| 230 | </xsl:if> |
| 231 | </xsl:when> |
| 232 | <xsl:otherwise> </xsl:otherwise> |
| 233 | </xsl:choose> |
| 234 | <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"> |
| 235 | <a accesskey="t"> |
| 236 | <xsl:attribute name="href"> |
| 237 | <xsl:apply-templates select="/*[1]" mode="recursive-chunk-filename"/> |
| 238 | <xsl:text>-toc</xsl:text> |
| 239 | <xsl:value-of select="$html.ext"/> |
| 240 | </xsl:attribute> |
| 241 | <xsl:call-template name="gentext"> |
| 242 | <xsl:with-param name="key" select="'nav-toc'"/> |
| 243 | </xsl:call-template> |
| 244 | </a> |
| 245 | </xsl:if> |
| 246 | </td> |
| 247 | </tr> |
| 248 | </xsl:if> |
| 249 | </table> |
| 250 | </xsl:if> |
| 251 | </div> |
| 252 | </xsl:template> |
| 253 | |
sewardj | 779d704 | 2005-08-03 16:39:08 +0000 | [diff] [blame] | 254 | <!-- We don`t like tables with borders --> |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 255 | <xsl:template match="revhistory" mode="titlepage.mode"> |
| 256 | <xsl:variable name="numcols"> |
| 257 | <xsl:choose> |
| 258 | <xsl:when test="//authorinitials">3</xsl:when> |
| 259 | <xsl:otherwise>2</xsl:otherwise> |
| 260 | </xsl:choose> |
| 261 | </xsl:variable> |
| 262 | <table width="100%" border="0" summary="Revision history"> |
| 263 | <tr> |
| 264 | <th align="left" colspan="{$numcols}"> |
| 265 | <h3>Revision History</h3> |
| 266 | </th> |
| 267 | </tr> |
| 268 | <xsl:apply-templates mode="titlepage.mode"> |
| 269 | <xsl:with-param name="numcols" select="$numcols"/> |
| 270 | </xsl:apply-templates> |
| 271 | </table> |
| 272 | </xsl:template> |
| 273 | |
sewardj | 779d704 | 2005-08-03 16:39:08 +0000 | [diff] [blame] | 274 | <!-- don`t put an expanded set-level TOC, only book titles --> |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 275 | <xsl:template match="book" mode="toc"> |
| 276 | <xsl:param name="toc-context" select="."/> |
| 277 | <xsl:choose> |
| 278 | <xsl:when test="local-name($toc-context) = 'set'"> |
| 279 | <xsl:call-template name="subtoc"> |
| 280 | <xsl:with-param name="toc-context" select="$toc-context"/> |
| 281 | <xsl:with-param name="nodes" select="foo"/> |
| 282 | </xsl:call-template> |
| 283 | </xsl:when> |
| 284 | <xsl:otherwise> |
| 285 | <xsl:call-template name="subtoc"> |
| 286 | <xsl:with-param name="toc-context" select="$toc-context"/> |
| 287 | <xsl:with-param name="nodes" select="part|reference |
| 288 | |preface|chapter|appendix |
| 289 | |article |
| 290 | |bibliography|glossary|index |
| 291 | |refentry |
| 292 | |bridgehead[$bridgehead.in.toc != |
| 293 | 0]"/> |
| 294 | </xsl:call-template> |
| 295 | </xsl:otherwise> |
| 296 | </xsl:choose> |
| 297 | </xsl:template> |
| 298 | |
| 299 | <!-- question and answer set mods --> |
| 300 | <xsl:template match="answer"> |
| 301 | <xsl:variable name="deflabel"> |
| 302 | <xsl:choose> |
| 303 | <xsl:when test="ancestor-or-self::*[@defaultlabel]"> |
| 304 | <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()] |
| 305 | /@defaultlabel"/> |
| 306 | </xsl:when> |
| 307 | <xsl:otherwise> |
| 308 | <xsl:value-of select="$qanda.defaultlabel"/> |
| 309 | </xsl:otherwise> |
| 310 | </xsl:choose> |
| 311 | </xsl:variable> |
| 312 | <tr class="{name(.)}"> |
| 313 | <td><xsl:text> </xsl:text></td> |
| 314 | <td align="left" valign="top"> |
| 315 | <xsl:apply-templates select="*[name(.) != 'label']"/> |
| 316 | </td> |
| 317 | </tr> |
| 318 | <tr><td colspan="2"><xsl:text> </xsl:text></td></tr> |
| 319 | </xsl:template> |
| 320 | |
| 321 | </xsl:stylesheet> |