Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59706 - in trunk: . tools/boostbook/xsl
From: daniel_james_at_[hidden]
Date: 2010-02-16 17:32:21


Author: danieljames
Date: 2010-02-16 17:32:21 EST (Tue, 16 Feb 2010)
New Revision: 59706
URL: http://svn.boost.org/trac/boost/changeset/59706

Log:
Trying to simplify the boostbook parameters.
Text files modified:
   trunk/Jamroot | 5 +--
   trunk/tools/boostbook/xsl/html.xsl | 12 ++++++++
   trunk/tools/boostbook/xsl/navbar.xsl | 52 +++++++++++++++++++++++----------------
   trunk/tools/boostbook/xsl/xhtml.xsl | 12 ++++++++
   4 files changed, 54 insertions(+), 27 deletions(-)

Modified: trunk/Jamroot
==============================================================================
--- trunk/Jamroot (original)
+++ trunk/Jamroot 2010-02-16 17:32:21 EST (Tue, 16 Feb 2010)
@@ -190,9 +190,8 @@
       # Comeau does not support shared lib
       <toolset>como:<link>static
       <toolset>como-linux:<define>_GNU_SOURCE=1
- # When building docs within Boost, we want the Boost standard navbar
- <xsl:param>nav.layout=horizontal
- <xsl:param>boost.image=Boost
+ # When building docs within Boost, we want the standard Boost style
+ <xsl:param>boost.defaults=Boost
     : usage-requirements <include>.
     : build-dir bin.v2
     ;

Modified: trunk/tools/boostbook/xsl/html.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/html.xsl (original)
+++ trunk/tools/boostbook/xsl/html.xsl 2010-02-16 17:32:21 EST (Tue, 16 Feb 2010)
@@ -24,10 +24,20 @@
   <xsl:import href="relative-href.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.graphics">1</xsl:param>
   <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.extension" select="'.png'"/>
   <xsl:param name="chapter.autolabel" select="1"/>

Modified: trunk/tools/boostbook/xsl/navbar.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/navbar.xsl (original)
+++ trunk/tools/boostbook/xsl/navbar.xsl 2010-02-16 17:32:21 EST (Tue, 16 Feb 2010)
@@ -12,13 +12,24 @@
 <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
         *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
    -->
- <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
          Boost - place the old-Boost border around the header
@@ -34,41 +45,34 @@
    -->
    <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 -->
 
    <xsl:param name = "boost.root" select = "'../..'"/>
    <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:if test = "$boost.image = 'Boost'">
+ <xsl:if test = "$boost.defaults = 'Boost'">
          <xsl:value-of select = "concat($boost.root, '/boost.png')"/>
       </xsl:if>
    </xsl:param>
    <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:if>
    </xsl:param>
    <xsl:param name = "boost.image.w">
- <xsl:if test = "$boost.image = 'Boost'">
+ <xsl:if test = "$boost.defaults = 'Boost'">
          <xsl:value-of select = "277"/>
       </xsl:if>
    </xsl:param>
    <xsl:param name = "boost.image.h">
- <xsl:if test = "$boost.image = 'Boost'">
+ <xsl:if test = "$boost.defaults = 'Boost'">
          <xsl:value-of select = "86"/>
       </xsl:if>
    </xsl:param>
    <xsl:param name = "boost.libraries">
- <xsl:if test = "$boost.image = 'Boost'">
- <xsl:value-of select = "'libraries.html'"/>
+ <xsl:if test = "$boost.defaults = 'Boost'">
+ <xsl:value-of select = "concat($boost.root, '/libs/libraries.htm')"/>
       </xsl:if>
    </xsl:param>
 
@@ -91,7 +95,7 @@
             <xsl:if test = "$nav.border = 'Boost'">
                <xsl:attribute name = "style">background-color: white; width: 50%;</xsl:attribute>
             </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}">
                    <xsl:attribute name="src">
                        <xsl:call-template name="href.target.relative">
@@ -140,9 +144,11 @@
          </xsl:call-template>
       </xsl:variable>
       <xsl:variable name="libraries_link">
- <xsl:call-template name="href.target.relative">
- <xsl:with-param name="target" select="$boost.libraries"/>
- </xsl:call-template>
+ <xsl:if test = "boolean($boost.libraries)">
+ <xsl:call-template name="href.target.relative">
+ <xsl:with-param name="target" select="$boost.libraries"/>
+ </xsl:call-template>
+ </xsl:if>
       </xsl:variable>
       <xsl:variable name="people_link">
          <xsl:call-template name="href.target.relative">
@@ -163,7 +169,9 @@
       <xsl:choose>
          <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 = "{$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 = "{$faq_link}" class = "boost-headelem">FAQ</a></td>
             <td align = "center" class = "boost-headtd"><a href = "{$more_link}" class = "boost-headelem">More</a></td>

Modified: trunk/tools/boostbook/xsl/xhtml.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/xhtml.xsl (original)
+++ trunk/tools/boostbook/xsl/xhtml.xsl 2010-02-16 17:32:21 EST (Tue, 16 Feb 2010)
@@ -24,10 +24,20 @@
   <xsl:import href="relative-href.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.graphics">1</xsl:param>
   <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.extension" select="'.png'"/>
   <xsl:param name="chapter.autolabel" select="1"/>


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