Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49669 - trunk/tools/boostbook/xsl
From: daniel_james_at_[hidden]
Date: 2008-11-09 16:57:39


Author: danieljames
Date: 2008-11-09 16:57:38 EST (Sun, 09 Nov 2008)
New Revision: 49669
URL: http://svn.boost.org/trac/boost/changeset/49669

Log:
Add link to the header to the synopsis in reference documentation.
Refs #2214
Text files modified:
   trunk/tools/boostbook/xsl/docbook.xsl | 21 +++++++++++++++++++++
   trunk/tools/boostbook/xsl/function.xsl | 2 ++
   trunk/tools/boostbook/xsl/global.xsl | 1 +
   trunk/tools/boostbook/xsl/macro.xsl | 1 +
   trunk/tools/boostbook/xsl/type.xsl | 3 +++
   5 files changed, 28 insertions(+), 0 deletions(-)

Modified: trunk/tools/boostbook/xsl/docbook.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/docbook.xsl (original)
+++ trunk/tools/boostbook/xsl/docbook.xsl 2008-11-09 16:57:38 EST (Sun, 09 Nov 2008)
@@ -474,4 +474,25 @@
   <xsl:template match="part/part/chapter/chapterinfo|part/part/appendix/appendixinfo">
     <sectioninfo><xsl:apply-templates/></sectioninfo>
   </xsl:template>
+
+ <!-- Header link comment to be inserted at the start of a reference page's
+ synopsis -->
+ <xsl:template name="header-link">
+ <xsl:if test="ancestor::header">
+ <xsl:call-template name="highlight-comment">
+ <xsl:with-param name="text">
+ <xsl:text>// In header: &lt;</xsl:text>
+ <xsl:call-template name="internal-link">
+ <xsl:with-param name="to">
+ <xsl:call-template name="generate.id">
+ <xsl:with-param name="node" select="ancestor::header[1]"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="text" select="ancestor::header[1]/@name" />
+ </xsl:call-template>
+ <xsl:text>&gt;&#10;&#10;</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
 </xsl:stylesheet>

Modified: trunk/tools/boostbook/xsl/function.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/function.xsl (original)
+++ trunk/tools/boostbook/xsl/function.xsl 2008-11-09 16:57:38 EST (Sun, 09 Nov 2008)
@@ -895,6 +895,7 @@
           <xsl:call-template name="generate.id"/>
         </xsl:with-param>
         <xsl:with-param name="synopsis">
+ <xsl:call-template name="header-link"/>
           <xsl:call-template name="function">
             <xsl:with-param name="indentation" select="0"/>
             <xsl:with-param name="is-reference" select="true()"/>
@@ -976,6 +977,7 @@
           <xsl:call-template name="generate.id"/>
         </xsl:with-param>
         <xsl:with-param name="synopsis">
+ <xsl:call-template name="header-link"/>
           <xsl:for-each select="signature">
             <xsl:call-template name="function">
               <xsl:with-param name="indentation" select="0"/>

Modified: trunk/tools/boostbook/xsl/global.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/global.xsl (original)
+++ trunk/tools/boostbook/xsl/global.xsl 2008-11-09 16:57:38 EST (Sun, 09 Nov 2008)
@@ -39,6 +39,7 @@
         </xsl:call-template>
       </xsl:with-param>
       <xsl:with-param name="synopsis">
+ <xsl:call-template name="header-link"/>
         <xsl:call-template name="global-synopsis-impl">
           <xsl:with-param name="link-type" select="'none'" />
         </xsl:call-template>

Modified: trunk/tools/boostbook/xsl/macro.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/macro.xsl (original)
+++ trunk/tools/boostbook/xsl/macro.xsl 2008-11-09 16:57:38 EST (Sun, 09 Nov 2008)
@@ -38,6 +38,7 @@
         </xsl:call-template>
       </xsl:with-param>
       <xsl:with-param name="synopsis">
+ <xsl:call-template name="header-link"/>
         <xsl:call-template name="macro-synopsis">
           <xsl:with-param name="link-type" select="'none'"/>
         </xsl:call-template>

Modified: trunk/tools/boostbook/xsl/type.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/type.xsl (original)
+++ trunk/tools/boostbook/xsl/type.xsl 2008-11-09 16:57:38 EST (Sun, 09 Nov 2008)
@@ -410,6 +410,7 @@
           </xsl:call-template>
         </xsl:with-param>
         <xsl:with-param name="synopsis">
+ <xsl:call-template name="header-link"/>
           <xsl:call-template name="type.typedef.display.aligned">
             <xsl:with-param name="compact" select="false()"/>
             <xsl:with-param name="indentation" select="0"/>
@@ -1056,6 +1057,7 @@
         <xsl:call-template name="type.display.name"/>
       </xsl:with-param>
       <xsl:with-param name="synopsis">
+ <xsl:call-template name="header-link"/>
         <xsl:call-template name="class-type-synopsis">
           <xsl:with-param name="indentation" select="$indentation"/>
           <xsl:with-param name="allow-synopsis-anchors" select="true()"/>
@@ -1300,6 +1302,7 @@
           </xsl:call-template>
         </xsl:with-param>
         <xsl:with-param name="synopsis">
+ <xsl:call-template name="header-link"/>
           <xsl:call-template name="type.enum.display"/>
         </xsl:with-param>
 


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