Make adding section's id to their class optional.

[SVN r84559]
This commit is contained in:
Daniel James 2013-05-30 19:02:14 +00:00
parent 8333508c17
commit 92e5116901

View File

@ -10,11 +10,16 @@
<xsl:stylesheet version = "1.0" <xsl:stylesheet version = "1.0"
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
> >
<!-- needed for calsTable template --> <!-- needed for calsTable template -->
<xsl:import <xsl:import
href="http://docbook.sourceforge.net/release/xsl/current/html/formal.xsl"/> 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 Override the behaviour of some DocBook elements for better
integration with the new look & feel. integration with the new look & feel.
@ -210,16 +215,19 @@
</xsl:template> </xsl:template>
<!-- Adds the section ID as a class to the section DIV so that we <!-- Adds role class for section element resulting div. So that
can style sections individually. Also add the role as a class we can style them in the resulting HTML.
so we style by kind of section. --> 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:template match="section" mode="class.value">
<xsl:param name="class" select="local-name(.)"/> <xsl:param name="class" select="local-name(.)"/>
<xsl:param name="node" select="."/> <xsl:param name="node" select="."/>
<xsl:variable name="id"> <xsl:variable name="id">
<xsl:if test="$boost.section.class.add.id">
<xsl:call-template name="object.id"> <xsl:call-template name="object.id">
<xsl:with-param name="object" select="$node"/> <xsl:with-param name="object" select="$node"/>
</xsl:call-template> </xsl:call-template>
</xsl:if>
</xsl:variable> </xsl:variable>
<xsl:value-of select="normalize-space(concat($class, ' ', <xsl:value-of select="normalize-space(concat($class, ' ',
@role, ' ', translate($id, '.', '_')))"/> @role, ' ', translate($id, '.', '_')))"/>