Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84082 - trunk/tools/boostbook/xsl
From: grafikrobot_at_[hidden]
Date: 2013-04-29 01:12:17


Author: grafik
Date: 2013-04-29 01:12:16 EDT (Mon, 29 Apr 2013)
New Revision: 84082
URL: http://svn.boost.org/trac/boost/changeset/84082

Log:
Reflect the role section and simplesect values in the resulting HTML. So that we can style based on types of sections and simplesects. Also add an option to style the labels of sections.. Currently only allowing for removing the parent labels.
Text files modified:
   trunk/tools/boostbook/xsl/docbook-layout.xsl | 31 +++++++++++++++++++++++++++++--
   1 files changed, 29 insertions(+), 2 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-04-29 01:12:16 EDT (Mon, 29 Apr 2013)
@@ -211,7 +211,8 @@
   
   
   <!-- Adds the section ID as a class to the section DIV so that we
- can style sections individually. -->
+ can style sections individually. Also add the role as a class
+ so we style by kind of section. -->
   <xsl:template match="section" mode="class.value">
     <xsl:param name="class" select="local-name(.)"/>
     <xsl:param name="node" select="."/>
@@ -220,7 +221,33 @@
         <xsl:with-param name="object" select="$node"/>
       </xsl:call-template>
     </xsl:variable>
- <xsl:value-of select="concat($class,' ',translate($id, '.', '_'))"/>
+ <xsl:value-of select="concat($class,' ',@role,' ',translate($id, '.', '_'))"/>
+ </xsl:template>
+
+ <!-- Adds role class for simplesect element resulting div. So that
+ we can style them in the resulting HTML. -->
+ <xsl:template match="simplesect" mode="class.value">
+ <xsl:param name="class" select="local-name(.)"/>
+ <xsl:param name="node" select="."/>
+ <xsl:value-of select="concat($class,' ',@role)"/>
+ </xsl:template>
+
+ <!-- Allow for specifying that a section should not include the parents
+ labeling. This allows us to start clean numering of a sub-section. -->
+ <xsl:template match="section[@label-style='no-parent']" mode="label.markup">
+ <xsl:choose>
+ <xsl:when test="@label">
+ <xsl:value-of select="@label"/>
+ </xsl:when>
+ <xsl:when test="$label != 0">
+ <xsl:variable name="format">
+ <xsl:call-template name="autolabel.format">
+ <xsl:with-param name="format" select="$section.autolabel"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:number format="{$format}" count="section"/>
+ </xsl:when>
+ </xsl:choose>
   </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