Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75447 - trunk/tools/boostbook/xsl
From: dnljms_at_[hidden]
Date: 2011-11-10 14:40:20


Author: danieljames
Date: 2011-11-10 14:40:19 EST (Thu, 10 Nov 2011)
New Revision: 75447
URL: http://svn.boost.org/trac/boost/changeset/75447

Log:
Boostbook: Make the class template parameter docs fit its context. Refs #6105

Would be nice to integrate this properly with the existing template
code. Especially so that the template parameters in the synopsis could
link to their purpose. Also, I think the long descriptions should be
suppressed when `template.param.brief` is true.
Text files modified:
   trunk/tools/boostbook/xsl/type.xsl | 71 +++++++++++++++++++++------------------
   1 files changed, 38 insertions(+), 33 deletions(-)

Modified: trunk/tools/boostbook/xsl/type.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/type.xsl (original)
+++ trunk/tools/boostbook/xsl/type.xsl 2011-11-10 14:40:19 EST (Thu, 10 Nov 2011)
@@ -1057,6 +1057,43 @@
     </xsl:call-template>
   </xsl:template>
 
+ <!-- Document template parameters -->
+ <xsl:template name="class-templates-reference">
+ <xsl:if test="(template/template-type-parameter/purpose|
+ template/template-nontype-parameter/purpose)
+ and not($template.param.brief)">
+ <refsect2>
+ <title>Template Parameters</title>
+ <orderedlist>
+ <xsl:for-each select="template/template-type-parameter|
+ template/template-nontype-parameter">
+ <listitem>
+ <para>
+ <xsl:variable name="link-to">
+ <xsl:call-template name="generate.id"/>
+ </xsl:variable>
+
+ <xsl:call-template name="preformatted">
+ <xsl:with-param name="text">
+ <xsl:call-template name="template.parameter">
+ <xsl:with-param name="parameter" select="."/>
+ <xsl:with-param name="highlight" select="true()"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </para>
+ <xsl:if test="purpose">
+ <para>
+ <xsl:apply-templates select="purpose/*"/>
+ </para>
+ </xsl:if>
+ </listitem>
+ </xsl:for-each>
+ </orderedlist>
+ </refsect2>
+ </xsl:if>
+ </xsl:template>
+
   <xsl:template name="member-typedefs-reference">
     <!-- True if there are any non-compacted typedefs -->
     <xsl:variable name="have-typedef-references"
@@ -1192,39 +1229,7 @@
           <xsl:apply-templates select="para" mode="annotation"/>
         </xsl:if>
         <xsl:apply-templates select="description"/>
-
- <!-- Document template parameters -->
- <xsl:if test="(template/template-type-parameter/purpose|
- template/template-nontype-parameter/purpose)
- and not($template.param.brief)">
- <varlistentry>
- <term>Template Parameters:</term>
- <listitem>
- <variablelist spacing="compact">
- <xsl:processing-instruction name="dbhtml">
- list-presentation="table"
- </xsl:processing-instruction>
- <xsl:for-each select="template/template-type-parameter|
- template/template-nontype-parameter">
- <xsl:sort select="attribute::name"/>
- <xsl:if test="purpose">
- <varlistentry>
- <term>
- <xsl:call-template name="monospaced">
- <xsl:with-param name="text" select="@name"/>
- </xsl:call-template>
- </term>
- <listitem>
- <xsl:apply-templates select="purpose/*"/>
- </listitem>
- </varlistentry>
- </xsl:if>
- </xsl:for-each>
- </variablelist>
- </listitem>
- </varlistentry>
- </xsl:if>
-
+ <xsl:call-template name="class-templates-reference"/>
         <xsl:call-template name="class-members-reference"/>
         <xsl:apply-templates select="access" mode="namespace-reference"/>
 


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