Boost logo

Boost-Build :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-02-03 22:37:29


Douglas Gregor wrote:
>On Tuesday 03 February 2004 05:24 pm, Christopher Currie wrote:
> > What we *may* end up doing is tweaking the stylesheets to create a
> > different L&F. I'm pretty sure the existing stylesheets are designed to
> > follow some Boost guidelines, but Zbynek's layout got some good reviews,
> > so if possible we'd like to modernize them a little.

>If you happen to come up with a slick new look & feel that we can apply to
>BoostBook, I wouldn't mind :). I'm actually a bit envious of Spirit's docs,
>which look _very_ nice, but not envious enough to actually try to duplicate
>what they've done :)

I have just written a quick version of a BoostBook stylesheet with a hybrid
look & feel. The stylesheet is not complete as there is some functionality
missing.

What do people think? Should I continue?

Regards,
Reece

_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection
http://www.msn.co.uk/specials/btbroadband
 ------=_NextPart_000_400c_1692_238 Content-Type: text/xml; name="boostbook-html.xsl"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="boostbook-html.xsl"

<?xml version = "1.0"?>

<xsl:stylesheet version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">
<xsl:output method = "html"/>

<xsl:template match = "chapter">
<html><head>
<title><xsl:value-of select = "title/text()"/></title>
<style>
th
{
font-weight: bold;
text-align: center;
background-color: lightskyblue;
}

.title, .sec-title, .sec2-title, .table-title
{
font-weight: bold;
font-size: 2pc;
font-family: Times New Roman;
margin-bottom: 1pc;
}
.title
{
text-align: center;
background-color: lightskyblue;
}
.sec-title
{
background-color: #EED;
}

.toc
{
border: 0.1em solid black;
margin-left: 5%;
margin-right: 5%;
margin-top: 1pc;
margin-bottom: 1pc;
padding: 0.5pc;
width: 50%;
background-color: #DDD;
}

.listing
{
background-color: #EED;
border: 0.1em ridge cyan;
margin-left: 3pc;
padding: 1pc;
width: 50%;
}
.filename, .code
{
font-family: Courier;
font-size: 10pt;
}
.table
{
text-align: center;
margin-bottom: 1pc;
}

.ulink{ color: blue; }
.slink{ color: blue; }
</style>
</head><body>
<xsl:apply-templates select = "title"/>
<table width = "100%"><tr>
<td valign = "top">
<!-- [note]: hardcoded the link to the boost gif -->
<img src = "../../../c++boost.gif"/>
</td><td class = "toc" valign = "top">
<xsl:apply-templates select = "section" mode = "contents"/>
</td>
</tr></table>
<xsl:apply-templates select = "section"/>
<hr/>

<div style = "text-align: right;">
<div>Revised <xsl:value-of select = "@last-revision"/></div>
<div><xsl:apply-templates select = "chapterinfo/copyright"/></div>
</div>
</body></html>
</xsl:template>

<xsl:template match = "copyright">
Copyright (C)
<xsl:apply-templates select = "holder"/>
<xsl:apply-templates select = "date"/>
</xsl:template>

<xsl:template match = "section|table" mode = "contents">
<div>
<a href = "#{@id}" class = "slink"><xsl:value-of select = "title/text()"/></a>
<xsl:if test = "section"><div style = "margin-left: 1.5pc;">
<xsl:apply-templates select = "section|table" mode = "contents"/>
</div></xsl:if>
</div>
</xsl:template>

<xsl:template match = "section">
<xsl:apply-templates/>
</xsl:template>

<!-- title -->

<xsl:template match = "chapter/title" mode = "class">
title
</xsl:template>

<xsl:template match = "section/title" mode = "class">
sec-title
</xsl:template>

<xsl:template match = "section/section/title" mode = "class">
sec2-title
</xsl:template>

<xsl:template match = "table/title" mode = "class">
table-title
</xsl:template>

<xsl:template match = "title">
<a name = "{../@id}"><div>
<xsl:attribute name = "class">
<xsl:apply-templates select = "." mode = "class"/>
</xsl:attribute>

<xsl:apply-templates/>
</div></a>
</xsl:template>

<!-- HTML-like elements -->

<xsl:template match = "para">
<div style = "margin-bottom: 1pc;">
<xsl:apply-templates/>
</div>
</xsl:template>

<xsl:template match = "simpara">
<div><xsl:apply-templates/></div>
</xsl:template>

<xsl:template match = "programlisting">
<pre class = "listing"><xsl:apply-templates/></pre>
</xsl:template>

<xsl:template match = "ulink">
<a href = "{@url}" class = "ulink"><xsl:apply-templates/></a>
</xsl:template>

<xsl:template match = "filename">
<span class = "filename"><xsl:apply-templates/></span>
</xsl:template>

<xsl:template match = "code">
<span class = "code"><xsl:apply-templates/></span>
</xsl:template>

<xsl:template match = "emphasis[@role = 'bold']">
<span style = "font-weight: bold;"><xsl:apply-templates/></span>
</xsl:template>

<!-- list formatting -->

<xsl:template match = "itemizedlist">
<ul><xsl:apply-templates/></ul>
</xsl:template>

<xsl:template match = "orderedlist">
<ol><xsl:apply-templates/></ol>
</xsl:template>

<xsl:template match = "itemizedlist/listitem|orderedlist/listitem">
<li><xsl:apply-templates/></li>
</xsl:template>

<!-- table formatting -->

<xsl:template match = "table">
<xsl:apply-templates select = "title"/>
<div class = "table"><table border = "1">
<xsl:apply-templates select = "tgroup/thead/row|tgroup/tbody/row"/>
</table></div>
</xsl:template>

<xsl:template match = "thead/row|tbody/row">
<tr><xsl:apply-templates select = "entry"/></tr>
</xsl:template>

<xsl:template match = "thead/row/entry">
<th><xsl:apply-templates/></th>
</xsl:template>

<xsl:template match = "tbody/row/entry">
<td><xsl:apply-templates/></td>
</xsl:template>
</xsl:stylesheet>

 ------=_NextPart_000_400c_1692_238--


Boost-Build 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