Trying to simplify the boostbook parameters.

[SVN r59706]
This commit is contained in:
Daniel James 2010-02-16 22:32:21 +00:00
parent 1500f71c0a
commit fe66ec4dba
3 changed files with 52 additions and 24 deletions

View File

@ -24,10 +24,20 @@
<xsl:import href="relative-href.xsl"/> <xsl:import href="relative-href.xsl"/>
<xsl:import href="callout.xsl"/> <xsl:import href="callout.xsl"/>
<xsl:param name="html.stylesheet">
<xsl:choose>
<xsl:when test = "$boost.defaults = 'Boost'">
<xsl:value-of select = "concat($boost.root, '/doc/src/boostbook.css')"/>
</xsl:when>
<xsl:otherwise>
boostbook.css
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="admon.style"/> <xsl:param name="admon.style"/>
<xsl:param name="admon.graphics">1</xsl:param> <xsl:param name="admon.graphics">1</xsl:param>
<xsl:param name="boostbook.verbose" select="0"/> <xsl:param name="boostbook.verbose" select="0"/>
<xsl:param name="html.stylesheet" select="'boostbook.css'"/>
<xsl:param name="navig.graphics" select="1"/> <xsl:param name="navig.graphics" select="1"/>
<xsl:param name="navig.graphics.extension" select="'.png'"/> <xsl:param name="navig.graphics.extension" select="'.png'"/>
<xsl:param name="chapter.autolabel" select="1"/> <xsl:param name="chapter.autolabel" select="1"/>

View File

