added callouts

[SVN r37025]
This commit is contained in:
Joel de Guzman 2007-02-21 00:48:30 +00:00
parent 146e5f926a
commit c3807f9680
2 changed files with 84 additions and 14 deletions

69
xsl/callout.xsl Normal file
View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2007 Joel de Guzman <djowel -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/callout.xsl"/>
<xsl:import href="relative-href.xsl"/>
<xsl:template name="callout-bug">
<xsl:param name="conum" select='1'/>
<xsl:choose>
<xsl:when test="$callout.graphics != 0
and $conum &lt;= $callout.graphics.number.limit">
<xsl:variable name="relative_callout_graphics_path">
<xsl:call-template name="href.target.relative">
<xsl:with-param name="target" select="$callout.graphics.path"/>
</xsl:call-template>
</xsl:variable>
<img src="{$relative_callout_graphics_path}{$conum}{$callout.graphics.extension}"
alt="{$conum}" border="0"/>
</xsl:when>
<xsl:when test="$callout.unicode != 0
and $conum &lt;= $callout.unicode.number.limit">
<xsl:choose>
<xsl:when test="$callout.unicode.start.character = 10102">
<xsl:choose>
<xsl:when test="$conum = 1">&#10102;</xsl:when>
<xsl:when test="$conum = 2">&#10103;</xsl:when>
<xsl:when test="$conum = 3">&#10104;</xsl:when>
<xsl:when test="$conum = 4">&#10105;</xsl:when>
<xsl:when test="$conum = 5">&#10106;</xsl:when>
<xsl:when test="$conum = 6">&#10107;</xsl:when>
<xsl:when test="$conum = 7">&#10108;</xsl:when>
<xsl:when test="$conum = 8">&#10109;</xsl:when>
<xsl:when test="$conum = 9">&#10110;</xsl:when>
<xsl:when test="$conum = 10">&#10111;</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Don't know how to generate Unicode callouts </xsl:text>
<xsl:text>when $callout.unicode.start.character is </xsl:text>
<xsl:value-of select="$callout.unicode.start.character"/>
</xsl:message>
<xsl:text>(</xsl:text>
<xsl:value-of select="$conum"/>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>(</xsl:text>
<xsl:value-of select="$conum"/>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com> Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0. Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) http://www.boost.org/LICENSE_1_0.txt)
@ -20,6 +20,7 @@
<xsl:import href="admon.xsl"/> <xsl:import href="admon.xsl"/>
<xsl:import href="xref.xsl"/> <xsl:import href="xref.xsl"/>
<xsl:import href="relative-href.xsl"/> <xsl:import href="relative-href.xsl"/>
<xsl:import href="callout.xsl"/>
<xsl:param name="admon.style"/> <xsl:param name="admon.style"/>
<xsl:param name="admon.graphics">1</xsl:param> <xsl:param name="admon.graphics">1</xsl:param>
@ -36,7 +37,7 @@
<xsl:param name="doc.standalone">false</xsl:param> <xsl:param name="doc.standalone">false</xsl:param>
<xsl:param name="chunker.output.indent">yes</xsl:param> <xsl:param name="chunker.output.indent">yes</xsl:param>
<xsl:param name="toc.max.depth">2</xsl:param> <xsl:param name="toc.max.depth">2</xsl:param>
<xsl:param name="admon.style"> <xsl:param name="admon.style">
<!-- Remove the style. Let the CSS do the styling --> <!-- Remove the style. Let the CSS do the styling -->
</xsl:param> </xsl:param>
@ -69,22 +70,22 @@ set toc,title
<xsl:param name="text"/> <xsl:param name="text"/>
<!-- Remove the "$Date: " --> <!-- Remove the "$Date: " -->
<xsl:variable name="text.noprefix" <xsl:variable name="text.noprefix"
select="substring-after($text, '$Date: ')"/> select="substring-after($text, '$Date: ')"/>
<!-- Grab the year --> <!-- Grab the year -->
<xsl:variable name="year" select="substring-before($text.noprefix, '/')"/> <xsl:variable name="year" select="substring-before($text.noprefix, '/')"/>
<xsl:variable name="text.noyear" <xsl:variable name="text.noyear"
select="substring-after($text.noprefix, '/')"/> select="substring-after($text.noprefix, '/')"/>
<!-- Grab the month --> <!-- Grab the month -->
<xsl:variable name="month" select="substring-before($text.noyear, '/')"/> <xsl:variable name="month" select="substring-before($text.noyear, '/')"/>
<xsl:variable name="text.nomonth" <xsl:variable name="text.nomonth"
select="substring-after($text.noyear, '/')"/> select="substring-after($text.noyear, '/')"/>
<!-- Grab the year --> <!-- Grab the year -->
<xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/> <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
<xsl:variable name="text.noday" <xsl:variable name="text.noday"
select="substring-after($text.nomonth, ' ')"/> select="substring-after($text.nomonth, ' ')"/>
<!-- Get the time --> <!-- Get the time -->
@ -116,27 +117,27 @@ set toc,title
<xsl:param name="text"/> <xsl:param name="text"/>
<!-- Remove the "$Date: " --> <!-- Remove the "$Date: " -->
<xsl:variable name="text.noprefix" <xsl:variable name="text.noprefix"
select="substring-after($text, '$Date: ')"/> select="substring-after($text, '$Date: ')"/>
<!-- Grab the year --> <!-- Grab the year -->
<xsl:variable name="year" select="substring-before($text.noprefix, '-')"/> <xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
<xsl:variable name="text.noyear" <xsl:variable name="text.noyear"
select="substring-after($text.noprefix, '-')"/> select="substring-after($text.noprefix, '-')"/>
<!-- Grab the month --> <!-- Grab the month -->
<xsl:variable name="month" select="substring-before($text.noyear, '-')"/> <xsl:variable name="month" select="substring-before($text.noyear, '-')"/>
<xsl:variable name="text.nomonth" <xsl:variable name="text.nomonth"
select="substring-after($text.noyear, '-')"/> select="substring-after($text.noyear, '-')"/>
<!-- Grab the year --> <!-- Grab the year -->
<xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/> <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
<xsl:variable name="text.noday" <xsl:variable name="text.noday"
select="substring-after($text.nomonth, ' ')"/> select="substring-after($text.nomonth, ' ')"/>
<!-- Get the time --> <!-- Get the time -->
<xsl:variable name="time" select="substring-before($text.noday, ' ')"/> <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
<xsl:variable name="text.notime" <xsl:variable name="text.notime"
select="substring-after($text.noday, ' ')"/> select="substring-after($text.noday, ' ')"/>
<!-- Get the timezone --> <!-- Get the timezone -->
@ -190,14 +191,14 @@ set toc,title
<table width="100%"> <table width="100%">
<tr> <tr>
<td align="left"> <td align="left">
<xsl:variable name="revision-nodes" <xsl:variable name="revision-nodes"
select="ancestor-or-self::* select="ancestor-or-self::*
[not (attribute::rev:last-revision='')]"/> [not (attribute::rev:last-revision='')]"/>
<xsl:if test="count($revision-nodes) &gt; 0"> <xsl:if test="count($revision-nodes) &gt; 0">
<xsl:variable name="revision-node" <xsl:variable name="revision-node"
select="$revision-nodes[last()]"/> select="$revision-nodes[last()]"/>
<xsl:variable name="revision-text"> <xsl:variable name="revision-text">
<xsl:value-of <xsl:value-of
select="normalize-space($revision-node/attribute::rev:last-revision)"/> select="normalize-space($revision-node/attribute::rev:last-revision)"/>
</xsl:variable> </xsl:variable>
<xsl:if test="string-length($revision-text) &gt; 0"> <xsl:if test="string-length($revision-text) &gt; 0">
@ -223,7 +224,7 @@ set toc,title
</td> </td>
<td align="right"> <td align="right">
<small> <small>
<xsl:apply-templates select="ancestor::*/*/copyright" <xsl:apply-templates select="ancestor::*/*/copyright"
mode="boost.footer"/> mode="boost.footer"/>
</small> </small>
</td> </td>