Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2008-07-29 01:39:00


Author: eric_niebler
Date: 2008-07-29 01:38:59 EDT (Tue, 29 Jul 2008)
New Revision: 47861
URL: http://svn.boost.org/trac/boost/changeset/47861

Log:
add globalname for linking to the documentation for a global object
Text files modified:
   trunk/tools/boostbook/xsl/annotation.xsl | 31 +++++++++++++++++++++++++++++++
   trunk/tools/boostbook/xsl/docbook.xsl | 2 +-
   trunk/tools/boostbook/xsl/source-highlight.xsl | 2 +-
   3 files changed, 33 insertions(+), 2 deletions(-)

Modified: trunk/tools/boostbook/xsl/annotation.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/annotation.xsl (original)
+++ trunk/tools/boostbook/xsl/annotation.xsl 2008-07-29 01:38:59 EDT (Tue, 29 Jul 2008)
@@ -16,6 +16,7 @@
   <xsl:key name="libraries" match="library" use="@name"/>
   <xsl:key name="macros" match="macro" use="@name"/>
   <xsl:key name="headers" match="header" use="@name"/>
+ <xsl:key name="globals" match="namespace/data-member|header/data-member" use="@name"/>
   <xsl:key name="named-entities" match="class|struct|union|concept|function|overloaded-function|macro|library|namespace/data-member|header/data-member|*[attribute::id]" use="@name|@id"/>
 
   <xsl:template match="function|overloaded-function" mode="generate.id">
@@ -84,6 +85,36 @@
     </xsl:call-template>
   </xsl:template>
 
+ <xsl:template match="globalname" mode="annotation">
+ <!-- Determine the (possibly qualified) global name we are looking for -->
+ <xsl:variable name="name">
+ <xsl:choose>
+ <xsl:when test="@alt">
+ <xsl:value-of select="@alt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="string(.)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- Determine the unqualified name -->
+ <xsl:variable name="unqualified-name">
+ <xsl:call-template name="strip-qualifiers">
+ <xsl:with-param name="name" select="$name"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:call-template name="cxx-link-name">
+ <xsl:with-param name="lookup" select="."/>
+ <xsl:with-param name="type" select="'data-member'"/>
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="display-name" select="string(.)"/>
+ <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+ <xsl:with-param name="nodes" select="key('globals', $unqualified-name)"/>
+ </xsl:call-template>
+ </xsl:template>
+
   <xsl:template match="methodname" mode="annotation">
     <!-- Determine the (possibly qualified) method name we are looking for -->
     <xsl:variable name="fullname">

Modified: trunk/tools/boostbook/xsl/docbook.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/docbook.xsl (original)
+++ trunk/tools/boostbook/xsl/docbook.xsl 2008-07-29 01:38:59 EDT (Tue, 29 Jul 2008)
@@ -421,7 +421,7 @@
 
   <!-- These DocBook elements have special meaning. Use the annotation mode -->
   <xsl:template match="classname|methodname|functionname|enumname|
- macroname|headername">
+ macroname|headername|globalname">
     <computeroutput>
       <xsl:apply-templates select="." mode="annotation"/>
     </computeroutput>

Modified: trunk/tools/boostbook/xsl/source-highlight.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/source-highlight.xsl (original)
+++ trunk/tools/boostbook/xsl/source-highlight.xsl 2008-07-29 01:38:59 EDT (Tue, 29 Jul 2008)
@@ -159,7 +159,7 @@
   </xsl:template>
 
   <xsl:template match="classname|methodname|functionname|libraryname|enumname|
- conceptname|macroname" mode="highlight">
+ conceptname|macroname|globalname" mode="highlight">
     <xsl:apply-templates select="." mode="annotation"/>
   </xsl:template>
 </xsl:stylesheet>


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