@ -11,14 +11,25 @@
<xsl:import href="relative-href.xsl"/> <xsl:import href="relative-href.xsl"/>
<!--
boost.defaults:
*custom - only use explicitly set parameters
Boost - use standard boost settings, can be overridden
-->
<xsl:param name = "boost.defaults" select = "'none'"/>
<!-- <!--
how to render the Home | Libraries | ... | More contents how to render the Home | Libraries | ... | More contents
*none - do not display ("standalone" mode) *none - do not display ("standalone" mode)
horizontal - display in old-Boost style format horizontal - display in old-Boost style format (default for Boost)
vertical - like the new Getting Started layout vertical - like the new Getting Started layout
--> -->
<xsl:param name = "nav.layout" select = "'none'"/> <xsl:param name = "nav.layout">
<xsl:choose>
<xsl:when test = "$boost.defaults='Boost'">horizontal</xsl:when>
<xsl:otherwise>none</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!-- <!--
header border layout header border layout
Boost - place the old-Boost border around the header Boost - place the old-Boost border around the header
@ -34,41 +45,34 @@
--> -->
<xsl:param name = "nav.flow" select = "'Spirit'"/> <xsl:param name = "nav.flow" select = "'Spirit'"/>
<!--
boost.image:
*none - do not display a boost logo image, nor link to Boost
Boost - use standard boost logo, and link to Boost
custom - use a custom image and link
-->
<xsl:param name = "boost.image" select = "'none'"/>
<!-- location of the various Boost elements --> <!-- location of the various Boost elements -->
<xsl:param name = "boost.root" select = "'../..'"/> <xsl:param name = "boost.root" select = "'../..'"/>
<xsl:param name = "boost.website" select = "'http://www.boost.org'"/> <xsl:param name = "boost.website" select = "'http://www.boost.org'"/>
<!-- Logo image location, leave empty for no logo -->
<xsl:param name = "boost.image.src"> <xsl:param name = "boost.image.src">
<xsl:if test = "$boost.image = 'Boost'"> <xsl:if test = "$boost.defaults = 'Boost'">
<xsl:value-of select = "concat($boost.root, '/boost.png')"/> <xsl:value-of select = "concat($boost.root, '/boost.png')"/>
</xsl:if> </xsl:if>
</xsl:param> </xsl:param>
<xsl:param name = "boost.image.alt"> <xsl:param name = "boost.image.alt">
<xsl:if test = "$boost.image = 'Boost'"> <xsl:if test = "$boost.defaults = 'Boost'">
<xsl:value-of select = "'Boost C++ Libraries'"/> <xsl:value-of select = "'Boost C++ Libraries'"/>
</xsl:if> </xsl:if>
</xsl:param> </xsl:param>
<xsl:param name = "boost.image.w"> <xsl:param name = "boost.image.w">
<xsl:if test = "$boost.image = 'Boost'"> <xsl:if test = "$boost.defaults = 'Boost'">
<xsl:value-of select = "277"/> <xsl:value-of select = "277"/>
</xsl:if> </xsl:if>
</xsl:param> </xsl:param>
<xsl:param name = "boost.image.h"> <xsl:param name = "boost.image.h">
<xsl:if test = "$boost.image = 'Boost'"> <xsl:if test = "$boost.defaults = 'Boost'">
<xsl:value-of select = "86"/> <xsl:value-of select = "86"/>
</xsl:if> </xsl:if>
</xsl:param> </xsl:param>
<xsl:param name = "boost.libraries"> <xsl:param name = "boost.libraries">
<xsl:if test = "$boost.image = 'Boost'"> <xsl:if test = "$boost.defaults = 'Boost'">
<xsl:value-of select = "'libraries.html'"/> <xsl:value-of select = "concat($boost.root, '/libs/libraries.htm')"/>
</xsl:if> </xsl:if>
</xsl:param> </xsl:param>
@ -91,7 +95,7 @@
<xsl:if test = "$nav.border = 'Boost'"> <xsl:if test = "$nav.border = 'Boost'">
<xsl:attribute name = "style">background-color: white; width: 50%;</xsl:attribute> <xsl:attribute name = "style">background-color: white; width: 50%;</xsl:attribute>
</xsl:if> </xsl:if>
<xsl:if test = "$boost.image != 'none'"> <xsl:if test = "boolean($boost.image.src)">
<img alt="{$boost.image.alt}" width="{$boost.image.w}" height="{$boost.image.h}"> <img alt="{$boost.image.alt}" width="{$boost.image.w}" height="{$boost.image.h}">
<xsl:attribute name="src"> <xsl:attribute name="src">
<xsl:call-template name="href.target.relative"> <xsl:call-template name="href.target.relative">
@ -140,9 +144,11 @@
</xsl:call-template> </xsl:call-template>
</xsl:variable> </xsl:variable>
<xsl:variable name="libraries_link"> <xsl:variable name="libraries_link">
<xsl:call-template name="href.target.relative"> <xsl:if test = "boolean($boost.libraries)">
<xsl:with-param name="target" select="$boost.libraries"/> <xsl:call-template name="href.target.relative">
</xsl:call-template> <xsl:with-param name="target" select="$boost.libraries"/>
</xsl:call-template>
</xsl:if>
</xsl:variable> </xsl:variable>
<xsl:variable name="people_link"> <xsl:variable name="people_link">
<xsl:call-template name="href.target.relative"> <xsl:call-template name="href.target.relative">
@ -163,7 +169,9 @@
<xsl:choose> <xsl:choose>
<xsl:when test = "$nav.border = 'Boost'"> <xsl:when test = "$nav.border = 'Boost'">
<td align = "center" class = "boost-headtd"><a href = "{$home_link}" class = "boost-headelem">Home</a></td> <td align = "center" class = "boost-headtd"><a href = "{$home_link}" class = "boost-headelem">Home</a></td>
<td align = "center" class = "boost-headtd"><a href = "{$libraries_link}" class = "boost-headelem">Libraries</a></td> <xsl:if test = "boolean($libraries_link)">
<td align = "center" class = "boost-headtd"><a href = "{$libraries_link}" class = "boost-headelem">Libraries</a></td>
</xsl:if>
<td align = "center" class = "boost-headtd"><a href = "{$people_link}" class = "boost-headelem">People</a></td> <td align = "center" class = "boost-headtd"><a href = "{$people_link}" class = "boost-headelem">People</a></td>
<td align = "center" class = "boost-headtd"><a href = "{$faq_link}" class = "boost-headelem">FAQ</a></td> <td align = "center" class = "boost-headtd"><a href = "{$faq_link}" class = "boost-headelem">FAQ</a></td>
<td align = "center" class = "boost-headtd"><a href = "{$more_link}" class = "boost-headelem">More</a></td> <td align = "center" class = "boost-headtd"><a href = "{$more_link}" class = "boost-headelem">More</a></td>

View File

@ -24,10 +24,20 @@
<xsl:import href="relative-href.xsl"/> <xsl:import href="relative-href.xsl"/>
<xsl:import href="callout.xsl"/> <xsl:import href="callout.xsl"/>
<xsl:param name="html.stylesheet">
<xsl:choose>
<xsl:when test = "$boost.defaults = 'Boost'">
<xsl:value-of select = "concat($boost.root, '/doc/src/boostbook.css')"/>
</xsl:when>
<xsl:otherwise>
boostbook.css
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="admon.style"/> <xsl:param name="admon.style"/>
<xsl:param name="admon.graphics">1</xsl:param> <xsl:param name="admon.graphics">1</xsl:param>
<xsl:param name="boostbook.verbose" select="0"/> <xsl:param name="boostbook.verbose" select="0"/>
<xsl:param name="html.stylesheet" select="'boostbook.css'"/>
<xsl:param name="navig.graphics" select="1"/> <xsl:param name="navig.graphics" select="1"/>
<xsl:param name="navig.graphics.extension" select="'.png'"/> <xsl:param name="navig.graphics.extension" select="'.png'"/>
<xsl:param name="chapter.autolabel" select="1"/> <xsl:param name="chapter.autolabel" select="1"/>