|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60745 - trunk/libs/asio/doc
From: chris_at_[hidden]
Date: 2010-03-21 08:38:14
Author: chris_kohlhoff
Date: 2010-03-21 08:38:14 EDT (Sun, 21 Mar 2010)
New Revision: 60745
URL: http://svn.boost.org/trac/boost/changeset/60745
Log:
Enhance reference doc generation to handle new operator types.
Text files modified:
trunk/libs/asio/doc/reference.xsl | 78 ++++++++++++++++++++++++++++++++++++---
1 files changed, 72 insertions(+), 6 deletions(-)
Modified: trunk/libs/asio/doc/reference.xsl
==============================================================================
--- trunk/libs/asio/doc/reference.xsl (original)
+++ trunk/libs/asio/doc/reference.xsl 2010-03-21 08:38:14 EDT (Sun, 21 Mar 2010)
@@ -94,6 +94,7 @@
<xsl:if test="
contains(compoundname, 'asio::') and
not(contains(compoundname, '::detail')) and
+ not(contains(compoundname, '::service::key')) and
not(contains(compoundname, '_handler'))">
<xsl:call-template name="class"/>
</xsl:if>
@@ -101,6 +102,7 @@
<xsl:otherwise>
<xsl:if test="
not(contains(ancestor::*/compoundname, '::detail')) and
+ not(contains(ancestor::*/compoundname, '::service::key')) and
not(contains(ancestor::*/compoundname, '_helper'))">
<xsl:call-template name="namespace-memberdef"/>
</xsl:if>
@@ -195,6 +197,12 @@
select="concat(substring-before($name, '!'), '_not_', substring-after($name, '!'))"/>
</xsl:call-template>
</xsl:when>
+ <xsl:when test="contains($name, '->')">
+ <xsl:call-template name="make-id">
+ <xsl:with-param name="name"
+ select="concat(substring-before($name, '->'), '_arrow_', substring-after($name, '->'))"/>
+ </xsl:call-template>
+ </xsl:when>
<xsl:when test="contains($name, '<')">
<xsl:call-template name="make-id">
<xsl:with-param name="name"
@@ -207,12 +215,36 @@
select="concat(substring-before($name, '>'), '_gt_', substring-after($name, '>'))"/>
</xsl:call-template>
</xsl:when>
+ <xsl:when test="contains($name, '[')">
+ <xsl:call-template name="make-id">
+ <xsl:with-param name="name"
+ select="concat(substring-before($name, '['), '_lb_', substring-after($name, '['))"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains($name, ']')">
+ <xsl:call-template name="make-id">
+ <xsl:with-param name="name"
+ select="concat(substring-before($name, ']'), '_rb_', substring-after($name, ']'))"/>
+ </xsl:call-template>
+ </xsl:when>
<xsl:when test="contains($name, '+')">
<xsl:call-template name="make-id">
<xsl:with-param name="name"
select="concat(substring-before($name, '+'), '_plus_', substring-after($name, '+'))"/>
</xsl:call-template>
</xsl:when>
+ <xsl:when test="contains($name, '-')">
+ <xsl:call-template name="make-id">
+ <xsl:with-param name="name"
+ select="concat(substring-before($name, '-'), '_minus_', substring-after($name, '-'))"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains($name, '*')">
+ <xsl:call-template name="make-id">
+ <xsl:with-param name="name"
+ select="concat(substring-before($name, '*'), '_star_', substring-after($name, '*'))"/>
+ </xsl:call-template>
+ </xsl:when>
<xsl:when test="contains($name, '~')">
<xsl:call-template name="make-id">
<xsl:with-param name="name"
@@ -489,6 +521,30 @@
</xsl:template>
+<xsl:template name="escape-name">
+ <xsl:param name="text"/>
+ <xsl:choose>
+ <xsl:when test="contains($text, '[')">
+ <xsl:value-of select="substring-before($text, '[')"/>
+ <xsl:text>\[</xsl:text>
+ <xsl:call-template name="escape-name">
+ <xsl:with-param name="text" select="substring-after($text, '[')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains($text, ']')">
+ <xsl:value-of select="substring-before($text, ']')"/>
+ <xsl:text>\]</xsl:text>
+ <xsl:call-template name="escape-name">
+ <xsl:with-param name="text" select="substring-after($text, ']')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$text"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
<xsl:template match="ref[@kindref='compound']" mode="markup">
<xsl:variable name="name">
<xsl:value-of select="."/>
@@ -669,7 +725,7 @@
<xsl:when test="count(name) > 0">
[[link boost_asio.reference.<xsl:value-of select="$class-id"/>.<xsl:value-of select="name"/>
<xsl:text> </xsl:text>[*<xsl:value-of select="name"/>]]]
- [<xsl:value-of select="briefdescription"/>]
+ [<xsl:call-template name="escape-name"><xsl:with-param name="text" select="briefdescription"/></xsl:call-template>]
</xsl:when>
<xsl:otherwise>
<xsl:variable name="type-name">
@@ -707,6 +763,11 @@
<xsl:variable name="name">
<xsl:value-of select="name"/>
</xsl:variable>
+ <xsl:variable name="escaped-name">
+ <xsl:call-template name="escape-name">
+ <xsl:with-param name="text" select="$name"/>
+ </xsl:call-template>
+ </xsl:variable>
<xsl:variable name="id">
<xsl:call-template name="make-id">
<xsl:with-param name="name" select="$name"/>
@@ -728,7 +789,7 @@
<xsl:if test="$overload-position = 1">
[
[[link boost_asio.reference.<xsl:value-of select="$class-id"/>.<xsl:value-of select="$id"/>
- <xsl:text> </xsl:text>[*<xsl:value-of select="$name"/><xsl:text>]]]
+ <xsl:text> </xsl:text>[*<xsl:value-of select="$escaped-name"/><xsl:text>]]]
[</xsl:text><xsl:value-of select="briefdescription"/>
</xsl:if>
<xsl:if test="not($overload-position = 1) and not(briefdescription = preceding-sibling::*/briefdescription)">
@@ -945,6 +1006,11 @@
<xsl:variable name="name">
<xsl:value-of select="name"/>
</xsl:variable>
+ <xsl:variable name="escaped-name">
+ <xsl:call-template name="escape-name">
+ <xsl:with-param name="text" select="$name"/>
+ </xsl:call-template>
+ </xsl:variable>
<xsl:variable name="id">
<xsl:call-template name="make-id">
<xsl:with-param name="name" select="$name"/>
@@ -966,10 +1032,10 @@
<xsl:if test="$overload-count > 1 and $overload-position = 1">
[section:<xsl:value-of select="$id"/><xsl:text> </xsl:text>
-<xsl:value-of select="$class-name"/>::<xsl:value-of select="$name"/>]
+<xsl:value-of select="$class-name"/>::<xsl:value-of select="$escaped-name"/>]
<xsl:text>[indexterm2 </xsl:text>
-<xsl:value-of select="$name"/>
+<xsl:value-of select="$escaped-name"/>
<xsl:text>..</xsl:text>
<xsl:value-of select="$class-name"/>
<xsl:text>] </xsl:text>
@@ -1005,7 +1071,7 @@
[section:<xsl:if test="$overload-count = 1"><xsl:value-of select="$id"/></xsl:if>
<xsl:if test="$overload-count > 1">overload<xsl:value-of select="$overload-position"/></xsl:if>
-<xsl:text> </xsl:text><xsl:value-of select="$class-name"/>::<xsl:value-of select="$name"/>
+<xsl:text> </xsl:text><xsl:value-of select="$class-name"/>::<xsl:value-of select="$escaped-name"/>
<xsl:if test="$overload-count > 1"> (<xsl:value-of
select="$overload-position"/> of <xsl:value-of select="$overload-count"/> overloads)</xsl:if>]
@@ -1020,7 +1086,7 @@
<xsl:if test="$overload-count = 1">
<xsl:text>[indexterm2 </xsl:text>
- <xsl:value-of select="$name"/>
+ <xsl:value-of select="$escaped-name"/>
<xsl:text>..</xsl:text>
<xsl:value-of select="$class-name"/>
<xsl:text>] </xsl:text>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk