Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76329 - trunk/tools/boostbook/xsl
From: grafikrobot_at_[hidden]
Date: 2012-01-06 01:00:18


Author: grafik
Date: 2012-01-06 01:00:12 EST (Fri, 06 Jan 2012)
New Revision: 76329
URL: http://svn.boost.org/trac/boost/changeset/76329

Log:
Add section IDs as a class name so we can add custom CSS styles per section. For example to allow a special 'TR' proposal styled section.
Text files modified:
   trunk/tools/boostbook/xsl/docbook-layout.xsl | 15 +++++++++++++++
   1 files changed, 15 insertions(+), 0 deletions(-)

Modified: trunk/tools/boostbook/xsl/docbook-layout.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/docbook-layout.xsl (original)
+++ trunk/tools/boostbook/xsl/docbook-layout.xsl 2012-01-06 01:00:12 EST (Fri, 06 Jan 2012)
@@ -208,4 +208,19 @@
       <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
     </xsl:apply-templates>
   </xsl:template>
+
+
+ <!-- Adds the section ID as a class to the section DIV so that we
+ can style sections individually. -->
+ <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:variable>
+ <xsl:value-of select="concat($class,' ',translate($id, '.', '_'))"/>
+ </xsl:template>
+
 </xsl:stylesheet>


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