Boost logo

Boost-Commit :

From: grafikrobot_at_[hidden]
Date: 2008-03-15 15:10:42


Author: grafik
Date: 2008-03-15 15:10:41 EDT (Sat, 15 Mar 2008)
New Revision: 43637
URL: http://svn.boost.org/trac/boost/changeset/43637

Log:
Merge latest BoostBook from trunk to release.
Added:
   branches/release/tools/boostbook/index.html
      - copied unchanged from r43636, /trunk/tools/boostbook/index.html
Text files modified:
   branches/release/tools/boostbook/doc/reference.dtdxml | 2
   branches/release/tools/boostbook/doc/reference.xml | 2
   branches/release/tools/boostbook/dtd/boostbook.dtd | 2
   branches/release/tools/boostbook/xsl/annotation.xsl | 24 ++++++----
   branches/release/tools/boostbook/xsl/chunk-common.xsl | 3
   branches/release/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl | 28 ++++++++----
   branches/release/tools/boostbook/xsl/lookup.xsl | 16 +++----
   branches/release/tools/boostbook/xsl/type.xsl | 85 ++++++++++++++++++++++++++++++---------
   branches/release/tools/boostbook/xsl/utility.xsl | 5 +
   9 files changed, 113 insertions(+), 54 deletions(-)

Modified: branches/release/tools/boostbook/doc/reference.dtdxml
==============================================================================
--- branches/release/tools/boostbook/doc/reference.dtdxml (original)
+++ branches/release/tools/boostbook/doc/reference.dtdxml 2008-03-15 15:10:41 EDT (Sat, 15 Mar 2008)
@@ -2513,6 +2513,8 @@
 <content-model-expanded>
   <sequence-group>
     <element-name name="default" occurrence="?"/>
+ <element-name name="purpose" occurrence="?"/>
+ <element-name name="description" occurrence="?"/>
   </sequence-group>
 </content-model-expanded>
 <content-model>

Modified: branches/release/tools/boostbook/doc/reference.xml
==============================================================================
--- branches/release/tools/boostbook/doc/reference.xml (original)
+++ branches/release/tools/boostbook/doc/reference.xml 2008-03-15 15:10:41 EDT (Sat, 15 Mar 2008)
@@ -2102,7 +2102,7 @@
       <refpurpose>A single value of an enumeration</refpurpose>
     </refnamediv>
     <refsynopsisdiv>enumvalue ::=
- (<link linkend="boostbook.dtd.default">default</link>?)
+ (<link linkend="boostbook.dtd.default">default</link>?, <link linkend="boostbook.dtd.purpose">purpose</link>?, <link linkend="boostbook.dtd.description">description</link>?)
 </refsynopsisdiv>
     <refsection>
       <title>Attributes</title>

Modified: branches/release/tools/boostbook/dtd/boostbook.dtd
==============================================================================
--- branches/release/tools/boostbook/dtd/boostbook.dtd (original)
+++ branches/release/tools/boostbook/dtd/boostbook.dtd 2008-03-15 15:10:41 EDT (Sat, 15 Mar 2008)
@@ -210,7 +210,7 @@
     name CDATA #REQUIRED
     %boost.common.attrib;>
 
-<!ELEMENT enumvalue (default?)>
+<!ELEMENT enumvalue (default?, purpose?, description?)>
 <!ATTLIST enumvalue
     name CDATA #REQUIRED
     %boost.common.attrib;>

Modified: branches/release/tools/boostbook/xsl/annotation.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/annotation.xsl (original)
+++ branches/release/tools/boostbook/xsl/annotation.xsl 2008-03-15 15:10:41 EDT (Sat, 15 Mar 2008)
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
    Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
-
+
    Distributed under the Boost Software License, Version 1.0.
    (See accompanying file LICENSE_1_0.txt or copy at
    http://www.boost.org/LICENSE_1_0.txt)
   -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 version="1.0">
- <xsl:key name="classes" match="class|struct|union" use="@name"/>
+ <xsl:key name="classes" match="class|struct|union|typedef" use="@name"/>
   <xsl:key name="methods" match="method|overloaded-method" use="@name"/>
   <xsl:key name="functions" match="function|overloaded-function" use="@name"/>
   <xsl:key name="enums" match="enum" use="@name"/>
@@ -21,10 +21,10 @@
   <xsl:template match="function|overloaded-function" mode="generate.id">
     <xsl:variable name="name" select="normalize-space(@name)"/>
     <xsl:variable name="translated-name"
- select="translate($name,
- '~!%^&amp;*()[].,&lt;&gt;|/ +-=',
+ select="translate($name,
+ '~!%^&amp;*()[].,&lt;&gt;|/ +-=',
                                     'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')"/>
