[Boost-docs] [boostbook] patches to trunk

Subject: [Boost-docs] [boostbook] patches to trunk
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2007-11-29 16:41:20


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here are a couple more patches for boostbook on the trunk. They are a merge
of the changes from revision 40613 to 41463 in the boost_docs sandbox. I'll
apply them after the weekend if they seem okay to people.

human_readable_etc.patch:
        Makes the ids for class specializations and functions (mostly)
human-readable, which results in filenames for the corresponding .html files
also being (mostly) human-readable, instead of just something like
idXXXXXXX-bb.html.
        It has a couple unrelated changes in it. It adds a warning for invalid
boostbook in "inherit" elements. Also it makes the class name in a class
synopsis a link to the class's reference page (useful for nested classes).

utility.patch:
        Fixes the object-name template (which returns the name of a class) for the
case of nested classes.

- --
Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHTuu65vihyNWuA4URArLEAKC3mI+2fXRoWb4V1DyUSi62LI/poACg06iF
zpJU26usd2BJMpazGRWuBBg=
=ERIr
-----END PGP SIGNATURE-----

--Boundary-00=_6uuTH3dk0YBXaeR
Content-Type: text/x-diff; charset="utf-8"; name="human_readable_etc.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
        filename="human_readable_etc.patch"

Index: type.xsl
===================================================================
--- type.xsl (revision 41463)
+++ type.xsl (working copy)
@@ -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">
@@ -518,6 +534,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 +560,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>
@@ -855,7 +875,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 +897,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>
@@ -1190,7 +1221,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 +1446,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>
Index: chunk-common.xsl
===================================================================
--- chunk-common.xsl (revision 41463)
+++ chunk-common.xsl (working copy)
@@ -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>
Index: lookup.xsl
===================================================================
--- lookup.xsl (revision 41463)
+++ lookup.xsl (working copy)
@@ -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">

--Boundary-00=_6uuTH3dk0YBXaeR
Content-Type: text/x-diff;
  charset="utf-8";
  name="utility.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
        filename="utility.patch"

Index: tools/boostbook/xsl/utility.xsl
===================================================================
--- tools/boostbook/xsl/utility.xsl (revision 41463)
+++ tools/boostbook/xsl/utility.xsl (working copy)
@@ -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 -->

--Boundary-00=_6uuTH3dk0YBXaeR--


This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:40 UTC