Boost logo

Boost-Commit :

From: fmhess_at_[hidden]
Date: 2007-12-18 15:37:10


Author: fmhess
Date: 2007-12-18 15:37:10 EST (Tue, 18 Dec 2007)
New Revision: 42146
URL: http://svn.boost.org/trac/boost/changeset/42146

Log:
Added anchors for typedefs which are inside
classes and have no description (they only appear in the class synopsis).
Some care is taken to make sure only one anchor is added for typedefs in
nested classes, whose synopsis appears on their reference page, and also
inside the synopsis of enclosing classes.

Text files modified:
   sandbox/boost_docs/trunk/tools/boostbook/xsl/type.xsl | 25 ++++++++++++++++++++++---
   1 files changed, 22 insertions(+), 3 deletions(-)

Modified: sandbox/boost_docs/trunk/tools/boostbook/xsl/type.xsl
==============================================================================
--- sandbox/boost_docs/trunk/tools/boostbook/xsl/type.xsl (original)
+++ sandbox/boost_docs/trunk/tools/boostbook/xsl/type.xsl 2007-12-18 15:37:10 EST (Tue, 18 Dec 2007)
@@ -333,8 +333,16 @@
             <xsl:value-of select="substring($type-padding, 1,
                                             $max-type-length - $type-length)"/>
             <xsl:text> </xsl:text>
- <xsl:value-of select="substring(concat(@name, ';', $name-padding),
- 1, $max-name-length)"/>
+ <xsl:variable name="truncated-typedef-name" select="substring(@name,
+ 1, $max-name-length)"/>
+ <xsl:call-template name="link-or-anchor">
+ <xsl:with-param name="to" select="$link-to"/>
+ <xsl:with-param name="text" select="$truncated-typedef-name"/>
+ <xsl:with-param name="link-type" select="$link-type"/>
+ <xsl:with-param name="highlight" select="true()"/>
+ </xsl:call-template>
+ <xsl:value-of select="substring(concat(';', $name-padding),
+ 1, $max-name-length - string-length($truncated-typedef-name))"/>
           </xsl:when>
           <xsl:otherwise>
             <xsl:text> </xsl:text>
@@ -365,6 +373,7 @@
     <xsl:param name="indentation"/>
     <xsl:param name="max-type-length" select="0"/>
     <xsl:param name="max-name-length" select="0"/>
+ <xsl:param name="allow-anchor" select="true()"/>
 
     <!-- True if we should compact this typedef -->
     <xsl:variable name="compact"
@@ -380,7 +389,7 @@
         <xsl:call-template name="type.typedef.display.aligned">
           <xsl:with-param name="compact" select="$compact"/>
           <xsl:with-param name="indentation" select="$indentation"/>
- <xsl:with-param name="is-reference" select="true()"/>
+ <xsl:with-param name="is-reference" select="$allow-anchor"/>
           <xsl:with-param name="max-type-length" select="$max-type-length"/>
           <xsl:with-param name="max-name-length" select="$max-name-length"/>
         </xsl:call-template>
@@ -725,6 +734,8 @@
 
   <xsl:template name="class-members-synopsis">
     <xsl:param name="indentation" select="0"/>
+ <!-- Used to suppress anchors in nested synopsis, so we don't get multiple anchors -->
+ <xsl:param name="allow-synopsis-anchors" select="false()"/>
 
     <!-- Typedefs -->
     <xsl:if test="typedef">
@@ -767,6 +778,7 @@
           select="$max-type-length"/>
         <xsl:with-param name="max-name-length"
           select="$max-name-length"/>
+ <xsl:with-param name="allow-anchor" select="$allow-synopsis-anchors"/>
       </xsl:apply-templates>
     </xsl:if>
 
@@ -833,17 +845,21 @@
 
   <xsl:template match="access" mode="synopsis">
     <xsl:param name="indentation" select="0"/>
+ <xsl:param name="allow-synopsis-anchors" select="false()"/>
+
     <xsl:call-template name="print-access-specification">
       <xsl:with-param name="indentation" select="$indentation"/>
       <xsl:with-param name="specification" select="@name"/>
     </xsl:call-template>
     <xsl:call-template name="class-members-synopsis">
       <xsl:with-param name="indentation" select="$indentation"/>
+ <xsl:with-param name="allow-synopsis-anchors" select="$allow-synopsis-anchors"/>
     </xsl:call-template>
   </xsl:template>
 
   <xsl:template name="class-type-synopsis">
     <xsl:param name="indentation" select="0"/>
+ <xsl:param name="allow-synopsis-anchors" select="false()"/>
 
     <!-- The keyword used to declare this class type, e.g., class,
          struct, or union. -->
@@ -937,10 +953,12 @@
 
     <xsl:call-template name="class-members-synopsis">
       <xsl:with-param name="indentation" select="$indentation"/>
+ <xsl:with-param name="allow-synopsis-anchors" select="$allow-synopsis-anchors"/>
     </xsl:call-template>
 
     <xsl:apply-templates select="access" mode="synopsis">
       <xsl:with-param name="indentation" select="$indentation"/>
+ <xsl:with-param name="allow-synopsis-anchors" select="$allow-synopsis-anchors"/>
     </xsl:apply-templates>
 
     <!-- Closing brace -->
@@ -1046,6 +1064,7 @@
       <xsl:with-param name="synopsis">
         <xsl:call-template name="class-type-synopsis">
           <xsl:with-param name="indentation" select="$indentation"/>
+ <xsl:with-param name="allow-synopsis-anchors" select="true()"/>
         </xsl:call-template>
         <!-- Associated free functions -->
         <xsl:apply-templates select="ancestor-or-self::*/free-function-group"


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