-
+
     <xsl:choose>
       <xsl:when test="count(key('named-entities', $name))=1
                       and ($translated-name=$name)">
@@ -163,7 +163,7 @@
       <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"
+ <xsl:with-param name="nodes"
         select="key('functions', $unqualified-name)"/>
     </xsl:call-template>
   </xsl:template>
@@ -207,7 +207,7 @@
       <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"
+ <xsl:with-param name="nodes"
         select="key('enums', $unqualified-name)"/>
     </xsl:call-template>
   </xsl:template>
@@ -225,7 +225,7 @@
     </xsl:variable>
 
     <xsl:variable name="node" select="key('libraries', $name)"/>
-
+
     <xsl:choose>
       <xsl:when test="count($node)=0">
         <xsl:message>
@@ -254,7 +254,7 @@
 
   <xsl:template match="macroname" mode="annotation">
     <xsl:param name="name" select="text()"/>
-
+
     <xsl:variable name="node" select="key('macros', $name)"/>
     <xsl:choose>
       <xsl:when test="count($node) = 0">
@@ -290,7 +290,7 @@
 
   <xsl:template match="headername" mode="annotation">
     <xsl:param name="name" select="text()"/>
-
+
     <xsl:variable name="node" select="key('headers', $name)"/>
     <xsl:choose>
       <xsl:when test="count($node) = 0">
@@ -350,6 +350,10 @@
     </emphasis>
   </xsl:template>
 
+ <xsl:template match="description" mode="annotation">
+ <xsl:apply-templates mode="annotation"/>
+ </xsl:template>
+
   <xsl:template match="comment()" mode="annotation">
     <xsl:copy/>
   </xsl:template>

Modified: branches/release/tools/boostbook/xsl/chunk-common.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/chunk-common.xsl (original)
+++ branches/release/tools/boostbook/xsl/chunk-common.xsl 2008-03-15 15:10:41 EDT (Sat, 15 Mar 2008)
@@ -27,7 +27,8 @@
     <xsl:variable name="basename" select="substring-before( $their, $html.ext )"/>
     <xsl:choose>
         <xsl:when test="not($recursive)">
- <xsl:value-of select="translate( $basename, '.', '/' )"/>
+ <!-- translate dots into directory separators, and replace illegal file path characters with underscores -->
+ <xsl:value-of select="translate( $basename, '.&lt;&gt;\:*?&quot;|', '/_______' )"/>
             <xsl:value-of select="$html.ext"/>
         </xsl:when>
         <xsl:otherwise>

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 2008-03-15 15:10:41 EDT (Sat, 15 Mar 2008)
@@ -37,11 +37,14 @@
   <!-- The title that will be used for the BoostBook library reference emitted.
        If left blank, BoostBook will assign a default title. -->
   <xsl:param name="boost.doxygen.reftitle" select="''"/>
-
+
   <!-- The id used for the library-reference. By default, it is the normalized
        form of the reftitle. -->
   <xsl:param name="boost.doxygen.refid" select="''"/>
 
+ <!-- The directory into which png files corresponding to LaTeX formulas will be found. -->
+ <xsl:param name="boost.doxygen.formuladir" select="'images/'"/>
+
   <xsl:output method="xml" indent="no" standalone="yes"/>
 
   <xsl:key name="compounds-by-kind" match="compounddef" use="@kind"/>
@@ -1358,18 +1361,25 @@
   </xsl:template>
 
   <!--
- Eric Niebler: 4-4-2007
- Here is some half-baked support for LaTeX formulas in
+ Eric Niebler: Jan-8-2008
+ Here is some 3/4-baked support for LaTeX formulas in
   Doxygen comments. Doxygen doesn't generate the PNG files
   when outputting XML. In order to use this code, you must
   run Doxygen first to generate HTML (and the PNG files for
- the formulas), then copy the PNG files into the images/
- directory, and then build the docs with bjam. Commented
- out until something better comes along.
+ the formulas). You can do this in a Jamfile with
+ "doxygen foo.html : <sources, etc...> ; ", where the ".html"
+ is significant. Then the png files should be copied into the
+ images/ directory (or another place relative to the html/
+ directory, as specified by $boost.doxygen.formuladir XSL
+ parameter). This can be done with a custom action in a
+ Jamfile. Finally, the docs can be built as normal.
+ See libs/accumulators/doc/Jamfile.v2 for a working example.
+ -->
   <xsl:template match="formula" mode="passthrough">
     <xsl:choose>
       <xsl:when test="substring(*|text(), 1, 2) = '\['">
         <equation>
+ <title/>
           <alt>
             <xsl:value-of select="*|text()"/>
           </alt>
