|
Boost-Commit : |
From: daniel_james_at_[hidden]
Date: 2008-05-20 11:49:56
Author: danieljames
Date: 2008-05-20 11:49:55 EDT (Tue, 20 May 2008)
New Revision: 45577
URL: http://svn.boost.org/trac/boost/changeset/45577
Log:
Merge in improved ids in boostbook.
Merged revisions 44958,45130-45131,45152-45153,45366 via svnmerge from
https://svn.boost.org/svn/boost/branches/doc
........
r44958 | danieljames | 2008-05-01 00:08:20 +0100 (Thu, 01 May 2008) | 2 lines
Don't generated file names with spaces, and replace multiple consecutive underscores with a single underscore. Refs #1705
........
r45130 | danieljames | 2008-05-05 12:37:04 +0100 (Mon, 05 May 2008) | 2 lines
Combine the two alternative versions of the function generate.id
........
r45131 | danieljames | 2008-05-05 12:37:18 +0100 (Mon, 05 May 2008) | 2 lines
Deal with generated ids that contain dots which aren't separators.
........
r45152 | danieljames | 2008-05-05 21:28:44 +0100 (Mon, 05 May 2008) | 2 lines
Only add the id to fully qualified ids inside specializations - so that we're not adding generated ids on to the end of generated ids.
........
r45153 | danieljames | 2008-05-05 21:28:56 +0100 (Mon, 05 May 2008) | 2 lines
If the same macro appears twice, generated unique ids.
........
r45366 | danieljames | 2008-05-14 21:39:14 +0100 (Wed, 14 May 2008) | 2 lines
Avoid removing underscores that are part of a class or function name.
........
Properties modified:
trunk/ (props changed)
Text files modified:
trunk/tools/boostbook/xsl/annotation.xsl | 8 +++++---
trunk/tools/boostbook/xsl/chunk-common.xsl | 2 +-
trunk/tools/boostbook/xsl/global.xsl | 3 +--
trunk/tools/boostbook/xsl/lookup.xsl | 23 +++++++++++++++++------
trunk/tools/boostbook/xsl/macro.xsl | 4 ++++
trunk/tools/boostbook/xsl/type.xsl | 24 +++++-------------------
6 files changed, 33 insertions(+), 31 deletions(-)
Modified: trunk/tools/boostbook/xsl/annotation.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/annotation.xsl (original)
+++ trunk/tools/boostbook/xsl/annotation.xsl 2008-05-20 11:49:55 EDT (Tue, 20 May 2008)
@@ -28,14 +28,16 @@
<xsl:choose>
<xsl:when test="count(key('named-entities', $name))=1
and ($translated-name=$name)">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
+ <xsl:call-template name="fully-qualified-id">
+ <xsl:with-param name="node" select="."/>
+ </xsl:call-template>
+ <xsl:text>_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
- <xsl:text>-bb</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Modified: trunk/tools/boostbook/xsl/chunk-common.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/chunk-common.xsl (original)
+++ trunk/tools/boostbook/xsl/chunk-common.xsl 2008-05-20 11:49:55 EDT (Tue, 20 May 2008)
@@ -28,7 +28,7 @@
<xsl:choose>
<xsl:when test="not($recursive)">
<!-- translate dots into directory separators, and replace illegal file path characters with underscores -->
- <xsl:value-of select="translate(normalize-space(translate($basename, '._<>\:*?"|', '/ ' )), ' ', '_')"/>
+ <xsl:value-of select="translate(normalize-space(translate($basename, '.<>\:*?"|', '/ ' )), ' ', '_')"/>
<xsl:value-of select="$html.ext"/>
</xsl:when>
<xsl:otherwise>
Modified: trunk/tools/boostbook/xsl/global.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/global.xsl (original)
+++ trunk/tools/boostbook/xsl/global.xsl 2008-05-20 11:49:55 EDT (Tue, 20 May 2008)
@@ -68,9 +68,8 @@
<xsl:text>;</xsl:text>
</xsl:template>
<xsl:template match="data-member" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
Modified: trunk/tools/boostbook/xsl/lookup.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/lookup.xsl (original)
+++ trunk/tools/boostbook/xsl/lookup.xsl 2008-05-20 11:49:55 EDT (Tue, 20 May 2008)
@@ -15,12 +15,6 @@
<xsl:template name="generate.id">
<xsl:param name="node" select="."/>
<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">
@@ -128,6 +122,23 @@
</xsl:choose>
</xsl:template>
+ <!-- Build the fully-qualified id of the given node -->
+ <xsl:template name="fully-qualified-id">
+ <xsl:param name="node"/>
+ <xsl:variable name="name">
+ <xsl:apply-templates select="$node" mode="fully-qualified-name">
+ <xsl:with-param name="separator" select="'@'"/>
+ </xsl:apply-templates>
+ </xsl:variable>
+ <xsl:value-of select="translate(normalize-space(translate($name, '.', ' ')), ' @', '_.')"/>
+ <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>
+
<!-- Build the fully-qualified name of the given node -->
<xsl:template name="fully-qualified-name">
<xsl:param name="node"/>
Modified: trunk/tools/boostbook/xsl/macro.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/macro.xsl (original)
+++ trunk/tools/boostbook/xsl/macro.xsl 2008-05-20 11:49:55 EDT (Tue, 20 May 2008)
@@ -73,5 +73,9 @@
<xsl:template match="macro" mode="generate.id">
<xsl:value-of select="@name"/>
+ <xsl:if test="count(key('named-entities', @name))!=1">
+ <xsl:text>_</xsl:text>
+ <xsl:value-of select="generate-id(.)"/>
+ </xsl:if>
</xsl:template>
</xsl:stylesheet>
Modified: trunk/tools/boostbook/xsl/type.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/type.xsl (original)
+++ trunk/tools/boostbook/xsl/type.xsl 2008-05-20 11:49:55 EDT (Tue, 20 May 2008)
@@ -27,51 +27,37 @@
<xsl:param name="boost.compact.typedef">1</xsl:param>
<xsl:template match="class|struct|union" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</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:call-template name="fully-qualified-id">
<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:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="enum" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="."/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="enumvalue" mode="generate.id">
- <xsl:call-template name="fully-qualified-name">
+ <xsl:call-template name="fully-qualified-id">
<xsl:with-param name="node" select="parent::enum"/>
- <xsl:with-param name="separator" select="'.'"/>
</xsl:call-template>
<xsl:text>.</xsl:text>
<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">
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