Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84559 - trunk/tools/boostbook/xsl
From: dnljms_at_[hidden]
Date: 2013-05-30 15:02:14


Author: danieljames
Date: 2013-05-30 15:02:14 EDT (Thu, 30 May 2013)
New Revision: 84559
URL: http://svn.boost.org/trac/boost/changeset/84559

Log:
Make adding section's id to their class optional.
Text files modified:
   trunk/tools/boostbook/xsl/docbook-layout.xsl | 20 ++++++++++++++------
   1 files changed, 14 insertions(+), 6 deletions(-)

Modified: trunk/tools/boostbook/xsl/docbook-layout.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/docbook-layout.xsl (original)
+++ trunk/tools/boostbook/xsl/docbook-layout.xsl 2013-05-30 15:02:14 EDT (Thu, 30 May 2013)
@@ -10,11 +10,16 @@
 <xsl:stylesheet version = "1.0"
    xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
>
+
   <!-- needed for calsTable template -->
   
   <xsl:import
     href="http://docbook.sourceforge.net/release/xsl/current/html/formal.xsl"/>
 
+ <!-- Optionally add the section id to each section's class.
+ This is useful if you want to style individual sections differently. -->
+ <xsl:param name="boost.section.class.add.id" select="0"/>
+
   <!--
      Override the behaviour of some DocBook elements for better
      integration with the new look & feel.
@@ -210,16 +215,19 @@
   </xsl:template>
   
   
- <!-- Adds the section ID as a class to the section DIV so that we
- can style sections individually. Also add the role as a class
- so we style by kind of section. -->
+ <!-- Adds role class for section element resulting div. So that
+ we can style them in the resulting HTML.
+ Also, add the section id, if boost.section.class.add.id = 1.
+ This can be used to style individual sections differently. -->
   <xsl:template match="section" mode="class.value">
     <xsl:param name="class" select="local-name(.)"/>
     <xsl:param name="node" select="."/>
     <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select="$node"/>
- </xsl:call-template>
+ <xsl:if test="$boost.section.class.add.id">
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select="$node"/>
+ </xsl:call-template>
+ </xsl:if>
     </xsl:variable>
     <xsl:value-of select="normalize-space(concat($class, ' ',
         @role, ' ', translate($id, '.', '_')))"/>


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