@@ -1377,7 +1387,7 @@
             <imageobject role="html">
               <imagedata format="PNG" align="center">
                 <xsl:attribute name="fileref">
- <xsl:value-of select="concat(concat('images/form_', @id), '.png')"/>
+ <xsl:value-of select="concat(concat(concat($boost.doxygen.formuladir, 'form_'), @id), '.png')"/>
                 </xsl:attribute>
               </imagedata>
             </imageobject>
@@ -1398,7 +1408,7 @@
             <imageobject role="html">
               <imagedata format="PNG">
                 <xsl:attribute name="fileref">
- <xsl:value-of select="concat(concat('images/form_', @id), '.png')"/>
+ <xsl:value-of select="concat(concat(concat($boost.doxygen.formuladir, 'form_'), @id), '.png')"/>
                 </xsl:attribute>
               </imagedata>
             </imageobject>
@@ -1412,6 +1422,4 @@
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
- -->
  </xsl:stylesheet>
-
\ No newline at end of file

Modified: branches/release/tools/boostbook/xsl/lookup.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/lookup.xsl (original)
+++ branches/release/tools/boostbook/xsl/lookup.xsl 2008-03-15 15:10:41 EDT (Sat, 15 Mar 2008)
@@ -14,15 +14,13 @@
   <!-- Generate an ID for the entity referenced -->
   <xsl:template name="generate.id">
     <xsl:param name="node" select="."/>
- <xsl:choose>
- <xsl:when test="ancestor::class-specialization|ancestor::struct-specialization|ancestor::union-specialization">
- <xsl:value-of select="generate-id(.)"/>
- <xsl:text>-bb</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$node" mode="generate.id"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:apply-templates select="$node" mode="generate.id"/>
+ <xsl:if test="$node/ancestor-or-self::class-specialization|
+ $node/ancestor-or-self::struct-specialization|
+ $node/ancestor-or-self::union-specialization">
+ <xsl:text>_</xsl:text>
+ <xsl:value-of select="generate-id($node)"/>
+ </xsl:if>
   </xsl:template>
 
   <xsl:template match="*" mode="generate.id">

Modified: branches/release/tools/boostbook/xsl/type.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/type.xsl (original)
+++ branches/release/tools/boostbook/xsl/type.xsl 2008-03-15 15:10:41 EDT (Sat, 15 Mar 2008)
@@ -33,6 +33,13 @@
     </xsl:call-template>
   </xsl:template>
 
+ <xsl:template match="class-specialization|struct-specialization|union-specialization" mode="generate.id">
+ <xsl:call-template name="fully-qualified-name">
+ <xsl:with-param name="node" select="."/>
+ <xsl:with-param name="separator" select="'.'"/>
+ </xsl:call-template>
+ </xsl:template>
+
   <xsl:template match="typedef" mode="generate.id">
     <xsl:call-template name="fully-qualified-name">
       <xsl:with-param name="node" select="."/>
@@ -56,6 +63,15 @@
     <xsl:value-of select="@name"/>
   </xsl:template>
 
+ <xsl:template match="function | overloaded-function" mode="generate.id">
+ <xsl:call-template name="fully-qualified-name">
+ <xsl:with-param name="node" select="."/>
+ <xsl:with-param name="separator" select="'.'"/>
+ </xsl:call-template>
+ <xsl:text>_</xsl:text>
+ <xsl:value-of select="generate-id(.)"/>
+ </xsl:template>
+
   <!-- Display the full name of the current node, e.g., "Class
        template function". -->
   <xsl:template name="type.display.name">
@@ -317,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>
@@ -349,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"
@@ -364,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>
@@ -445,11 +470,7 @@
       <xsl:with-param name="text" select="'static const '"/>
     </xsl:call-template>
 
- <xsl:call-template name="source-highlight">
- <xsl:with-param name="text">
- <xsl:apply-templates select="type/*|type/text()"/>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:apply-templates select="type" mode="highlight"/>
 
     <xsl:if test="not(@name = '')">
       <xsl:text> </xsl:text>
@@ -518,6 +539,10 @@
           <xsl:apply-templates select="type/*|type/text()" mode="annotation"/>
         </xsl:when>
         <xsl:otherwise>
+ <xsl:message>
+ <xsl:text>Warning: missing 'type' element inside 'inherit'</xsl:text>
+ </xsl:message>
+ <xsl:call-template name="print.warning.context"/>
           <xsl:apply-templates mode="annotation"/>
         </xsl:otherwise>
       </xsl:choose>
@@ -540,8 +565,8 @@
         <xsl:call-template name="highlight-comment">
           <xsl:with-param name="text">
             <xsl:text>// </xsl:text>
