Boost logo

Boost-Commit :

From: fmhess_at_[hidden]
Date: 2007-11-02 18:40:25


Author: fmhess
Date: 2007-11-02 18:40:25 EDT (Fri, 02 Nov 2007)
New Revision: 40703
URL: http://svn.boost.org/trac/boost/changeset/40703

Log:
Added descriptions of class member typedefs to class documentation. This
replaces Daniel James' previous one-line patch from changeset 39711.

Text files modified:
   trunk/tools/boostbook/xsl/reference.xsl | 4
   trunk/tools/boostbook/xsl/type.xsl | 83 +++++++++++++++++++++++++++++++++++++--
   2 files changed, 80 insertions(+), 7 deletions(-)

Modified: trunk/tools/boostbook/xsl/reference.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/reference.xsl (original)
+++ trunk/tools/boostbook/xsl/reference.xsl 2007-11-02 18:40:25 EDT (Fri, 02 Nov 2007)
@@ -82,14 +82,14 @@
 
   <!-- Emit namespace reference -->
   <xsl:template match="namespace" mode="reference">
- <xsl:apply-templates select="namespace|typedef|free-function-group"
+ <xsl:apply-templates select="namespace|free-function-group"
       mode="reference">
       <xsl:with-param name="indentation" select="0"/>
     </xsl:apply-templates>
     <xsl:apply-templates select="class|class-specialization|
                                  struct|struct-specialization|
                                  union|union-specialization|enum|function|
- overloaded-function|data-member"
+ overloaded-function|data-member|typedef"
       mode="namespace-reference"/>
   </xsl:template>
 

Modified: trunk/tools/boostbook/xsl/type.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/type.xsl (original)
+++ trunk/tools/boostbook/xsl/type.xsl 2007-11-02 18:40:25 EDT (Fri, 02 Nov 2007)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
    Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+ Copyright (c) 2007 Frank Mori Hess <fmhess_at_[hidden]>
 
    Distributed under the Boost Software License, Version 1.0.
    (See accompanying file LICENSE_1_0.txt or copy at
@@ -379,7 +380,7 @@
   </xsl:template>
 
   <!-- Emit a typedef reference entry -->
- <xsl:template match="typedef" mode="reference">
+ <xsl:template match="typedef" mode="namespace-reference">
     <!-- True if this typedef was compacted -->
     <xsl:variable name="compact"
       select="not (para|description) and ($boost.compact.typedef='1')"/>
@@ -412,6 +413,26 @@
     </xsl:if>
   </xsl:template>
 
+ <xsl:template match="typedef" mode="reference">
+ <!-- True if this typedef was compacted -->
+ <xsl:variable name="compact"
+ select="not (para|description) and ($boost.compact.typedef='1')"/>
+
+ <xsl:if test="not ($compact)">
+ <listitem>
+ <para>
+ <xsl:call-template name="type.typedef.display.aligned">
+ <xsl:with-param name="compact" select="false()"/>
+ <xsl:with-param name="indentation" select="0"/>
+ <xsl:with-param name="is-reference" select="true()"/>
+ <xsl:with-param name="link-type" select="'anchor'"/>
+ </xsl:call-template>
+ </para>
+ <xsl:apply-templates select="description"/>
+ </listitem>
+ </xsl:if>
+ </xsl:template>
+
   <!-- Emit a list of static constants -->
   <xsl:template match="static-constant" mode="synopsis">
     <xsl:param name="indentation"/>
@@ -698,9 +719,26 @@
       <xsl:call-template name="indent">
         <xsl:with-param name="indentation" select="$indentation + 2"/>
       </xsl:call-template>
- <xsl:call-template name="highlight-comment">
- <xsl:with-param name="text" select="'// types'"/>
- </xsl:call-template>
+ <emphasis>
+ <xsl:text>// </xsl:text>
+ <!-- True if there are any non-compacted typedefs -->
+ <xsl:variable name="have-typedef-references"
+ select="typedef and ((typedef/para|typedef/description) or ($boost.compact.typedef='0'))"/>
+ <xsl:choose>
+ <xsl:when test="$have-typedef-references">
+ <xsl:call-template name="internal-link">
+ <xsl:with-param name="to">
+ <xsl:call-template name="generate.id"/>
+ <xsl:text>types</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="text" select="'types'"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>types</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </emphasis>
 
       <xsl:variable name="max-type-length">
         <xsl:call-template name="find-max-type-length"/>
@@ -863,7 +901,7 @@
     <xsl:if test="contains(local-name(.), 'class')">
       <xsl:if test="count(static-constant|typedef|enum|
         copy-assignment|constructor|destructor|method-group|
- function|method|overloaded-method|data-member|
+ method|overloaded-method|data-member|
         class|class-specialization|
         struct|struct-specialization|
         union|union-specialization) &gt; 0">
@@ -900,7 +938,42 @@
     </xsl:call-template>
   </xsl:template>
 
+ <xsl:template name="member-typedefs-reference">
+ <!-- True if there are any non-compacted typedefs -->
+ <xsl:variable name="have-typedef-references"
+ select="typedef and ((typedef/para|typedef/description) or ($boost.compact.typedef='0'))"/>
+ <xsl:if test="$have-typedef-references">
+ <xsl:call-template name="member-documentation">
+ <xsl:with-param name="name">
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="to">
+ <xsl:call-template name="generate.id"/>
+ <xsl:text>types</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="text" select="''"/>
+ </xsl:call-template>
+ <xsl:call-template name="monospaced">
+ <xsl:with-param name="text">
+ <xsl:call-template name="object-name"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="access-name"/>
+ <xsl:text> types</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="text">
+ <orderedlist>
+ <xsl:apply-templates select="typedef" mode="reference"/>
+ </orderedlist>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
   <xsl:template name="class-members-reference">
+
+ <xsl:call-template name="member-typedefs-reference"/>
+
     <xsl:call-template name="construct-copy-destruct-reference"/>
 
     <xsl:apply-templates


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