Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52345 - in branches/release: . tools/boostbook/test/doxygen tools/boostbook/test/doxygen/boost tools/boostbook/xsl/doxygen tools/quickbook/detail
From: daniel_james_at_[hidden]
Date: 2009-04-12 06:19:48


Author: danieljames
Date: 2009-04-12 06:19:46 EDT (Sun, 12 Apr 2009)
New Revision: 52345
URL: http://svn.boost.org/trac/boost/changeset/52345

Log:
Merge various documentation changes.

Merged revisions 51323-51324,51680,52082-52083,52237,52321,52326,52344 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r51323 | danieljames | 2009-02-18 21:24:36 +0000 (Wed, 18 Feb 2009) | 1 line
  
  More information in error messages in the doxygen2boostbook script.
........
  r51324 | danieljames | 2009-02-18 21:25:12 +0000 (Wed, 18 Feb 2009) | 1 line
  
  Deal with top level enums from doxygen.
........
  r51680 | danieljames | 2009-03-10 08:09:14 +0000 (Tue, 10 Mar 2009) | 1 line
  
  Try to support inbodydescription in doxygen xml.
........
  r52082 | danieljames | 2009-03-31 20:43:13 +0100 (Tue, 31 Mar 2009) | 1 line
  
  Support global variable reference in boostbook.
........
  r52083 | danieljames | 2009-03-31 20:43:35 +0100 (Tue, 31 Mar 2009) | 2 lines
  
  Support reference for variables that are both static and mutable in
  boostbook.
........
  r52237 | danieljames | 2009-04-07 20:26:18 +0100 (Tue, 07 Apr 2009) | 7 lines
  
  Fix calculate_relative_path
  
  When outdir == "." calculate_relative_path was counting that dot as a
  directory and adding an extra ".." to the result. So only count parts
  that don't equal ".".
  
  Refs #2921
........
  r52321 | danieljames | 2009-04-11 08:55:00 +0100 (Sat, 11 Apr 2009) | 5 lines
  
  Partially revert [51323].
  
  It added partial support for protected and private attributes and friend
  functions. But since it isn't complete support it was doing more harm
  than good.
........
  r52326 | danieljames | 2009-04-11 13:38:30 +0100 (Sat, 11 Apr 2009) | 1 line
  
  Workaround buggy doxygen output. Refs #2937
........
  r52344 | danieljames | 2009-04-12 11:06:24 +0100 (Sun, 12 Apr 2009) | 1 line
  
  Add a test document for doxygen integration.
........

Added:
   branches/release/tools/boostbook/test/doxygen/
      - copied from r52344, /trunk/tools/boostbook/test/doxygen/
   branches/release/tools/boostbook/test/doxygen/Jamfile.v2
      - copied unchanged from r52344, /trunk/tools/boostbook/test/doxygen/Jamfile.v2
   branches/release/tools/boostbook/test/doxygen/boost/
      - copied from r52344, /trunk/tools/boostbook/test/doxygen/boost/
   branches/release/tools/boostbook/test/doxygen/boost/example.hpp
      - copied unchanged from r52344, /trunk/tools/boostbook/test/doxygen/boost/example.hpp
   branches/release/tools/boostbook/test/doxygen/example.xml
      - copied unchanged from r52344, /trunk/tools/boostbook/test/doxygen/example.xml
Properties modified:
   branches/release/ (props changed)
Text files modified:
   branches/release/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl | 114 +++++++++++++++++++++++++++++++--------
   branches/release/tools/quickbook/detail/actions.cpp | 9 ++-
   2 files changed, 95 insertions(+), 28 deletions(-)

Modified: branches/release/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl (original)
+++ branches/release/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl 2009-04-12 06:19:46 EDT (Sun, 12 Apr 2009)
@@ -51,7 +51,24 @@
   <xsl:key name="compounds-by-id" match="compounddef" use="@id"/>
   <xsl:key name="members-by-id" match="memberdef" use="@id" />
 