- <xsl:apply-templates select="purpose/*|purpose/text()"
- mode="annotation"/>
+ <xsl:apply-templates select="purpose"
+ mode="comment"/>
           </xsl:with-param>
         </xsl:call-template>
       </xsl:if>
@@ -712,6 +737,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">
@@ -754,6 +781,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>
 
@@ -808,6 +836,7 @@
   <xsl:template name="print-access-specification">
     <xsl:param name="indentation" select="0"/>
     <xsl:param name="specification" select="'public'"/>
+
     <xsl:text>&#10;</xsl:text>
     <xsl:call-template name="indent">
       <xsl:with-param name="indentation" select="$indentation"/>
@@ -820,17 +849,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. -->
@@ -841,11 +874,12 @@
     <xsl:if test="ancestor::class|ancestor::class-specialization|
                   ancestor::struct|ancestor::struct-specialization|
                   ancestor::union|ancestor::union-specialization">
- <xsl:text>&#10;&#10;</xsl:text>
+ <xsl:text>&#10;</xsl:text>
 
       <!-- If this nested class has a "purpose" element, use it as a
            comment. -->
       <xsl:if test="purpose">
+ <xsl:text>&#10;</xsl:text>
         <xsl:call-template name="indent">
           <xsl:with-param name="indentation" select="$indentation"/>
         </xsl:call-template>
@@ -855,7 +889,6 @@
             <xsl:apply-templates select="purpose" mode="comment"/>
           </xsl:with-param>
         </xsl:call-template>
- <xsl:text>&#10;</xsl:text>
       </xsl:if>
     </xsl:if>
 
@@ -878,7 +911,19 @@
       <xsl:with-param name="keyword" select="$class-key"/>
     </xsl:call-template>
     <xsl:text> </xsl:text>
- <xsl:value-of select="@name"/>
+
+ <!-- Make the class name a link to the class reference page (useful for nested classes) -->
+ <xsl:call-template name="internal-link">
+ <xsl:with-param name="to">
+ <xsl:call-template name="generate.id">
+ <xsl:with-param name="node" select="."/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="text">
+ <xsl:value-of select="@name"/>
+ </xsl:with-param>
+ </xsl:call-template>
+
     <xsl:apply-templates select="specialization"/>
 
     <xsl:choose>
@@ -913,10 +958,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 -->
@@ -1022,6 +1069,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"
@@ -1098,7 +1146,7 @@
 
     <!-- Spacing -->
     <xsl:if
- test="not(local-name(preceding-sibling::*[position()=1])=local-name(.))">
+ test="not(local-name(preceding-sibling::*[position()=1])=local-name(.)) and (position() &gt; 1)">
       <xsl:text>&#10;</xsl:text>
     </xsl:if>
 
@@ -1115,7 +1163,7 @@
       <xsl:text> </xsl:text>
     </xsl:if>
 
- <xsl:apply-templates select="type/*|type/text()" mode="annotation"/>
+ <xsl:apply-templates select="type" mode="highlight"/>
     <xsl:text> </xsl:text>
     <xsl:value-of select="@name"/>
     <xsl:text>;</xsl:text>
@@ -1190,7 +1238,7 @@
           <xsl:call-template name="highlight-comment">
             <xsl:with-param name="text">
               <xsl:text>// </xsl:text>
- <xsl:apply-templates select="purpose/*|purpose/text()" mode="annotation"/>
+ <xsl:apply-templates select="purpose" mode="comment"/>
             </xsl:with-param>
           </xsl:call-template>
 
@@ -1415,10 +1463,7 @@
           </xsl:call-template>
         </term>
         <listitem>
- <xsl:apply-templates
- select="purpose/*|purpose/text()|
- description/*|description/text()"
- mode="annotation"/>
+ <xsl:apply-templates select="purpose|description" mode="comment"/>
         </listitem>
       </varlistentry>
     </xsl:if>

Modified: branches/release/tools/boostbook/xsl/utility.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/utility.xsl (original)
+++ branches/release/tools/boostbook/xsl/utility.xsl 2008-03-15 15:10:41 EDT (Sat, 15 Mar 2008)
@@ -21,12 +21,13 @@
 
   <!-- get name of first ancestor-or-self which is a class, struct or union -->
   <xsl:template name="object-name">
- <xsl:value-of select="(ancestor-or-self::class |
+ <xsl:variable name="ancestors" select="ancestor-or-self::class |
       ancestor-or-self::class-specialization |
       ancestor-or-self::struct |
       ancestor-or-self::struct-specialization |
       ancestor-or-self::union |
- ancestor-or-self::union-specialization)/@name[last()]"/>
+ ancestor-or-self::union-specialization"/>
+ <xsl:value-of select="$ancestors[last()]/@name"/>
   </xsl:template>
 
   <!-- get name of access specification that we are inside -->


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