[29] | 1 | <?xml version="1.0" encoding="utf-8"?> |
---|
| 2 | <!-- |
---|
| 3 | Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com> |
---|
| 4 | |
---|
| 5 | Distributed under the Boost Software License, Version 1.0. |
---|
| 6 | (See accompanying file LICENSE_1_0.txt or copy at |
---|
| 7 | http://www.boost.org/LICENSE_1_0.txt) |
---|
| 8 | --> |
---|
| 9 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
| 10 | xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" |
---|
| 11 | version="1.0"> |
---|
| 12 | |
---|
| 13 | <!-- Import the HTML chunking stylesheet --> |
---|
| 14 | <xsl:import |
---|
| 15 | href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/> |
---|
| 16 | |
---|
| 17 | <xsl:import href="chunk-common.xsl"/> |
---|
| 18 | <xsl:import href="docbook-layout.xsl"/> |
---|
| 19 | <xsl:import href="navbar.xsl"/> |
---|
| 20 | <xsl:import href="admon.xsl"/> |
---|
| 21 | <xsl:import href="xref.xsl"/> |
---|
| 22 | <xsl:import href="relative-href.xsl"/> |
---|
| 23 | |
---|
| 24 | <xsl:param name="admon.style"/> |
---|
| 25 | <xsl:param name="admon.graphics">1</xsl:param> |
---|
| 26 | <xsl:param name="html.stylesheet" select="'boostbook.css'"/> |
---|
| 27 | <xsl:param name="navig.graphics" select="1"/> |
---|
| 28 | <xsl:param name="navig.graphics.extension" select="'.png'"/> |
---|
| 29 | <xsl:param name="chapter.autolabel" select="1"/> |
---|
| 30 | <xsl:param name="use.id.as.filename" select="1"/> |
---|
| 31 | <xsl:param name="refentry.generate.name" select="0"/> |
---|
| 32 | <xsl:param name="refentry.generate.title" select="1"/> |
---|
| 33 | <xsl:param name="make.year.ranges" select="1"/> |
---|
| 34 | <xsl:param name="generate.manifest" select="1"/> |
---|
| 35 | <xsl:param name="generate.section.toc.level" select="3"/> |
---|
| 36 | <xsl:param name="doc.standalone">false</xsl:param> |
---|
| 37 | <xsl:param name="chunker.output.indent">yes</xsl:param> |
---|
| 38 | <xsl:param name="toc.max.depth">2</xsl:param> |
---|
| 39 | |
---|
| 40 | <xsl:param name="admon.style"> |
---|
| 41 | <!-- Remove the style. Let the CSS do the styling --> |
---|
| 42 | </xsl:param> |
---|
| 43 | |
---|
| 44 | <!-- Always have graphics --> |
---|
| 45 | <xsl:param name="admon.graphics" select="1"/> |
---|
| 46 | |
---|
| 47 | <xsl:param name="generate.toc"> |
---|
| 48 | appendix toc,title |
---|
| 49 | article/appendix nop |
---|
| 50 | article toc,title |
---|
| 51 | book toc,title |
---|
| 52 | chapter toc,title |
---|
| 53 | part toc,title |
---|
| 54 | preface toc,title |
---|
| 55 | qandadiv toc |
---|
| 56 | qandaset toc |
---|
| 57 | reference toc,title |
---|
| 58 | sect1 toc |
---|
| 59 | sect2 toc |
---|
| 60 | sect3 toc |
---|
| 61 | sect4 toc |
---|
| 62 | sect5 toc |
---|
| 63 | section toc |
---|
| 64 | set toc,title |
---|
| 65 | </xsl:param> |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | <xsl:template name="format.cvs.revision"> |
---|
| 69 | <xsl:param name="text"/> |
---|
| 70 | |
---|
| 71 | <!-- Remove the "$Date: " --> |
---|
| 72 | <xsl:variable name="text.noprefix" |
---|
| 73 | select="substring-after($text, '$Date: ')"/> |
---|
| 74 | |
---|
| 75 | <!-- Grab the year --> |
---|
| 76 | <xsl:variable name="year" select="substring-before($text.noprefix, '/')"/> |
---|
| 77 | <xsl:variable name="text.noyear" |
---|
| 78 | select="substring-after($text.noprefix, '/')"/> |
---|
| 79 | |
---|
| 80 | <!-- Grab the month --> |
---|
| 81 | <xsl:variable name="month" select="substring-before($text.noyear, '/')"/> |
---|
| 82 | <xsl:variable name="text.nomonth" |
---|
| 83 | select="substring-after($text.noyear, '/')"/> |
---|
| 84 | |
---|
| 85 | <!-- Grab the year --> |
---|
| 86 | <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/> |
---|
| 87 | <xsl:variable name="text.noday" |
---|
| 88 | select="substring-after($text.nomonth, ' ')"/> |
---|
| 89 | |
---|
| 90 | <!-- Get the time --> |
---|
| 91 | <xsl:variable name="time" select="substring-before($text.noday, ' ')"/> |
---|
| 92 | |
---|
| 93 | <xsl:variable name="month.name"> |
---|
| 94 | <xsl:choose> |
---|
| 95 | <xsl:when test="$month=1">January</xsl:when> |
---|
| 96 | <xsl:when test="$month=2">February</xsl:when> |
---|
| 97 | <xsl:when test="$month=3">March</xsl:when> |
---|
| 98 | <xsl:when test="$month=4">April</xsl:when> |
---|
| 99 | <xsl:when test="$month=5">May</xsl:when> |
---|
| 100 | <xsl:when test="$month=6">June</xsl:when> |
---|
| 101 | <xsl:when test="$month=7">July</xsl:when> |
---|
| 102 | <xsl:when test="$month=8">August</xsl:when> |
---|
| 103 | <xsl:when test="$month=9">September</xsl:when> |
---|
| 104 | <xsl:when test="$month=10">October</xsl:when> |
---|
| 105 | <xsl:when test="$month=11">November</xsl:when> |
---|
| 106 | <xsl:when test="$month=12">December</xsl:when> |
---|
| 107 | </xsl:choose> |
---|
| 108 | </xsl:variable> |
---|
| 109 | |
---|
| 110 | <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ', |
---|
| 111 | $time, ' GMT')"/> |
---|
| 112 | </xsl:template> |
---|
| 113 | |
---|
| 114 | |
---|
| 115 | <xsl:template name="format.svn.revision"> |
---|
| 116 | <xsl:param name="text"/> |
---|
| 117 | |
---|
| 118 | <!-- Remove the "$Date: " --> |
---|
| 119 | <xsl:variable name="text.noprefix" |
---|
| 120 | select="substring-after($text, '$Date: ')"/> |
---|
| 121 | |
---|
| 122 | <!-- Grab the year --> |
---|
| 123 | <xsl:variable name="year" select="substring-before($text.noprefix, '-')"/> |
---|
| 124 | <xsl:variable name="text.noyear" |
---|
| 125 | select="substring-after($text.noprefix, '-')"/> |
---|
| 126 | |
---|
| 127 | <!-- Grab the month --> |
---|
| 128 | <xsl:variable name="month" select="substring-before($text.noyear, '-')"/> |
---|
| 129 | <xsl:variable name="text.nomonth" |
---|
| 130 | select="substring-after($text.noyear, '-')"/> |
---|
| 131 | |
---|
| 132 | <!-- Grab the year --> |
---|
| 133 | <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/> |
---|
| 134 | <xsl:variable name="text.noday" |
---|
| 135 | select="substring-after($text.nomonth, ' ')"/> |
---|
| 136 | |
---|
| 137 | <!-- Get the time --> |
---|
| 138 | <xsl:variable name="time" select="substring-before($text.noday, ' ')"/> |
---|
| 139 | <xsl:variable name="text.notime" |
---|
| 140 | select="substring-after($text.noday, ' ')"/> |
---|
| 141 | |
---|
| 142 | <!-- Get the timezone --> |
---|
| 143 | <xsl:variable name="timezone" select="substring-before($text.notime, ' ')"/> |
---|
| 144 | |
---|
| 145 | <xsl:variable name="month.name"> |
---|
| 146 | <xsl:choose> |
---|
| 147 | <xsl:when test="$month=1">January</xsl:when> |
---|
| 148 | <xsl:when test="$month=2">February</xsl:when> |
---|
| 149 | <xsl:when test="$month=3">March</xsl:when> |
---|
| 150 | <xsl:when test="$month=4">April</xsl:when> |
---|
| 151 | <xsl:when test="$month=5">May</xsl:when> |
---|
| 152 | <xsl:when test="$month=6">June</xsl:when> |
---|
| 153 | <xsl:when test="$month=7">July</xsl:when> |
---|
| 154 | <xsl:when test="$month=8">August</xsl:when> |
---|
| 155 | <xsl:when test="$month=9">September</xsl:when> |
---|
| 156 | <xsl:when test="$month=10">October</xsl:when> |
---|
| 157 | <xsl:when test="$month=11">November</xsl:when> |
---|
| 158 | <xsl:when test="$month=12">December</xsl:when> |
---|
| 159 | </xsl:choose> |
---|
| 160 | </xsl:variable> |
---|
| 161 | |
---|
| 162 | <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ', |
---|
| 163 | $time, ' ', $timezone)"/> |
---|
| 164 | </xsl:template> |
---|
| 165 | |
---|
| 166 | |
---|
| 167 | <xsl:template match="copyright" mode="boost.footer"> |
---|
| 168 | <xsl:if test="position() > 1"> |
---|
| 169 | <br/> |
---|
| 170 | </xsl:if> |
---|
| 171 | <xsl:call-template name="gentext"> |
---|
| 172 | <xsl:with-param name="key" select="'Copyright'"/> |
---|
| 173 | </xsl:call-template> |
---|
| 174 | <xsl:call-template name="gentext.space"/> |
---|
| 175 | <xsl:call-template name="dingbat"> |
---|
| 176 | <xsl:with-param name="dingbat">copyright</xsl:with-param> |
---|
| 177 | </xsl:call-template> |
---|
| 178 | <xsl:call-template name="gentext.space"/> |
---|
| 179 | <xsl:call-template name="copyright.years"> |
---|
| 180 | <xsl:with-param name="years" select="year"/> |
---|
| 181 | <xsl:with-param name="print.ranges" select="$make.year.ranges"/> |
---|
| 182 | <xsl:with-param name="single.year.ranges" |
---|
| 183 | select="$make.single.year.ranges"/> |
---|
| 184 | </xsl:call-template> |
---|
| 185 | <xsl:call-template name="gentext.space"/> |
---|
| 186 | <xsl:apply-templates select="holder" mode="titlepage.mode"/> |
---|
| 187 | </xsl:template> |
---|
| 188 | |
---|
| 189 | <xsl:template name="user.footer.content"> |
---|
| 190 | <table width="100%"> |
---|
| 191 | <tr> |
---|
| 192 | <td align="left"> |
---|
| 193 | <xsl:variable name="revision-nodes" |
---|
| 194 | select="ancestor-or-self::* |
---|
| 195 | [not (attribute::rev:last-revision='')]"/> |
---|
| 196 | <xsl:if test="count($revision-nodes) > 0"> |
---|
| 197 | <xsl:variable name="revision-node" |
---|
| 198 | select="$revision-nodes[last()]"/> |
---|
| 199 | <xsl:variable name="revision-text"> |
---|
| 200 | <xsl:value-of |
---|
| 201 | select="normalize-space($revision-node/attribute::rev:last-revision)"/> |
---|
| 202 | </xsl:variable> |
---|
| 203 | <xsl:if test="string-length($revision-text) > 0"> |
---|
| 204 | <small> |
---|
| 205 | <p> |
---|
| 206 | <xsl:text>Last revised: </xsl:text> |
---|
| 207 | <xsl:choose> |
---|
| 208 | <xsl:when test="contains($revision-text, '/')"> |
---|
| 209 | <xsl:call-template name="format.cvs.revision"> |
---|
| 210 | <xsl:with-param name="text" select="$revision-text"/> |
---|
| 211 | </xsl:call-template> |
---|
| 212 | </xsl:when> |
---|
| 213 | <xsl:otherwise> |
---|
| 214 | <xsl:call-template name="format.svn.revision"> |
---|
| 215 | <xsl:with-param name="text" select="$revision-text"/> |
---|
| 216 | </xsl:call-template> |
---|
| 217 | </xsl:otherwise> |
---|
| 218 | </xsl:choose> |
---|
| 219 | </p> |
---|
| 220 | </small> |
---|
| 221 | </xsl:if> |
---|
| 222 | </xsl:if> |
---|
| 223 | </td> |
---|
| 224 | <td align="right"> |
---|
| 225 | <small> |
---|
| 226 | <xsl:apply-templates select="ancestor::*/*/copyright" |
---|
| 227 | mode="boost.footer"/> |
---|
| 228 | </small> |
---|
| 229 | </td> |
---|
| 230 | </tr> |
---|
| 231 | </table> |
---|
| 232 | </xsl:template> |
---|
| 233 | |
---|
| 234 | <!-- We don't want refentry's to show up in the TOC because they |
---|
| 235 | will merely be redundant with the synopsis. --> |
---|
| 236 | <xsl:template match="refentry" mode="toc"/> |
---|
| 237 | |
---|
| 238 | <!-- override the behaviour of some DocBook elements for better |
---|
| 239 | rendering facilities --> |
---|
| 240 | |
---|
| 241 | <xsl:template match = "programlisting[ancestor::informaltable]"> |
---|
| 242 | <pre class = "table-{name(.)}"><xsl:apply-templates/></pre> |
---|
| 243 | </xsl:template> |
---|
| 244 | |
---|
| 245 | <xsl:template match = "refsynopsisdiv"> |
---|
| 246 | <h2 class = "{name(.)}-title">Synopsis</h2> |
---|
| 247 | <div class = "{name(.)}"> |
---|
| 248 | <xsl:apply-templates/> |
---|
| 249 | </div> |
---|
| 250 | </xsl:template> |
---|
| 251 | |
---|
| 252 | <!-- ============================================================ --> |
---|
| 253 | |
---|
| 254 | <xsl:template name="output.html.stylesheets"> |
---|
| 255 | <xsl:param name="stylesheets" select="''"/> |
---|
| 256 | |
---|
| 257 | <xsl:choose> |
---|
| 258 | <xsl:when test="contains($stylesheets, ' ')"> |
---|
| 259 | <link rel="stylesheet"> |
---|
| 260 | <xsl:attribute name="href"> |
---|
| 261 | <xsl:call-template name="href.target.relative"> |
---|
| 262 | <xsl:with-param name="target" select="substring-before($stylesheets, ' ')"/> |
---|
| 263 | </xsl:call-template> |
---|
| 264 | </xsl:attribute> |
---|
| 265 | <xsl:if test="$html.stylesheet.type != ''"> |
---|
| 266 | <xsl:attribute name="type"> |
---|
| 267 | <xsl:value-of select="$html.stylesheet.type"/> |
---|
| 268 | </xsl:attribute> |
---|
| 269 | </xsl:if> |
---|
| 270 | </link> |
---|
| 271 | <xsl:call-template name="output.html.stylesheets"> |
---|
| 272 | <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/> |
---|
| 273 | </xsl:call-template> |
---|
| 274 | </xsl:when> |
---|
| 275 | <xsl:when test="$stylesheets != ''"> |
---|
| 276 | <link rel="stylesheet"> |
---|
| 277 | <xsl:attribute name="href"> |
---|
| 278 | <xsl:call-template name="href.target.relative"> |
---|
| 279 | <xsl:with-param name="target" select="$stylesheets"/> |
---|
| 280 | </xsl:call-template> |
---|
| 281 | </xsl:attribute> |
---|
| 282 | <xsl:if test="$html.stylesheet.type != ''"> |
---|
| 283 | <xsl:attribute name="type"> |
---|
| 284 | <xsl:value-of select="$html.stylesheet.type"/> |
---|
| 285 | </xsl:attribute> |
---|
| 286 | </xsl:if> |
---|
| 287 | </link> |
---|
| 288 | </xsl:when> |
---|
| 289 | </xsl:choose> |
---|
| 290 | </xsl:template> |
---|
| 291 | |
---|
| 292 | </xsl:stylesheet> |
---|