- <xsl:strip-space elements="briefdescription detaileddescription"/>
+ <xsl:strip-space elements="briefdescription detaileddescription inbodydescription"/>
+
+ <xsl:template name="kind-error-message">
+ <xsl:param name="message"/>
+
+ <xsl:variable name="location" select=".//location[1]" />
+ <xsl:variable name="name" select="./name" />
+
+ <xsl:message>
+ <xsl:if test="$location">
+ <xsl:value-of select="concat($location/@file, ':', $location/@line, ': ')" />
+ </xsl:if>
+ <xsl:value-of select="concat($message, ' with kind=', @kind)" />
+ <xsl:if test="$name">
+ <xsl:value-of select="concat(' (name=', $name, ') ')" />
+ </xsl:if>
+ </xsl:message>
+ </xsl:template>
 
   <!-- translate-name: given a string, return a string suitable for use as a refid -->
   <xsl:template name="translate-name">
@@ -101,6 +118,7 @@
            tell us what is \internal and what isn't. -->
       <xsl:when test="contains(detaileddescription/para, 'INTERNAL ONLY')"/>
       <xsl:when test="contains(briefdescription/para, 'INTERNAL ONLY')"/>
+ <xsl:when test="contains(inbodydescription/para, 'INTERNAL ONLY')"/>
 
       <xsl:when test="@kind='file'">
         <xsl:call-template name="file"/>
@@ -131,9 +149,9 @@
         </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
- <xsl:message>
-Cannot handle compounddef with kind=<xsl:value-of select="@kind"/>
- </xsl:message>
+ <xsl:call-template name="kind-error-message">
+ <xsl:with-param name="message" select="'Cannot handle compounddef'"/>
+ </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
@@ -242,6 +260,7 @@
 
         <xsl:apply-templates select="briefdescription" mode="passthrough"/>
         <xsl:apply-templates select="detaileddescription" mode="passthrough"/>
+ <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
         <xsl:apply-templates/>
       </xsl:element>
     </xsl:if>
@@ -267,6 +286,7 @@
         
         <xsl:apply-templates select="briefdescription" mode="passthrough"/>
         <xsl:apply-templates select="detaileddescription" mode="passthrough"/>
+ <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
       </enum>
     </xsl:if>
   </xsl:template>
@@ -285,6 +305,7 @@
 
       <xsl:apply-templates select="briefdescription" mode="passthrough"/>
       <xsl:apply-templates select="detaileddescription" mode="passthrough"/>
+ <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
     </enumvalue>
   </xsl:template>
 
@@ -343,9 +364,10 @@
           </xsl:call-template>
         </xsl:attribute>
         
- <xsl:if test="briefdescription/*|detaileddescription/*">
+ <xsl:if test="briefdescription/*|detaileddescription/*|inbodydescription/*">
           <xsl:apply-templates select="briefdescription/*" mode="passthrough"/>
           <xsl:apply-templates select="detaileddescription/*" mode="passthrough"/>
+ <xsl:apply-templates select="inbdoydescription/*" mode="passthrough"/>
         </xsl:if>
         
         <xsl:apply-templates mode="toplevel">
@@ -436,6 +458,7 @@
            tell us what is \internal and what isn't. -->
       <xsl:when test="contains(detaileddescription/para, 'INTERNAL ONLY')"/>
       <xsl:when test="contains(briefdescription/para, 'INTERNAL ONLY')"/>
+ <xsl:when test="contains(inbodydescription/para, 'INTERNAL ONLY')"/>
 
       <xsl:when test="@kind='define'">
         <macro>
@@ -459,6 +482,7 @@
 
           <xsl:apply-templates select="briefdescription" mode="passthrough"/>
           <xsl:apply-templates select="detaileddescription" mode="passthrough"/>
+ <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
         </macro>
       </xsl:when>
 
@@ -470,9 +494,18 @@
         <xsl:call-template name="typedef" />
       </xsl:when>
 
+ <xsl:when test="@kind='variable'">
+ <xsl:call-template name="variable" />
+ </xsl:when>
+
+ <xsl:when test="@kind='enum'">
+ <xsl:call-template name="enum" />
+ </xsl:when>
+
       <xsl:otherwise>
- <xsl:message>Cannot handle toplevel memberdef element with
- kind=<xsl:value-of select="@kind"/></xsl:message>
+ <xsl:call-template name="kind-error-message">
+ <xsl:with-param name="message" select="'Cannot handle toplevel memberdef element'"/>
+ </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
@@ -530,6 +563,22 @@
           </xsl:if>
         </template-type-parameter>
       </xsl:when>
+ <!-- Doxygen 1.5.8 generates odd xml for template type parameters.
+ This deals with that -->
+ <xsl:when test="not(declname) and
+ (starts-with(string(type), 'class ') or starts-with(string(type), 'typename '))">
+ <template-type-parameter>
+ <xsl:attribute name="name">
+ <xsl:value-of select="normalize-space(substring-after(string(type), ' '))"/>
+ </xsl:attribute>
+ <xsl:if test="defval">
+ <default>
+ <xsl:apply-templates select="defval/*|defval/text()"
+ mode="passthrough"/>
+ </default>
+ </xsl:if>
+ </template-type-parameter>
+ </xsl:when>
       <xsl:otherwise>
         <template-nontype-parameter>
           <xsl:attribute name="name">
@@ -699,9 +748,9 @@
         </xsl:apply-templates>
       </xsl:when>
       <xsl:otherwise>
- <xsl:message>
-Cannot handle sectiondef with kind=<xsl:value-of select="@kind"/>
- </xsl:message>
+ <xsl:call-template name="kind-error-message">
+ <xsl:with-param name="message" select="'Cannot handle sectiondef'"/>
+ </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
@@ -718,6 +767,7 @@
            tell us what is \internal and what isn't. -->
       <xsl:when test="contains(detaileddescription/para, 'INTERNAL ONLY')"/>
       <xsl:when test="contains(briefdescription/para, 'INTERNAL ONLY')"/>
+ <xsl:when test="contains(inbodydescription/para, 'INTERNAL ONLY')"/>
 
       <xsl:when test="@kind='typedef'">
         <xsl:call-template name="typedef">
@@ -783,9 +833,9 @@
         </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
- <xsl:message>
-Cannot handle memberdef element with kind=<xsl:value-of select="@kind"/>
- </xsl:message>
+ <xsl:call-template name="kind-error-message">
+ <xsl:with-param name="message" select="'Cannot handle memberdef element'"/>
+ </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
@@ -805,6 +855,7 @@
         
         <xsl:apply-templates select="briefdescription" mode="passthrough"/>
         <xsl:apply-templates select="detaileddescription" mode="passthrough"/>
+ <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
         
         <type><xsl:apply-templates select="type"/></type>
       </typedef>
@@ -843,7 +894,7 @@
         <xsl:value-of select="normalize-space(declname/text())"/>
       </xsl:variable>
 
- <xsl:apply-templates select="../detaileddescription//parameterlist[attribute::kind='param']/*"
+ <xsl:apply-templates select="../*[self::detaileddescription or self::inbodydescription]//parameterlist[attribute::kind='param']/*"
         mode="parameter.description">
         <xsl:with-param name="name">
           <xsl:value-of select="$name"/>
@@ -893,24 +944,25 @@
     <!-- The description -->
     <xsl:apply-templates select="briefdescription" mode="passthrough"/>
     <xsl:apply-templates select="detaileddescription" mode="passthrough"/>
+ <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
       
     <xsl:apply-templates
- select="detaileddescription/para/simplesect[@kind='pre']"
+ select="*[self::detaileddescription or self::inbodydescription]/para/simplesect[@kind='pre']"
       mode="function-clauses"/>
     <xsl:apply-templates
- select="detaileddescription/para/simplesect[@kind='post']"
+ select="*[self::detaileddescription or self::inbodydescription]/para/simplesect[@kind='post']"
       mode="function-clauses"/>
     <xsl:apply-templates
- select="detaileddescription/para/simplesect[@kind='return']"
+ select="*[self::detaileddescription or self::inbodydescription]/para/simplesect[@kind='return']"
       mode="function-clauses"/>
- <xsl:if test="detaileddescription/para/parameterlist[@kind='exception']">
+ <xsl:if test="*[self::detaileddescription or self::inbodydescription]/para/parameterlist[@kind='exception']">
       <throws>
         <xsl:apply-templates
- select="detaileddescription/para/parameterlist[@kind='exception']"
+ select="*[self::detaileddescription or self::inbodydescription]/para/parameterlist[@kind='exception']"
           mode="function-clauses"/>
       </throws>
     </xsl:if>
- <xsl:variable name="notes" select="detaileddescription/para/simplesect[@kind='note' or @kind='attention']"/>
+ <xsl:variable name="notes" select="*[self::detaileddescription or self::inbodydescription]/para/simplesect[@kind='note' or @kind='attention']"/>
     <xsl:if test="count($notes) &gt; 0">
       <notes>
         <xsl:apply-templates select="$notes" mode="function-clauses"/>
@@ -1107,11 +1159,14 @@
       </xsl:attribute>
 
       <!-- Specifiers -->
- <xsl:if test="@static = 'yes'">
- <xsl:attribute name="specifiers">static</xsl:attribute>
- </xsl:if>
- <xsl:if test="@mutable = 'yes'">
- <xsl:attribute name="specifiers">mutable</xsl:attribute>
+ <xsl:variable name="specifiers">
+ <xsl:if test="@static = 'yes'"><xsl:text> static</xsl:text></xsl:if>
+ <xsl:if test="@mutable = 'yes'"><xsl:text> mutable</xsl:text></xsl:if>
+ </xsl:variable>
+ <xsl:if test="normalize-space($specifiers)">
+ <xsl:attribute name="specifiers">
+ <xsl:value-of select="normalize-space($specifiers)"/>
+ </xsl:attribute>
       </xsl:if>
 
       <type>
@@ -1120,6 +1175,7 @@
 
       <xsl:apply-templates select="briefdescription" mode="passthrough"/>
       <xsl:apply-templates select="detaileddescription" mode="passthrough"/>
+ <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
     </data-member>
     </xsl:if>
   </xsl:template>
@@ -1182,6 +1238,14 @@
     </xsl:if>
   </xsl:template>
 
+ <xsl:template match="inbodydescription" mode="passthrough">
+ <xsl:if test="text()|*">
+ <description>
+ <xsl:apply-templates mode="passthrough"/>
+ </description>
+ </xsl:if>
+ </xsl:template>
+
   <!-- Handle function clauses -->
   <xsl:template match="simplesect" mode="function-clauses">
     <xsl:if test="@kind='pre'">

Modified: branches/release/tools/quickbook/detail/actions.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions.cpp (original)
+++ branches/release/tools/quickbook/detail/actions.cpp 2009-04-12 06:19:46 EDT (Sun, 12 Apr 2009)
@@ -935,10 +935,13 @@
             if(!fs::equivalent(outtmp /= *out, temp /= *file))
                 break;
         }
- std::divides<fs::path> concat;
         out = (out == outdir.begin()) ? outdir.end() : out;
- temp = std::accumulate(out, outdir.end(), fs::path(), boost::bind(concat, _1, ".."));
- return std::accumulate(file, path.end(), temp, concat);
+
+ fs::path result = fs::path();
+ for(; out != outdir.end(); ++out)
+ if(*out != ".") result /= "..";
+ std::divides<fs::path> concat;
+ return std::accumulate(file, path.end(), result, concat);
     }
 
     fs::path calculate_relative_path(


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