Merge boostbook (mostly by Steven Watanabe).

* New faster highlighter.
* Optimized namelookup.
* Separate out some of the common html xsl (supports Boost.Test docs).
* Tweaks to optimize boostbook to html conversion.
* Bug in cxx-name-lookup.
* Use images under doc/src.


[SVN r63678]
This commit is contained in:
Daniel James 2010-07-06 00:12:00 +00:00
parent 4936070d81
commit 8a73555c3e
18 changed files with 1378 additions and 1053 deletions

View File

@ -10,7 +10,9 @@
version="1.0"> version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/admon.xsl"/> <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/admon.xsl"/>
<xsl:import href="relative-href.xsl"/>
<!-- Already included in the main style sheet -->
<!-- <xsl:import href="relative-href.xsl"/> -->
<xsl:template name="admon.graphic"> <xsl:template name="admon.graphic">
<xsl:param name="node" select="."/> <xsl:param name="node" select="."/>

View File

@ -374,6 +374,14 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="programlisting" mode="annotation">
<programlisting>
<xsl:apply-templates mode="annotation">
<xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates>
</programlisting>
</xsl:template>
<xsl:template match="code" mode="annotation"> <xsl:template match="code" mode="annotation">
<computeroutput> <computeroutput>
<xsl:apply-templates mode="annotation"/> <xsl:apply-templates mode="annotation"/>

View File

@ -10,7 +10,9 @@
version="1.0"> version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/callout.xsl"/> <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/callout.xsl"/>
<xsl:import href="relative-href.xsl"/>
<!-- Already included in the main style sheet -->
<!-- <xsl:import href="relative-href.xsl"/> -->
<xsl:template name="callout-bug"> <xsl:template name="callout-bug">
<xsl:param name="conum" select='1'/> <xsl:param name="conum" select='1'/>

View File

@ -10,10 +10,14 @@
version="1.0"> version="1.0">
<!-- Import the HTML chunking stylesheet --> <!-- Import the HTML chunking stylesheet -->
<!-- Watch out that we don't override chunk.xsl -->
<!--
<xsl:import <xsl:import
href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/> href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/> -->
<xsl:import href="relative-href.xsl"/> <!-- Already included in the main stylesheet -->
<!-- <xsl:import href="relative-href.xsl"/> -->
<!-- ==================================================================== --> <!-- ==================================================================== -->
@ -64,6 +68,9 @@
</xsl:variable> </xsl:variable>
<xsl:choose> <xsl:choose>
<xsl:when test="$navtext = 'xxx'">
<xsl:value-of select="$direction"/>
</xsl:when>
<xsl:when test="$navig.graphics != 0"> <xsl:when test="$navig.graphics != 0">
<img> <img>
<xsl:attribute name="src"> <xsl:attribute name="src">

View File

@ -180,24 +180,6 @@
<xsl:copy-of select="."/> <xsl:copy-of select="."/>
</xsl:template> </xsl:template>
<!-- Syntax highlighting -->
<xsl:template name="highlight-keyword">
<xsl:param name="keyword"/>
<xsl:choose>
<xsl:when test="$boost.syntax.highlight='1'">
<emphasis role="bold"><xsl:value-of select="$keyword"/></emphasis>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$keyword"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-comment">
<xsl:param name="text"/>
<emphasis><xsl:copy-of select="$text"/></emphasis>
</xsl:template>
<xsl:template name="monospaced"> <xsl:template name="monospaced">
<xsl:param name="text"/> <xsl:param name="text"/>
<computeroutput><xsl:value-of select="$text"/></computeroutput> <computeroutput><xsl:value-of select="$text"/></computeroutput>

View File

@ -129,31 +129,58 @@
--> -->
<xsl:template match="//programlisting/phrase[@role='keyword']"> <xsl:template match="//phrase[@role='keyword' and
(ancestor::programlisting or
ancestor::synopsis or
ancestor::literallayout)]">
<fo:inline color="#0000AA"><xsl:apply-templates/></fo:inline> <fo:inline color="#0000AA"><xsl:apply-templates/></fo:inline>
</xsl:template> </xsl:template>
<xsl:template match="//programlisting/phrase[@role='special']"> <xsl:template match="//phrase[@role='special' and
(ancestor::programlisting or
ancestor::synopsis or
ancestor::literallayout)]">
<fo:inline color="#707070"><xsl:apply-templates/></fo:inline> <fo:inline color="#707070"><xsl:apply-templates/></fo:inline>
</xsl:template> </xsl:template>
<xsl:template match="//programlisting/phrase[@role='preprocessor']"> <xsl:template match="//phrase[@role='preprocessor' and
(ancestor::programlisting or
ancestor::synopsis or
ancestor::literallayout)]">
<fo:inline color="#402080"><xsl:apply-templates/></fo:inline> <fo:inline color="#402080"><xsl:apply-templates/></fo:inline>
</xsl:template> </xsl:template>
<xsl:template match="//programlisting/phrase[@role='char']"> <xsl:template match="//phrase[@role='char' and
(ancestor::programlisting or
ancestor::synopsis or
ancestor::literallayout)]">
<fo:inline color="teal"><xsl:apply-templates/></fo:inline> <fo:inline color="teal"><xsl:apply-templates/></fo:inline>
</xsl:template> </xsl:template>
<xsl:template match="//programlisting/phrase[@role='comment']"> <xsl:template match="//phrase[@role='comment' and
(ancestor::programlisting or
ancestor::synopsis or
ancestor::literallayout)]">
<fo:inline color="#800000"><xsl:apply-templates/></fo:inline> <fo:inline color="#800000"><xsl:apply-templates/></fo:inline>
</xsl:template> </xsl:template>
<xsl:template match="//programlisting/phrase[@role='string']"> <xsl:template match="//phrase[@role='string' and
(ancestor::programlisting or
ancestor::synopsis or
ancestor::literallayout)]">
<fo:inline color="teal"><xsl:apply-templates/></fo:inline> <fo:inline color="teal"><xsl:apply-templates/></fo:inline>
</xsl:template> </xsl:template>
<xsl:template match="//programlisting/phrase[@role='number']"> <xsl:template match="//phrase[@role='number' and
(ancestor::programlisting or
ancestor::synopsis or
ancestor::literallayout)]">
<fo:inline color="teal"><xsl:apply-templates/></fo:inline> <fo:inline color="teal"><xsl:apply-templates/></fo:inline>
</xsl:template> </xsl:template>
<xsl:template match="//programlisting/phrase[@role='white_bkd']"> <xsl:template match="//phrase[@role='white_bkd' and
(ancestor::programlisting or
ancestor::synopsis or
ancestor::literallayout)]">
<fo:inline color="#FFFFFF"><xsl:apply-templates/></fo:inline> <fo:inline color="#FFFFFF"><xsl:apply-templates/></fo:inline>
</xsl:template> </xsl:template>
<xsl:template match="//programlisting/phrase[@role='dk_grey_bkd']"> <xsl:template match="//phrase[@role='dk_grey_bkd' and
(ancestor::programlisting or
ancestor::synopsis or
ancestor::literallayout)]">
<fo:inline color="#999999"><xsl:apply-templates/></fo:inline> <fo:inline color="#999999"><xsl:apply-templates/></fo:inline>
</xsl:template> </xsl:template>

View File

@ -161,7 +161,7 @@
<!-- Build the text that follows the declarator--> <!-- Build the text that follows the declarator-->
<xsl:variable name="postdeclarator"> <xsl:variable name="postdeclarator">
<xsl:if test="@cv"> <xsl:if test="@cv and @cv != ''">
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="@cv"/> <xsl:value-of select="@cv"/>
</xsl:if> </xsl:if>
@ -246,7 +246,9 @@
<xsl:with-param name="highlight" select="true()"/> <xsl:with-param name="highlight" select="true()"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>(</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'('"/>
</xsl:call-template>
<xsl:call-template name="function-parameters"> <xsl:call-template name="function-parameters">
<xsl:with-param name="include-names" select="$include-names"/> <xsl:with-param name="include-names" select="$include-names"/>
<xsl:with-param name="indentation" <xsl:with-param name="indentation"
@ -254,12 +256,16 @@
+ string-length($function-name) + 1"/> + string-length($function-name) + 1"/>
<xsl:with-param name="final" select="true()"/> <xsl:with-param name="final" select="true()"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>)</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="')'"/>
</xsl:call-template>
<xsl:call-template name="source-highlight"> <xsl:call-template name="source-highlight">
<xsl:with-param name="text" select="$postdeclarator"/> <xsl:with-param name="text" select="$postdeclarator"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>;</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="';'"/>
</xsl:call-template>
</xsl:when> </xsl:when>
<!-- This declaration will take multiple lines --> <!-- This declaration will take multiple lines -->
@ -317,7 +323,9 @@
<xsl:with-param name="link-type" select="$link-type"/> <xsl:with-param name="link-type" select="$link-type"/>
<xsl:with-param name="highlight" select="true()"/> <xsl:with-param name="highlight" select="true()"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>(</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'('"/>
</xsl:call-template>
<xsl:call-template name="function-parameters"> <xsl:call-template name="function-parameters">
<xsl:with-param name="include-names" select="$include-names"/> <xsl:with-param name="include-names" select="$include-names"/>
<xsl:with-param name="indentation" <xsl:with-param name="indentation"
@ -325,11 +333,15 @@
+ string-length($function-name) + 1"/> + string-length($function-name) + 1"/>
<xsl:with-param name="final" select="true()"/> <xsl:with-param name="final" select="true()"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>)</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="')'"/>
</xsl:call-template>
<xsl:call-template name="source-highlight"> <xsl:call-template name="source-highlight">
<xsl:with-param name="text" select="$postdeclarator"/> <xsl:with-param name="text" select="$postdeclarator"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>;</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="';'"/>
</xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
@ -364,7 +376,18 @@
<!-- Information for this parameter --> <!-- Information for this parameter -->
<xsl:variable name="parameter" select="$parameters[position()=1]"/> <xsl:variable name="parameter" select="$parameters[position()=1]"/>
<xsl:variable name="pack"> <xsl:variable name="pack">
<xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if> <xsl:if test="$parameter/@pack=1">
<xsl:choose>
<xsl:when test="$final">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'...'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>...</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable> </xsl:variable>
<xsl:variable name="name"> <xsl:variable name="name">
<xsl:if test="$include-names and $parameter/@name != ''"> <xsl:if test="$include-names and $parameter/@name != ''">
@ -377,18 +400,32 @@
<xsl:variable name="default"> <xsl:variable name="default">
<xsl:choose> <xsl:choose>
<xsl:when test="$parameter/@default"> <xsl:when test="$parameter/@default">
<xsl:text> = </xsl:text>
<xsl:value-of select="$parameter/@default"/>
</xsl:when>
<xsl:when test="$parameter/default">
<xsl:text> = </xsl:text>
<xsl:choose> <xsl:choose>
<xsl:when test="$final"> <xsl:when test="$final">
<xsl:apply-templates <xsl:call-template name="highlight-text">
select="$parameter/default/*|$parameter/default/text()" <xsl:with-param name="text" select="concat(' = ', $parameter/@default)"/>
mode="annotation"/> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text> = </xsl:text>
<xsl:value-of select="$parameter/@default"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$parameter/default">
<xsl:choose>
<xsl:when test="$final">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' = '"/>
</xsl:call-template>
<xsl:apply-templates
select="$parameter/default/*|$parameter/default/text()"
mode="annotation">
<xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:text> = </xsl:text>
<xsl:value-of select="string($parameter/default)"/> <xsl:value-of select="string($parameter/default)"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
@ -407,13 +444,15 @@
or not($wrap)"> or not($wrap)">
<xsl:choose> <xsl:choose>
<xsl:when test="$final"> <xsl:when test="$final">
<xsl:value-of select="$prefix"/> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="$prefix"/>
</xsl:call-template>
<xsl:apply-templates <xsl:apply-templates
select="$parameter/paramtype/*|$parameter/paramtype/text()" select="$parameter/paramtype/*|$parameter/paramtype/text()"
mode="annotation"> mode="annotation">
<xsl:with-param name="highlight" select="true()"/> <xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates> </xsl:apply-templates>
<xsl:value-of select="$pack"/> <xsl:copy-of select="$pack"/>
<xsl:value-of select="$name"/> <xsl:value-of select="$name"/>
<xsl:copy-of select="$default"/> <xsl:copy-of select="$default"/>
</xsl:when> </xsl:when>
@ -437,7 +476,17 @@
<!-- Parameter goes on next line --> <!-- Parameter goes on next line -->
<xsl:otherwise> <xsl:otherwise>
<!-- The comma goes on this line --> <!-- The comma goes on this line -->
<xsl:value-of select="$prefix"/><xsl:text>&#10;</xsl:text> <xsl:choose>
<xsl:when test="$final">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="$prefix"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$prefix"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>&#10;</xsl:text>
<!-- Indent and print the parameter --> <!-- Indent and print the parameter -->
<xsl:call-template name="indent"> <xsl:call-template name="indent">
@ -450,9 +499,9 @@
mode="annotation"> mode="annotation">
<xsl:with-param name="highlight" select="true()"/> <xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates> </xsl:apply-templates>
<xsl:value-of select="$pack"/> <xsl:copy-of select="$pack"/>
<xsl:value-of select="$name"/> <xsl:value-of select="$name"/>
<xsl:value-of select="$default"/> <xsl:copy-of select="$default"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="concat($prefix, $text)"/> <xsl:value-of select="concat($prefix, $text)"/>
@ -605,16 +654,18 @@
<xsl:call-template name="indent"> <xsl:call-template name="indent">
<xsl:with-param name="indentation" select="$indentation"/> <xsl:with-param name="indentation" select="$indentation"/>
</xsl:call-template> </xsl:call-template>
<emphasis> <xsl:call-template name="highlight-comment">
<xsl:text>// </xsl:text> <xsl:with-param name="text">
<xsl:call-template name="internal-link"> <xsl:text>// </xsl:text>
<xsl:with-param name="to"> <xsl:call-template name="internal-link">
<xsl:call-template name="generate.id"/> <xsl:with-param name="to">
<xsl:text>construct-copy-destruct</xsl:text> <xsl:call-template name="generate.id"/>
</xsl:with-param> <xsl:text>construct-copy-destruct</xsl:text>
<xsl:with-param name="text" select="'construct/copy/destruct'"/> </xsl:with-param>
</xsl:call-template> <xsl:with-param name="text" select="'construct/copy/destruct'"/>
</emphasis> </xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="constructor" mode="synopsis"> <xsl:apply-templates select="constructor" mode="synopsis">
<xsl:with-param name="indentation" select="$indentation"/> <xsl:with-param name="indentation" select="$indentation"/>
</xsl:apply-templates> </xsl:apply-templates>
@ -1034,15 +1085,17 @@
<xsl:call-template name="indent"> <xsl:call-template name="indent">
<xsl:with-param name="indentation" select="$indentation"/> <xsl:with-param name="indentation" select="$indentation"/>
</xsl:call-template> </xsl:call-template>
<emphasis> <xsl:call-template name="highlight-comment">
<xsl:text>// </xsl:text> <xsl:with-param name="text">
<xsl:call-template name="internal-link"> <xsl:text>// </xsl:text>
<xsl:with-param name="to"> <xsl:call-template name="internal-link">
<xsl:call-template name="generate.id"/> <xsl:with-param name="to">
</xsl:with-param> <xsl:call-template name="generate.id"/>
<xsl:with-param name="text" select="string(@name)"/> </xsl:with-param>
</xsl:call-template> <xsl:with-param name="text" select="string(@name)"/>
</emphasis> </xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="method|overloaded-method" <xsl:apply-templates select="method|overloaded-method"
mode="synopsis"> mode="synopsis">
<xsl:with-param name="indentation" select="$indentation"/> <xsl:with-param name="indentation" select="$indentation"/>
@ -1088,15 +1141,17 @@
<xsl:call-template name="indent"> <xsl:call-template name="indent">
<xsl:with-param name="indentation" select="$indentation"/> <xsl:with-param name="indentation" select="$indentation"/>
</xsl:call-template> </xsl:call-template>
<emphasis> <xsl:call-template name="highlight-comment">
<xsl:text>// </xsl:text> <xsl:with-param name="text">
<xsl:call-template name="internal-link"> <xsl:text>// </xsl:text>
<xsl:with-param name="to"> <xsl:call-template name="internal-link">
<xsl:call-template name="generate.id"/> <xsl:with-param name="to">
</xsl:with-param> <xsl:call-template name="generate.id"/>
<xsl:with-param name="text" select="string(@name)"/> </xsl:with-param>
</xsl:call-template> <xsl:with-param name="text" select="string(@name)"/>
</emphasis> </xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="function|overloaded-function" mode="synopsis"> <xsl:apply-templates select="function|overloaded-function" mode="synopsis">
<xsl:with-param name="indentation" select="$indentation"/> <xsl:with-param name="indentation" select="$indentation"/>
</xsl:apply-templates> </xsl:apply-templates>

View File

@ -57,7 +57,9 @@
</xsl:call-template> </xsl:call-template>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
</xsl:if> </xsl:if>
<xsl:apply-templates select="type/*|type/text()" mode="annotation" /> <xsl:apply-templates select="type/*|type/text()" mode="annotation">
<xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:call-template name="link-or-anchor"> <xsl:call-template name="link-or-anchor">
<xsl:with-param name="to"> <xsl:with-param name="to">
@ -66,7 +68,9 @@
<xsl:with-param name="text" select="@name" /> <xsl:with-param name="text" select="@name" />
<xsl:with-param name="link-type" select="$link-type" /> <xsl:with-param name="link-type" select="$link-type" />
</xsl:call-template> </xsl:call-template>
<xsl:text>;</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="';'"/>
</xsl:call-template>
</xsl:template> </xsl:template>
<xsl:template match="data-member" mode="generate.id"> <xsl:template match="data-member" mode="generate.id">
<xsl:call-template name="fully-qualified-id"> <xsl:call-template name="fully-qualified-id">

320
xsl/html-base.xsl Normal file
View File

@ -0,0 +1,320 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"
version="1.0">
<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="boost.graphics.root">
<xsl:choose>
<xsl:when test = "$boost.defaults = 'Boost'">
<xsl:value-of select = "concat($boost.root, '/doc/src/images/')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select = "'images/'"/>
</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="navig.graphics" select="1"/>
<xsl:param name="navig.graphics.extension" select="'.png'"/>
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="use.id.as.filename" select="1"/>
<xsl:param name="refentry.generate.name" select="0"/>
<xsl:param name="refentry.generate.title" select="1"/>
<xsl:param name="make.year.ranges" select="1"/>
<xsl:param name="generate.manifest" select="1"/>
<xsl:param name="generate.section.toc.level" select="3"/>
<xsl:param name="doc.standalone">false</xsl:param>
<xsl:param name="chunker.output.indent">yes</xsl:param>
<xsl:param name="chunker.output.encoding">US-ASCII</xsl:param>
<xsl:param name="chunk.quietly" select="not(number($boostbook.verbose))"/>
<xsl:param name="toc.max.depth">2</xsl:param>
<xsl:param name="callout.graphics.number.limit">15</xsl:param>
<xsl:param name = "admon.graphics.path" select="$boost.graphics.root" />
<xsl:param name = "navig.graphics.path" select="$boost.graphics.root" />
<xsl:param name = "callout.graphics.path"
select = "concat($boost.graphics.root, 'callouts/')"/>
<xsl:param name="admon.style">
<!-- Remove the style. Let the CSS do the styling -->
</xsl:param>
<!-- Always have graphics -->
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="generate.toc">
appendix toc,title
article/appendix nop
article toc,title
book toc,title
chapter toc,title
part toc,title
preface toc,title
qandadiv toc
qandaset toc
reference toc,title
sect1 toc
sect2 toc
sect3 toc
sect4 toc
sect5 toc
section toc
set toc,title
</xsl:param>
<xsl:template name="format.cvs.revision">
<xsl:param name="text"/>
<!-- Remove the "$Date: " -->
<xsl:variable name="text.noprefix"
select="substring-after($text, '$Date: ')"/>
<!-- Grab the year -->
<xsl:variable name="year" select="substring-before($text.noprefix, '/')"/>
<xsl:variable name="text.noyear"
select="substring-after($text.noprefix, '/')"/>
<!-- Grab the month -->
<xsl:variable name="month" select="substring-before($text.noyear, '/')"/>
<xsl:variable name="text.nomonth"
select="substring-after($text.noyear, '/')"/>
<!-- Grab the year -->
<xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
<xsl:variable name="text.noday"
select="substring-after($text.nomonth, ' ')"/>
<!-- Get the time -->
<xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
<xsl:variable name="month.name">
<xsl:choose>
<xsl:when test="$month=1">January</xsl:when>
<xsl:when test="$month=2">February</xsl:when>
<xsl:when test="$month=3">March</xsl:when>
<xsl:when test="$month=4">April</xsl:when>
<xsl:when test="$month=5">May</xsl:when>
<xsl:when test="$month=6">June</xsl:when>
<xsl:when test="$month=7">July</xsl:when>
<xsl:when test="$month=8">August</xsl:when>
<xsl:when test="$month=9">September</xsl:when>
<xsl:when test="$month=10">October</xsl:when>
<xsl:when test="$month=11">November</xsl:when>
<xsl:when test="$month=12">December</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
$time, ' GMT')"/>
</xsl:template>
<xsl:template name="format.svn.revision">
<xsl:param name="text"/>
<!-- Remove the "$Date: " -->
<xsl:variable name="text.noprefix"
select="substring-after($text, '$Date: ')"/>
<!-- Grab the year -->
<xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
<xsl:variable name="text.noyear"
select="substring-after($text.noprefix, '-')"/>
<!-- Grab the month -->
<xsl:variable name="month" select="substring-before($text.noyear, '-')"/>
<xsl:variable name="text.nomonth"
select="substring-after($text.noyear, '-')"/>
<!-- Grab the year -->
<xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
<xsl:variable name="text.noday"
select="substring-after($text.nomonth, ' ')"/>
<!-- Get the time -->
<xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
<xsl:variable name="text.notime"
select="substring-after($text.noday, ' ')"/>
<!-- Get the timezone -->
<xsl:variable name="timezone" select="substring-before($text.notime, ' ')"/>
<xsl:variable name="month.name">
<xsl:choose>
<xsl:when test="$month=1">January</xsl:when>
<xsl:when test="$month=2">February</xsl:when>
<xsl:when test="$month=3">March</xsl:when>
<xsl:when test="$month=4">April</xsl:when>
<xsl:when test="$month=5">May</xsl:when>
<xsl:when test="$month=6">June</xsl:when>
<xsl:when test="$month=7">July</xsl:when>
<xsl:when test="$month=8">August</xsl:when>
<xsl:when test="$month=9">September</xsl:when>
<xsl:when test="$month=10">October</xsl:when>
<xsl:when test="$month=11">November</xsl:when>
<xsl:when test="$month=12">December</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
$time, ' ', $timezone)"/>
</xsl:template>
<!-- Footer Copyright -->
<xsl:template match="copyright" mode="boost.footer">
<xsl:if test="position() &gt; 1">
<br/>
</xsl:if>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Copyright'"/>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:call-template name="dingbat">
<xsl:with-param name="dingbat">copyright</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:call-template name="copyright.years">
<xsl:with-param name="years" select="year"/>
<xsl:with-param name="print.ranges" select="$make.year.ranges"/>
<xsl:with-param name="single.year.ranges"
select="$make.single.year.ranges"/>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:apply-templates select="holder" mode="titlepage.mode"/>
</xsl:template>
<!-- Footer License -->
<xsl:template match="legalnotice" mode="boost.footer">
<xsl:apply-templates select="para" mode="titlepage.mode" />
</xsl:template>
<xsl:template name="user.footer.content">
<table width="100%">
<tr>
<td align="left">
<xsl:variable name="revision-nodes"
select="ancestor-or-self::*
[not (attribute::rev:last-revision='')]"/>
<xsl:if test="count($revision-nodes) &gt; 0">
<xsl:variable name="revision-node"
select="$revision-nodes[last()]"/>
<xsl:variable name="revision-text">
<xsl:value-of
select="normalize-space($revision-node/attribute::rev:last-revision)"/>
</xsl:variable>
<xsl:if test="string-length($revision-text) &gt; 0">
<p>
<small>
<xsl:text>Last revised: </xsl:text>
<xsl:choose>
<xsl:when test="contains($revision-text, '/')">
<xsl:call-template name="format.cvs.revision">
<xsl:with-param name="text" select="$revision-text"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="format.svn.revision">
<xsl:with-param name="text" select="$revision-text"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</small>
</p>
</xsl:if>
</xsl:if>
</td>
<td align="right">
<div class = "copyright-footer">
<xsl:apply-templates select="ancestor::*/*/copyright"
mode="boost.footer"/>
<xsl:apply-templates select="ancestor::*/*/legalnotice"
mode="boost.footer"/>
</div>
</td>
</tr>
</table>
</xsl:template>
<!-- We don't want refentry's to show up in the TOC because they
will merely be redundant with the synopsis. -->
<xsl:template match="refentry" mode="toc"/>
<!-- override the behaviour of some DocBook elements for better
rendering facilities -->
<xsl:template match = "programlisting[ancestor::informaltable]">
<pre class = "table-{name(.)}"><xsl:apply-templates/></pre>
</xsl:template>
<xsl:template match = "refsynopsisdiv">
<h2 class = "{name(.)}-title">Synopsis</h2>
<div class = "{name(.)}">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template name="generate.html.title"/>
<!-- ============================================================ -->
<xsl:template name="output.html.stylesheets">
<xsl:param name="stylesheets" select="''"/>
<xsl:choose>
<xsl:when test="contains($stylesheets, ' ')">
<link rel="stylesheet">
<xsl:attribute name="href">
<xsl:call-template name="href.target.relative">
<xsl:with-param name="target" select="substring-before($stylesheets, ' ')"/>
</xsl:call-template>
</xsl:attribute>
<xsl:if test="$html.stylesheet.type != ''">
<xsl:attribute name="type">
<xsl:value-of select="$html.stylesheet.type"/>
</xsl:attribute>
</xsl:if>
</link>
<xsl:call-template name="output.html.stylesheets">
<xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$stylesheets != ''">
<link rel="stylesheet">
<xsl:attribute name="href">
<xsl:call-template name="href.target.relative">
<xsl:with-param name="target" select="$stylesheets"/>
</xsl:call-template>
</xsl:attribute>
<xsl:if test="$html.stylesheet.type != ''">
<xsl:attribute name="type">
<xsl:value-of select="$html.stylesheet.type"/>
</xsl:attribute>
</xsl:if>
</link>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -14,6 +14,7 @@
<xsl:import <xsl:import
href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/> href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
<xsl:import href="admon.xsl"/> <xsl:import href="admon.xsl"/>
<xsl:import href="relative-href.xsl"/>
<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>

View File

@ -16,308 +16,22 @@
<xsl:import <xsl:import
href="http://docbook.sourceforge.net/release/xsl/current/html/math.xsl"/> href="http://docbook.sourceforge.net/release/xsl/current/html/math.xsl"/>
<xsl:import href="chunk-common.xsl"/> <!-- Bring in the fast chunking overrides. There's nothing
<xsl:import href="docbook-layout.xsl"/> that we need to override, so include instead of importing it. -->
<xsl:import href="navbar.xsl"/> <xsl:include
<xsl:import href="admon.xsl"/> href="http://docbook.sourceforge.net/release/xsl/current/html/chunkfast.xsl"/>
<xsl:import href="xref.xsl"/>
<xsl:import href="relative-href.xsl"/> <!-- We have to make sure that our templates override all
<xsl:import href="callout.xsl"/> docbook templates. Therefore, we include our own templates
instead of importing them. In order for this to work,
<xsl:param name="html.stylesheet"> the stylesheets included here cannot also include each other -->
<xsl:choose> <xsl:include href="chunk-common.xsl"/>
<xsl:when test = "$boost.defaults = 'Boost'"> <xsl:include href="docbook-layout.xsl"/>
<xsl:value-of select = "concat($boost.root, '/doc/src/boostbook.css')"/> <xsl:include href="navbar.xsl"/>
</xsl:when> <xsl:include href="admon.xsl"/>
<xsl:otherwise> <xsl:include href="xref.xsl"/>
boostbook.css <xsl:include href="relative-href.xsl"/>
</xsl:otherwise> <xsl:include href="callout.xsl"/>
</xsl:choose> <xsl:include href="html-base.xsl"/>
</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="navig.graphics" select="1"/>
<xsl:param name="navig.graphics.extension" select="'.png'"/>
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="use.id.as.filename" select="1"/>
<xsl:param name="refentry.generate.name" select="0"/>
<xsl:param name="refentry.generate.title" select="1"/>
<xsl:param name="make.year.ranges" select="1"/>
<xsl:param name="generate.manifest" select="1"/>
<xsl:param name="generate.section.toc.level" select="3"/>
<xsl:param name="doc.standalone">false</xsl:param>
<xsl:param name="chunker.output.indent">yes</xsl:param>
<xsl:param name="chunker.output.encoding">US-ASCII</xsl:param>
<xsl:param name="chunk.quietly" select="not(number($boostbook.verbose))"/>
<xsl:param name="toc.max.depth">2</xsl:param>
<xsl:param name="callout.graphics.number.limit">15</xsl:param>
<xsl:param name = "admon.graphics.path"
select = "concat($boost.root, '/doc/html/images/')"/>
<xsl:param name = "navig.graphics.path"
select = "concat($boost.root, '/doc/html/images/')"/>
<xsl:param name = "callout.graphics.path"
select = "concat($boost.root, '/doc/src/images/callouts/')"/>
<xsl:param name="admon.style">
<!-- Remove the style. Let the CSS do the styling -->
</xsl:param>
<!-- Always have graphics -->
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="generate.toc">
appendix toc,title
article/appendix nop
article toc,title
book toc,title
chapter toc,title
part toc,title
preface toc,title
qandadiv toc
qandaset toc
reference toc,title
sect1 toc
sect2 toc
sect3 toc
sect4 toc
sect5 toc
section toc
set toc,title
</xsl:param>
<xsl:template name="format.cvs.revision">
<xsl:param name="text"/>
<!-- Remove the "$Date: " -->
<xsl:variable name="text.noprefix"
select="substring-after($text, '$Date: ')"/>
<!-- Grab the year -->
<xsl:variable name="year" select="substring-before($text.noprefix, '/')"/>
<xsl:variable name="text.noyear"
select="substring-after($text.noprefix, '/')"/>
<!-- Grab the month -->
<xsl:variable name="month" select="substring-before($text.noyear, '/')"/>
<xsl:variable name="text.nomonth"
select="substring-after($text.noyear, '/')"/>
<!-- Grab the year -->
<xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
<xsl:variable name="text.noday"
select="substring-after($text.nomonth, ' ')"/>
<!-- Get the time -->
<xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
<xsl:variable name="month.name">
<xsl:choose>
<xsl:when test="$month=1">January</xsl:when>
<xsl:when test="$month=2">February</xsl:when>
<xsl:when test="$month=3">March</xsl:when>
<xsl:when test="$month=4">April</xsl:when>
<xsl:when test="$month=5">May</xsl:when>
<xsl:when test="$month=6">June</xsl:when>
<xsl:when test="$month=7">July</xsl:when>
<xsl:when test="$month=8">August</xsl:when>
<xsl:when test="$month=9">September</xsl:when>
<xsl:when test="$month=10">October</xsl:when>
<xsl:when test="$month=11">November</xsl:when>
<xsl:when test="$month=12">December</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
$time, ' GMT')"/>
</xsl:template>
<xsl:template name="format.svn.revision">
<xsl:param name="text"/>
<!-- Remove the "$Date: " -->
<xsl:variable name="text.noprefix"
select="substring-after($text, '$Date: ')"/>
<!-- Grab the year -->
<xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
<xsl:variable name="text.noyear"
select="substring-after($text.noprefix, '-')"/>
<!-- Grab the month -->
<xsl:variable name="month" select="substring-before($text.noyear, '-')"/>
<xsl:variable name="text.nomonth"
select="substring-after($text.noyear, '-')"/>
<!-- Grab the year -->
<xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
<xsl:variable name="text.noday"
select="substring-after($text.nomonth, ' ')"/>
<!-- Get the time -->
<xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
<xsl:variable name="text.notime"
select="substring-after($text.noday, ' ')"/>
<!-- Get the timezone -->
<xsl:variable name="timezone" select="substring-before($text.notime, ' ')"/>
<xsl:variable name="month.name">
<xsl:choose>
<xsl:when test="$month=1">January</xsl:when>
<xsl:when test="$month=2">February</xsl:when>
<xsl:when test="$month=3">March</xsl:when>
<xsl:when test="$month=4">April</xsl:when>
<xsl:when test="$month=5">May</xsl:when>
<xsl:when test="$month=6">June</xsl:when>
<xsl:when test="$month=7">July</xsl:when>
<xsl:when test="$month=8">August</xsl:when>
<xsl:when test="$month=9">September</xsl:when>
<xsl:when test="$month=10">October</xsl:when>
<xsl:when test="$month=11">November</xsl:when>
<xsl:when test="$month=12">December</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
$time, ' ', $timezone)"/>
</xsl:template>
<!-- Footer Copyright -->
<xsl:template match="copyright" mode="boost.footer">
<xsl:if test="position() &gt; 1">
<br/>
</xsl:if>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Copyright'"/>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:call-template name="dingbat">
<xsl:with-param name="dingbat">copyright</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:call-template name="copyright.years">
<xsl:with-param name="years" select="year"/>
<xsl:with-param name="print.ranges" select="$make.year.ranges"/>
<xsl:with-param name="single.year.ranges"
select="$make.single.year.ranges"/>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:apply-templates select="holder" mode="titlepage.mode"/>
</xsl:template>
<!-- Footer License -->
<xsl:template match="legalnotice" mode="boost.footer">
<xsl:apply-templates select="para" mode="titlepage.mode" />
</xsl:template>
<xsl:template name="user.footer.content">
<table width="100%">
<tr>
<td align="left">
<xsl:variable name="revision-nodes"
select="ancestor-or-self::*
[not (attribute::rev:last-revision='')]"/>
<xsl:if test="count($revision-nodes) &gt; 0">
<xsl:variable name="revision-node"
select="$revision-nodes[last()]"/>
<xsl:variable name="revision-text">
<xsl:value-of
select="normalize-space($revision-node/attribute::rev:last-revision)"/>
</xsl:variable>
<xsl:if test="string-length($revision-text) &gt; 0">
<p>
<small>
<xsl:text>Last revised: </xsl:text>
<xsl:choose>
<xsl:when test="contains($revision-text, '/')">
<xsl:call-template name="format.cvs.revision">
<xsl:with-param name="text" select="$revision-text"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="format.svn.revision">
<xsl:with-param name="text" select="$revision-text"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</small>
</p>
</xsl:if>
</xsl:if>
</td>
<td align="right">
<div class = "copyright-footer">
<xsl:apply-templates select="ancestor::*/*/copyright"
mode="boost.footer"/>
<xsl:apply-templates select="ancestor::*/*/legalnotice"
mode="boost.footer"/>
</div>
</td>
</tr>
</table>
</xsl:template>
<!-- We don't want refentry's to show up in the TOC because they
will merely be redundant with the synopsis. -->
<xsl:template match="refentry" mode="toc"/>
<!-- override the behaviour of some DocBook elements for better
rendering facilities -->
<xsl:template match = "programlisting[ancestor::informaltable]">
<pre class = "table-{name(.)}"><xsl:apply-templates/></pre>
</xsl:template>
<xsl:template match = "refsynopsisdiv">
<h2 class = "{name(.)}-title">Synopsis</h2>
<div class = "{name(.)}">
<xsl:apply-templates/>
</div>
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="output.html.stylesheets">
<xsl:param name="stylesheets" select="''"/>
<xsl:choose>
<xsl:when test="contains($stylesheets, ' ')">
<link rel="stylesheet">
<xsl:attribute name="href">
<xsl:call-template name="href.target.relative">
<xsl:with-param name="target" select="substring-before($stylesheets, ' ')"/>
</xsl:call-template>
</xsl:attribute>
<xsl:if test="$html.stylesheet.type != ''">
<xsl:attribute name="type">
<xsl:value-of select="$html.stylesheet.type"/>
</xsl:attribute>
</xsl:if>
</link>
<xsl:call-template name="output.html.stylesheets">
<xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$stylesheets != ''">
<link rel="stylesheet">
<xsl:attribute name="href">
<xsl:call-template name="href.target.relative">
<xsl:with-param name="target" select="$stylesheets"/>
</xsl:call-template>
</xsl:attribute>
<xsl:if test="$html.stylesheet.type != ''">
<xsl:attribute name="type">
<xsl:value-of select="$html.stylesheet.type"/>
</xsl:attribute>
</xsl:if>
</link>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -7,6 +7,7 @@
http://www.boost.org/LICENSE_1_0.txt) http://www.boost.org/LICENSE_1_0.txt)
--> -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
version="1.0"> version="1.0">
<!-- Maximum length of directory and file names is 31 characters. <!-- Maximum length of directory and file names is 31 characters.
@ -154,40 +155,65 @@
<xsl:template name="build-fully-qualified-name"> <xsl:template name="build-fully-qualified-name">
<xsl:param name="is.id" select="false()" /> <xsl:param name="is.id" select="false()" />
<!-- The depth of qualified name element that we will print now-->
<xsl:param name="depth" select="1"/>
<!-- Determine the set of ancestor namespaces --> <!-- Determine the set of ancestor namespaces -->
<xsl:variable name="ancestors" <xsl:variable name="ancestors"
select="ancestor::namespace| select="ancestor::namespace|
ancestor::class|ancestor::struct|ancestor::union| ancestor::class|ancestor::struct|ancestor::union|
ancestor::class-specialization|ancestor::struct-specialization|ancestor::union-specialization"/> ancestor::class-specialization|ancestor::struct-specialization|ancestor::union-specialization"/>
<xsl:for-each select="$ancestors">
<xsl:apply-templates select="." mode="fast-print-id-part">
<xsl:with-param name="is.id" select="$is.id"/>
</xsl:apply-templates>
<xsl:choose>
<xsl:when test="$is.id"><xsl:text>.</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>::</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:apply-templates select="." mode="fast-print-id-part">
<xsl:with-param name="is.id" select="$is.id"/>
</xsl:apply-templates>
</xsl:template>
<xsl:variable name="elements-with-ids">
<xsl:apply-templates select="namespace|class|struct|union|class-specialization|struct-specialization|union-specialization"
mode="preprocess-ids"/>
</xsl:variable>
<xsl:variable name="fast-elements" select="exsl:node-set($elements-with-ids)"/>
<xsl:template match="*" mode="preprocess-ids">
<element>
<xsl:attribute name="id">
<xsl:value-of select="generate-id()"/>
</xsl:attribute>
<xsl:attribute name="part-id">
<xsl:call-template name="print-id-part"/>
</xsl:attribute>
</element>
</xsl:template>
<xsl:template name="print-id-part">
<xsl:apply-templates select="." mode="print-id-part"/>
</xsl:template>
<xsl:template match="*" mode="fast-print-id-part">
<xsl:param name="is.id"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$depth &gt; count($ancestors)"> <xsl:when test="not($is.id)">
<xsl:apply-templates select="." mode="print-name"/>
</xsl:when>
<xsl:when test="$fast-elements[@id=generate-id()]">
<xsl:value-of select="$fast-elements[@id=generate-id()]/@part-id"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="print-id-part"> <xsl:apply-templates select="." mode="print-id-part">
<xsl:with-param name="is.id" select="$is.id"/> <xsl:with-param name="is.id" select="$is.id"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:if test="name($ancestors[$depth])='namespace' or
count(ancestor::free-function-group)=0">
<xsl:apply-templates select="$ancestors[$depth]" mode="print-id-part">
<xsl:with-param name="is.id" select="$is.id"/>
</xsl:apply-templates>
<xsl:choose>
<xsl:when test="$is.id"><xsl:text>.</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>::</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:call-template name="build-fully-qualified-name">
<xsl:with-param name="is.id" select="$is.id"/>
<xsl:with-param name="depth" select="$depth + 1"/>
</xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<!-- Print the part of a fully qualified name for a single element --> <!-- Print the part of a fully qualified name for a single element -->
<xsl:template match="*" mode="print-id-part"> <xsl:template match="*" mode="print-id-part">
<xsl:param name="is.id"/> <xsl:param name="is.id"/>
@ -252,167 +278,81 @@
<xsl:apply-templates select="specialization/template-arg" mode="print-name"/> <xsl:apply-templates select="specialization/template-arg" mode="print-name"/>
<xsl:text>&gt;</xsl:text> <xsl:text>&gt;</xsl:text>
</xsl:template> </xsl:template>
<xsl:template name="concat-directives">
<xsl:param name="directives"/>
<xsl:for-each select="$directives">
<xsl:apply-templates select="." mode="print-name"/>
<xsl:text>::</xsl:text>
</xsl:for-each>
</xsl:template>
<xsl:template name="name-matches-node"> <xsl:template name="find-nodes-matching-name">
<!-- The name we are looking for --> <!-- The name we are looking for -->
<xsl:param name="name"/> <xsl:param name="name"/>
<!-- The name to display -->
<xsl:param name="display-name" select="$name"/>
<!-- The context in which this name occurs --> <!-- The context in which this name occurs -->
<xsl:param name="context"/> <xsl:param name="context"/>
<!-- The node that we are checking against --> <!-- The node that we are checking against -->
<xsl:param name="node"/> <xsl:param name="nodes"/>
<!-- The mode we are in. Can be one of: <!-- The set of using directives for this context node -->
matches: emits the matches as they are found (for debugging) <xsl:variable name="directives"
link: link to the node that was found select="$context/ancestor::*/using-namespace |
-->
<xsl:param name="mode" select="'matches'"/>
<!-- The index into the list of using directives for the context node -->
<xsl:param name="index" select="1"/>
<!-- The prefix we should append to the name when checking this node -->
<xsl:param name="prefix" select="''"/>
<xsl:choose>
<xsl:when test="count($node) &gt; 1">
<xsl:variable name="matches">
<xsl:call-template name="count-matches">
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="nodes" select="$node[position() = 1]"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$matches = 0">
<xsl:call-template name="name-matches-node">
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="display-name" select="$display-name"/>
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="node" select="$node[position() &gt; 1]"/>
<xsl:with-param name="mode" select="$mode"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="name-matches-node">
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="display-name" select="$display-name"/>
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="node" select="$node[position() = 1]"/>
<xsl:with-param name="mode" select="$mode"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="count($node) = 1">
<!-- The fully-qualified name of the node we are checking against -->
<xsl:variable name="fully-qualified-name">
<xsl:call-template name="fully-qualified-name">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</xsl:variable>
<!-- The set of using directives for this context node -->
<xsl:variable name="directives"
select="$context/ancestor::*/using-namespace |
$context/ancestor::namespace | $context/ancestor::namespace |
$context/ancestor::*/using-class | $context/ancestor::*/using-class |
$context/ancestor::class | $context/ancestor::class |
$context/ancestor::struct"/> $context/ancestor::struct"/>
<!-- The name of the current directive --> <xsl:variable name="directives-str">
<xsl:variable name="this-context"> <xsl:call-template name="concat-directives">
<xsl:apply-templates select="$directives[$index]" mode="print-name"/> <xsl:with-param name="directives" select="$directives"/>
</xsl:variable> </xsl:call-template>
</xsl:variable>
<!-- Check if we have a match --> <xsl:apply-templates select="$nodes" mode="generate-cxx-links">
<xsl:variable name="have-match" <xsl:with-param name="name" select="$name"/>
select="$fully-qualified-name = concat($prefix, $name)"/> <xsl:with-param name="directives-str" select="$directives-str"/>
</xsl:apply-templates>
<xsl:if test="$have-match">
<xsl:choose>
<xsl:when test="$mode='matches'">
Match in namespace ::<xsl:value-of select="$prefix"/>
</xsl:when>
<xsl:when test="$mode='link'">
<xsl:call-template name="internal-link">
<xsl:with-param name="to">
<xsl:call-template name="generate.id">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="text" select="$display-name"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="(not($index &gt; count($directives))) and
(not($have-match) or ($mode = 'matches'))">
<xsl:variable name="first-branch">
<xsl:if test="not ($prefix = '')">
<!-- Recurse and append the current context node to the prefix -->
<xsl:call-template name="name-matches-node">
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="display-name" select="$display-name"/>
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="mode" select="$mode"/>
<xsl:with-param name="index" select="$index + 1"/>
<xsl:with-param name="prefix"
select="concat($prefix, $this-context, '::')"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="string($first-branch) != ''">
<xsl:copy-of select="$first-branch"/>
</xsl:when>
<xsl:otherwise>
<!-- Recurse with just the current context node -->
<xsl:call-template name="name-matches-node">
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="display-name" select="$display-name"/>
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="mode" select="$mode"/>
<xsl:with-param name="index" select="$index + 1"/>
<xsl:with-param name="prefix"
select="concat($this-context, '::')"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:when>
</xsl:choose>
</xsl:template> </xsl:template>
<!-- Count the number of nodes in the set that match the given name and <xsl:template match="*" mode="generate-cxx-links">
lookup context -->
<xsl:template name="count-matches">
<xsl:param name="name"/> <xsl:param name="name"/>
<xsl:param name="context"/> <xsl:param name="directives-str"/>
<xsl:param name="nodes"/>
<xsl:variable name="match-string"> <xsl:variable name="node-name">
<xsl:for-each select="$nodes"> <xsl:call-template name="fully-qualified-name">
<xsl:variable name="does-match"> <xsl:with-param name="node" select="."/>
<xsl:call-template name="name-matches-node"> </xsl:call-template>
<xsl:with-param name="name" select="$name"/> </xsl:variable>
<xsl:with-param name="context" select="$context"/>
<xsl:variable name="leading-chars"
select="string-length($node-name) - string-length($name)"/>
<!-- Check if this node matches any visible namespace -->
<xsl:if test="string-length($node-name) &gt;= string-length($name) and
substring($node-name, $leading-chars + 1,
string-length($name)) = $name">
<xsl:variable name="qualifiers"
select="substring($node-name, 1, $leading-chars)"/>
<xsl:if test="contains($directives-str, $qualifiers)">
<xsl:variable name="myid">
<xsl:call-template name="generate.id">
<xsl:with-param name="node" select="."/> <xsl:with-param name="node" select="."/>
</xsl:call-template> </xsl:call-template>
</xsl:variable> </xsl:variable>
<xsl:if test="not($does-match='')">X</xsl:if> <cxx-link-helper>
</xsl:for-each> <xsl:attribute name="id">
</xsl:variable> <xsl:value-of select="$myid"/>
<xsl:value-of select="string-length($match-string)"/> </xsl:attribute>
<xsl:attribute name="namespace">
<xsl:value-of select="$qualifiers"/>
</xsl:attribute>
<xsl:text>random text</xsl:text>
</cxx-link-helper>
</xsl:if>
</xsl:if>
</xsl:template> </xsl:template>
<xsl:template name="cxx-link-name"> <xsl:template name="cxx-link-name">
@ -433,18 +373,20 @@
<!-- The list of nodes that match the lookup node in both name and type --> <!-- The list of nodes that match the lookup node in both name and type -->
<xsl:param name="nodes"/> <xsl:param name="nodes"/>
<!-- Count the number of nodes that match --> <!-- Filter the nodes to leave only the ones that are in scope. -->
<xsl:variable name="matches"> <xsl:variable name="matches1">
<xsl:call-template name="count-matches"> <xsl:call-template name="find-nodes-matching-name">
<xsl:with-param name="name" select="$name"/> <xsl:with-param name="name" select="$name"/>
<xsl:with-param name="context" select="$lookup"/>
<xsl:with-param name="nodes" select="$nodes"/> <xsl:with-param name="nodes" select="$nodes"/>
<xsl:with-param name="context" select="$lookup"/>
</xsl:call-template> </xsl:call-template>
</xsl:variable> </xsl:variable>
<xsl:variable name="matches" select="exsl:node-set($matches1)//cxx-link-helper"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$matches = 0"> <xsl:when test="count($matches) = 0">
<xsl:message> <xsl:message>
<xsl:text>Cannot find </xsl:text> <xsl:text>Cannot find </xsl:text>
<xsl:value-of select="$type"/> <xsl:value-of select="$type"/>
@ -454,39 +396,27 @@
</xsl:message> </xsl:message>
<xsl:value-of select="$display-name"/> <xsl:value-of select="$display-name"/>
</xsl:when> </xsl:when>
<xsl:when test="$matches = 1">
<xsl:for-each select="$nodes">
<xsl:call-template name="name-matches-node">
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="display-name" select="$display-name"/>
<xsl:with-param name="context" select="$lookup"/>
<xsl:with-param name="node" select="."/>
<xsl:with-param name="mode" select="'link'"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:message> <!-- If we found more than one, print a message and take the first -->
<xsl:text>Reference to </xsl:text> <xsl:if test="count($matches) &gt; 1">
<xsl:value-of select="$type"/> <xsl:message>
<xsl:text> '</xsl:text> <xsl:text>Reference to </xsl:text>
<xsl:value-of select="$name"/> <xsl:value-of select="$type"/>
<xsl:text>' is ambiguous. Found:</xsl:text> <xsl:text> '</xsl:text>
<xsl:for-each select="$nodes"> <xsl:value-of select="$name"/>
<xsl:call-template name="name-matches-node"> <xsl:text>' is ambiguous. Found:</xsl:text>
<xsl:with-param name="name" select="$name"/> <xsl:for-each select="$matches">
<xsl:with-param name="context" select="$lookup"/> <xsl:text>
<xsl:with-param name="node" select="."/> Match in namespace ::</xsl:text>
<xsl:with-param name="mode" select="'matches'"/> <xsl:value-of select="@namespace"/>
</xsl:call-template> </xsl:for-each>
</xsl:for-each> </xsl:message>
</xsl:message> </xsl:if>
<xsl:call-template name="name-matches-node"> <xsl:call-template name="internal-link">
<xsl:with-param name="name" select="$name"/> <xsl:with-param name="to">
<xsl:with-param name="display-name" select="$display-name"/> <xsl:value-of select="$matches[position() = 1]/@id"/>
<xsl:with-param name="context" select="$lookup"/> </xsl:with-param>
<xsl:with-param name="node" select="$nodes"/> <xsl:with-param name="text" select="$display-name"/>
<xsl:with-param name="mode" select="'link'"/>
</xsl:call-template> </xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>

View File

@ -9,8 +9,9 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"> version="1.0">
<xsl:import href="relative-href.xsl"/> <!-- Already included in the main style sheet -->
<!-- <xsl:import href="relative-href.xsl"/> -->
<!-- <!--
boost.defaults: boost.defaults:
*custom - only use explicitly set parameters *custom - only use explicitly set parameters
@ -369,7 +370,7 @@
</xsl:call-template> </xsl:call-template>
</a></xsl:if> </a></xsl:if>
<!-- home --> <!-- home -->
<xsl:if test = "$home != . or $nav.context = 'toc'"> <xsl:if test = "generate-id($home) != generate-id(.) or $nav.context = 'toc'">
<a accesskey = "h"> <a accesskey = "h">
<xsl:attribute name = "href"><xsl:call-template name = "href.target"> <xsl:attribute name = "href"><xsl:call-template name = "href.target">
<xsl:with-param name = "object" select = "$home"/> <xsl:with-param name = "object" select = "$home"/>

View File

@ -29,9 +29,8 @@
<xsl:with-param name="indentation" select="$indentation"/> <xsl:with-param name="indentation" select="$indentation"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="source-highlight"> <xsl:call-template name="source-highlight">
<xsl:with-param name="text" select="concat('namespace ',@name)"/> <xsl:with-param name="text" select="concat('namespace ',@name, ' {')"/>
</xsl:call-template> </xsl:call-template>
<xsl:text> {</xsl:text>
<!-- Emit namespace types --> <!-- Emit namespace types -->
<xsl:apply-templates select="class|class-specialization| <xsl:apply-templates select="class|class-specialization|
@ -58,7 +57,9 @@
<xsl:call-template name="indent"> <xsl:call-template name="indent">
<xsl:with-param name="indentation" select="$indentation"/> <xsl:with-param name="indentation" select="$indentation"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>}</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'}'"/>
</xsl:call-template>
</xsl:template> </xsl:template>
<!-- Emit namespace synopsis --> <!-- Emit namespace synopsis -->
@ -97,9 +98,71 @@
<xsl:template match="para|section" mode="synopsis"/> <xsl:template match="para|section" mode="synopsis"/>
<xsl:template match="para|section" mode="reference"/> <xsl:template match="para|section" mode="reference"/>
<xsl:template name="find-wrap-point">
<xsl:param name="text"/>
<xsl:param name="prefix"/>
<xsl:param name="result" select="0"/>
<xsl:param name="default" select="$max-columns - string-length($prefix)"/>
<xsl:variable name="s" select="substring($text, 2)"/>
<xsl:variable name="candidate">
<xsl:choose>
<xsl:when test="contains($s, ' ')">
<xsl:value-of select="string-length(substring-before($s, ' ')) + 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string-length($text)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($prefix) + $result + $candidate &lt;= $max-columns">
<xsl:call-template name="find-wrap-point">
<xsl:with-param name="text" select="substring($text, $candidate + 1)"/>
<xsl:with-param name="prefix" select="$prefix"/>
<xsl:with-param name="result" select="$result + $candidate"/>
<xsl:with-param name="default" select="$result + $candidate"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$default"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="wrap-comment">
<xsl:param name="prefix"/>
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="string-length($prefix) + string-length($text) &lt;= $max-columns">
<xsl:value-of select="$text"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="size">
<xsl:call-template name="find-wrap-point">
<xsl:with-param name="prefix" select="$prefix"/>
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="substring($text, 1, $size)"/>
<xsl:text>&#10;</xsl:text>
<xsl:value-of select="$prefix"/>
<xsl:call-template name="wrap-comment">
<xsl:with-param name="prefix" select="$prefix"/>
<xsl:with-param name="text" select="normalize-space(substring($text, $size + 1))"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Comment mode tries to wipe out any extra spacing in the output --> <!-- Comment mode tries to wipe out any extra spacing in the output -->
<xsl:template match="purpose" mode="comment"> <xsl:template match="purpose" mode="comment">
<xsl:apply-templates mode="comment"/> <xsl:param name="wrap" select="false()"/>
<xsl:param name="prefix"/>
<xsl:apply-templates mode="comment">
<xsl:with-param name="wrap"
select="$wrap and count(*) = 0 and count(text()) = 1"/>
<xsl:with-param name="prefix" select="$prefix"/>
</xsl:apply-templates>
</xsl:template> </xsl:template>
<xsl:template match="simpara|para" mode="comment"> <xsl:template match="simpara|para" mode="comment">
@ -107,7 +170,20 @@
</xsl:template> </xsl:template>
<xsl:template match="text()" mode="comment"> <xsl:template match="text()" mode="comment">
<xsl:value-of select="."/> <xsl:param name="wrap" select="false()"/>
<xsl:param name="prefix"/>
<xsl:variable name="stripped" select="normalize-space(.)"/>
<xsl:choose>
<xsl:when test="$wrap">
<xsl:call-template name="wrap-comment">
<xsl:with-param name="prefix" select="$prefix"/>
<xsl:with-param name="text" select="$stripped"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="*" mode="comment"> <xsl:template match="*" mode="comment">

View File

@ -24,111 +24,406 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<!-- Perform C++ keyword highlighting on the given text --> <xsl:variable name="id-start-chars" select="'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_'"/>
<xsl:template name="highlight-text"> <xsl:variable name="id-chars" select="'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_'"/>
<xsl:param name="text" select="."/> <xsl:variable name="digits" select="'1234567890'"/>
<xsl:param name="keywords" <xsl:variable name="number-chars" select="'1234567890abcdefABCDEFxX.'"/>
select="'asm auto bool break case catch char class const const_cast continue default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int long mutable namespace new operator private protected public register reinterpret_cast return short signed sizeof static static_cast struct switch template this throw true try typedef typeid typename union unsigned using virtual void volatile wchar_t while'"/> <xsl:variable name="keywords"
<xsl:param name="best-match" select="''"/> select="' asm auto bool break case catch char class const const_cast continue default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int long mutable namespace new operator private protected public register reinterpret_cast return short signed sizeof static static_cast struct switch template this throw true try typedef typeid typename union unsigned using virtual void volatile wchar_t while '"/>
<xsl:variable name="operators4" select="'%:%:'"/>
<!-- Determine the current keyword --> <xsl:variable name="operators3" select="'&gt;&gt;= &lt;&lt;= -&gt;* ...'"/>
<xsl:variable name="keyword"> <xsl:variable name="operators2" select="'.* :: ## &lt;: :&gt; &lt;% %&gt; %: += -= *= /= %= ^= &amp;= |= &lt;&lt; &gt;&gt; == != &lt;= &gt;= &amp;&amp; || ++ -- -&gt;'"/>
<xsl:choose> <xsl:variable name="operators1" select="'. ? { } [ ] # ( ) ; : + - * / % ^ &amp; | ~ ! = &lt; &gt; ,'"/>
<xsl:when test="contains($keywords, ' ')"> <xsl:variable name="single-quote">'</xsl:variable>
<xsl:value-of select="substring-before($keywords, ' ')"/>
</xsl:when> <!-- Syntax highlighting -->
<xsl:otherwise> <xsl:template name="highlight-keyword">
<xsl:value-of select="$keywords"/> <xsl:param name="keyword"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Determine the set of keywords that are left -->
<xsl:variable name="keywords-left">
<xsl:if test="contains($keywords, ' ')">
<xsl:value-of select="substring-after($keywords, ' ')"/>
</xsl:if>
</xsl:variable>
<!-- The set of characters that can be identifiers -->
<xsl:variable name="id-chars" select="'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'"/>
<xsl:variable name="X" select="'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'"/>
<xsl:choose> <xsl:choose>
<!-- Have we exhausted all keywords without finding any to highlight? --> <xsl:when test="$boost.syntax.highlight='1'">
<xsl:when test="$keyword='' and $best-match=''"> <phrase role="keyword">
<!-- Just copy the text --> <xsl:value-of select="$keyword"/>
<xsl:copy-of select="$text"/> </phrase>
</xsl:when> </xsl:when>
<!-- Have we exhausted all keywords, but have one to highlight? If so,
make sure we didn't just find part of an identifier. -->
<xsl:when
test="$keyword='' and
not (starts-with(translate(substring-after($text, $best-match),
$id-chars, $X), 'X')) and
not (substring(translate(substring-before($text, $best-match),
$id-chars, $X),
string-length(substring-before($text,
$best-match)),
1) = 'X')">
<!-- Copy text before this keyword -->
<xsl:value-of select="substring-before($text, $best-match)"/>
<!-- Highlight the keyword -->
<xsl:call-template name="highlight-keyword">
<xsl:with-param name="keyword" select="$best-match"/>
</xsl:call-template>
<!-- Recurse on the rest of the text -->
<xsl:call-template name="highlight-text">
<xsl:with-param name="text"
select="substring-after($text, $best-match)"/>
</xsl:call-template>
</xsl:when>
<!-- We thought we had a keyword to highlight, but it was part of an
identifier. So output all of the text up to (but not including!)
the last letter of the identifier, and try again to
highlight. -->
<xsl:when test="$keyword=''">
<xsl:value-of select="substring-before($text, $best-match)"/>
<xsl:value-of
select="substring($best-match, 1, string-length($best-match)-1)"/>
<xsl:call-template name="highlight-text">
<xsl:with-param name="text"
select="concat(substring($best-match, string-length($best-match),
1), substring-after($text, $best-match))"/>
</xsl:call-template>
</xsl:when>
<!-- Does the text contain this keyword with a better match than we
previously had? -->
<xsl:when
test="contains($text, $keyword) and
(($best-match = '') or
(string-length(substring-before($text, $keyword)) &lt;
string-length(substring-before($text, $best-match))))">
<!-- Recurse with the current keyword as the new best match -->
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="keywords" select="$keywords-left"/>
<xsl:with-param name="best-match" select="$keyword"/>
</xsl:call-template>
</xsl:when>
<!-- Text does not contain this keyword. Just recurse normally -->
<xsl:otherwise> <xsl:otherwise>
<xsl:call-template name="highlight-text"> <xsl:value-of select="$keyword"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-identifier">
<xsl:param name="identifier"/>
<xsl:choose>
<xsl:when test="contains($keywords, concat(' ', $identifier, ' '))">
<xsl:call-template name="highlight-keyword">
<xsl:with-param name="keyword" select="$identifier"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$boost.syntax.highlight='1'">
<phrase role="identifier">
<xsl:value-of select="$identifier"/>
</phrase>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$identifier"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-comment">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="$boost.syntax.highlight='1'">
<phrase role="comment">
<xsl:copy-of select="$text"/>
</phrase>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-special">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="$boost.syntax.highlight='1'">
<phrase role="special">
<xsl:value-of select="$text"/>
</phrase>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-number">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="$boost.syntax.highlight='1'">
<phrase role="number">
<xsl:value-of select="$text"/>
</phrase>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-string">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="$boost.syntax.highlight='1'">
<phrase role="string">
<xsl:value-of select="$text"/>
</phrase>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-char">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="$boost.syntax.highlight='1'">
<phrase role="char">
<xsl:value-of select="$text"/>
</phrase>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-pp-directive">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="$boost.syntax.highlight='1'">
<phrase role="preprocessor">
<xsl:value-of select="$text"/>
</phrase>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-text-ident-length">
<xsl:param name="text"/>
<xsl:param name="pos" select="1"/>
<xsl:choose>
<xsl:when test="string-length($text) + 1 = $pos">
<xsl:value-of select="$pos - 1"/>
</xsl:when>
<xsl:when test="contains($id-chars, substring($text, $pos, 1))">
<xsl:call-template name ="highlight-text-ident-length">
<xsl:with-param name="text" select="$text"/> <xsl:with-param name="text" select="$text"/>
<xsl:with-param name="keywords" select="$keywords-left"/> <xsl:with-param name="pos" select="$pos + 1"/>
<xsl:with-param name="best-match" select="$best-match"/> </xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$pos - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-text-number-length">
<xsl:param name="text"/>
<xsl:param name="pos" select="1"/>
<xsl:choose>
<xsl:when test="string-length($text) + 1 = $pos">
<xsl:value-of select="$pos - 1"/>
</xsl:when>
<xsl:when test="contains($number-chars, substring($text, $pos, 1))">
<xsl:call-template name ="highlight-text-ident-length">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="pos" select="$pos + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$pos - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-text-string-length">
<xsl:param name="text"/>
<xsl:param name="terminator"/>
<xsl:param name="pos" select="2"/>
<xsl:choose>
<xsl:when test="string-length($text) + 1 = $pos">
<xsl:value-of select="$pos - 1"/>
</xsl:when>
<xsl:when test="substring($text, $pos, 1) = $terminator">
<xsl:value-of select="$pos"/>
</xsl:when>
<xsl:when test="substring($text, $pos, 1) = '\' and
string-length($text) != $pos">
<xsl:call-template name="highlight-text-string-length">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="terminator" select="$terminator"/>
<xsl:with-param name="pos" select="$pos + 2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="highlight-text-string-length">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="terminator" select="$terminator"/>
<xsl:with-param name="pos" select="$pos + 1"/>
</xsl:call-template> </xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template name="highlight-text-operator-length">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="string-length($text) &gt;= 4 and
not(contains(substring($text, 1, 4), ' ')) and
contains($operators4, substring($text, 1, 4))">
<xsl:value-of select="4"/>
</xsl:when>
<xsl:when test="string-length($text) &gt;= 3 and
not(contains(substring($text, 1, 3), ' ')) and
contains($operators3, substring($text, 1, 3))">
<xsl:value-of select="3"/>
</xsl:when>
<xsl:when test="string-length($text) &gt;= 2 and
not(contains(substring($text, 1, 2), ' ')) and
contains($operators2, substring($text, 1, 2))">
<xsl:value-of select="2"/>
</xsl:when>
<xsl:when test="string-length($text) &gt;= 1 and
not(contains(substring($text, 1, 1), ' ')) and
contains($operators1, substring($text, 1, 1))">
<xsl:value-of select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-text-pp-directive-length">
<xsl:param name="text"/>
<!-- Assume that the first character is a # -->
<xsl:param name="pos" select="2"/>
<xsl:choose>
<xsl:when test="contains($id-chars, substring($text, $pos, 1))">
<xsl:call-template name="highlight-text-ident-length">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="pos" select="$pos + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(' &#x9;', substring($text, $pos, 1))">
<xsl:call-template name="highlight-text-pp-directive-length">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="pos" select="$pos + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$pos - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-text-impl-leading-whitespace">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="string-length($text) = 0"/>
<xsl:when test="contains(' &#xA;&#xD;&#x9;', substring($text, 1, 1))">
<xsl:value-of select="substring($text, 1, 1)"/>
<xsl:call-template name="highlight-text-impl-leading-whitespace">
<xsl:with-param name="text" select="substring($text, 2)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="'#' = substring($text, 1, 1)">
<xsl:variable name="pp-length">
<xsl:call-template name="highlight-text-pp-directive-length">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="highlight-pp-directive">
<xsl:with-param name="text" select="substring($text, 1, $pp-length)"/>
</xsl:call-template>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="substring($text, $pp-length + 1)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="highlight-text-impl-root">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="string-length($text) = 0"/>
<xsl:when test="contains($id-start-chars, substring($text, 1, 1))">
<xsl:variable name="ident-length">
<xsl:call-template name="highlight-text-ident-length">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="highlight-identifier">
<xsl:with-param name="identifier" select="substring($text, 1, $ident-length)"/>
</xsl:call-template>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="substring($text, $ident-length + 1)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($digits, substring($text, 1, 1))">
<xsl:variable name="number-length">
<xsl:call-template name="highlight-text-number-length">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="highlight-number">
<xsl:with-param name="text" select="substring($text, 1, $number-length)"/>
</xsl:call-template>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="substring($text, $number-length + 1)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="substring($text, 1, 1) = '&#x22;'">
<xsl:variable name="string-length">
<xsl:call-template name="highlight-text-string-length">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="terminator" select="'&#x22;'"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="highlight-string">
<xsl:with-param name="text" select="substring($text, 1, $string-length)"/>
</xsl:call-template>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="substring($text, $string-length + 1)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="substring($text, 1, 1) = $single-quote">
<xsl:variable name="char-length">
<xsl:call-template name="highlight-text-string-length">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="terminator" select="$single-quote"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="highlight-char">
<xsl:with-param name="text" select="substring($text, 1, $char-length)"/>
</xsl:call-template>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="substring($text, $char-length + 1)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="substring($text, 1, 2) = '//'">
<xsl:call-template name="highlight-comment">
<xsl:with-param name="text" select="substring-before($text, '&#xA;')"/>
</xsl:call-template>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="concat('&#xA;', substring-after($text, '&#xA;'))"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="substring($text, 1, 2) = '/*'">
<xsl:call-template name="highlight-comment">
<xsl:with-param name="text" select="concat(substring-before($text, '*/'), '*/')"/>
</xsl:call-template>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="substring-after($text, '*/')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains('&#xA;&#xD;', substring($text, 1, 1))">
<xsl:value-of select="substring($text, 1, 1)"/>
<xsl:call-template name="highlight-text-impl-leading-whitespace">
<xsl:with-param name="text" select="substring($text, 2)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains(' &#x9;', substring($text, 1, 1))">
<xsl:value-of select="substring($text, 1, 1)"/>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="substring($text, 2)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="operator-length">
<xsl:call-template name="highlight-text-operator-length">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$operator-length = 0">
<xsl:value-of select="substring($text, 1, 1)"/>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="substring($text, 2)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="substring($text, 1, $operator-length)"/>
</xsl:call-template>
<xsl:call-template name="highlight-text-impl-root">
<xsl:with-param name="text" select="substring($text, $operator-length + 1)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Perform C++ syntax highlighting on the given text -->
<xsl:template name="highlight-text">
<xsl:param name="text" select="."/>
<xsl:call-template name="highlight-text-impl-leading-whitespace">
<xsl:with-param name="text" select="$text"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="*" mode="highlight"> <xsl:template match="*" mode="highlight">
<xsl:element name="{name(.)}"> <xsl:element name="{name(.)}">
<xsl:for-each select="./@*"> <xsl:for-each select="./@*">

View File

@ -72,18 +72,31 @@
<xsl:call-template name="highlight-keyword"> <xsl:call-template name="highlight-keyword">
<xsl:with-param name="keyword" select="'template'"/> <xsl:with-param name="keyword" select="'template'"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="'&lt;'"/>
</xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>template</xsl:text> <xsl:text>template</xsl:text>
<xsl:text>&lt;</xsl:text>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:text>&lt;</xsl:text>
<xsl:call-template name="template.synopsis.parameters"> <xsl:call-template name="template.synopsis.parameters">
<xsl:with-param name="indentation" select="$indentation + 9"/> <xsl:with-param name="indentation" select="$indentation + 9"/>
<xsl:with-param name="wrap" select="$wrap"/> <xsl:with-param name="wrap" select="$wrap"/>
<xsl:with-param name="highlight" select="$highlight"/> <xsl:with-param name="highlight" select="$highlight"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>&gt; </xsl:text> <xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="'&gt;'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>&gt; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template> </xsl:template>
<!-- Display a list of template parameters for a synopsis (no comments) --> <!-- Display a list of template parameters for a synopsis (no comments) -->
@ -100,7 +113,16 @@
<xsl:if test="$parameters"> <xsl:if test="$parameters">
<!-- Emit the prefix (either a comma-space, or empty if this is <!-- Emit the prefix (either a comma-space, or empty if this is
the first parameter) --> the first parameter) -->
<xsl:value-of select="$prefix"/> <xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="$prefix"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$prefix"/>
</xsl:otherwise>
</xsl:choose>
<!-- Get the actual parameter and its attributes --> <!-- Get the actual parameter and its attributes -->
<xsl:variable name="parameter" select="$parameters[position()=1]"/> <xsl:variable name="parameter" select="$parameters[position()=1]"/>
@ -179,17 +201,30 @@
<xsl:call-template name="highlight-keyword"> <xsl:call-template name="highlight-keyword">
<xsl:with-param name="keyword" select="'template'"/> <xsl:with-param name="keyword" select="'template'"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="'&lt;'"/>
</xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>template</xsl:text> <xsl:text>template</xsl:text>
<xsl:text>&lt;</xsl:text>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:text>&lt;</xsl:text>
<xsl:call-template name="template.reference.parameters"> <xsl:call-template name="template.reference.parameters">
<xsl:with-param name="indentation" select="$indentation + 9"/> <xsl:with-param name="indentation" select="$indentation + 9"/>
<xsl:with-param name="highlight" select="$highlight"/> <xsl:with-param name="highlight" select="$highlight"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>&gt; </xsl:text> <xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="'&gt;'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>&gt; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
@ -236,7 +271,16 @@
</xsl:call-template> </xsl:call-template>
<xsl:if test="$rest"> <xsl:if test="$rest">
<xsl:text>, </xsl:text> <xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="', '"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if> </xsl:if>
<!-- Display the comment --> <!-- Display the comment -->
@ -314,7 +358,18 @@
<xsl:text>typename</xsl:text> <xsl:text>typename</xsl:text>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if> <xsl:if test="$parameter/@pack=1">
<xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'...'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>...</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:call-template name="template.parameter.name"> <xsl:call-template name="template.parameter.name">
@ -358,7 +413,16 @@
</xsl:variable> </xsl:variable>
<xsl:if test="not($def='')"> <xsl:if test="not($def='')">
<xsl:text> = </xsl:text> <xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' = '"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text> = </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:copy-of select="$def"/> <xsl:copy-of select="$def"/>
@ -389,7 +453,18 @@
<xsl:value-of select="$parameter/type/*|$parameter/type/text()"/> <xsl:value-of select="$parameter/type/*|$parameter/type/text()"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if> <xsl:if test="$parameter/@pack=1">
<xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'...'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>...</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:call-template name="template.parameter.name"> <xsl:call-template name="template.parameter.name">
@ -402,7 +477,16 @@
</xsl:variable> </xsl:variable>
<xsl:if test="not($def='')"> <xsl:if test="not($def='')">
<xsl:text> = </xsl:text> <xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' = '"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text> = </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose> <xsl:choose>
<xsl:when test="$highlight"> <xsl:when test="$highlight">
@ -423,25 +507,72 @@
</xsl:template> </xsl:template>
<xsl:template match="template-varargs" mode="print.parameter"> <xsl:template match="template-varargs" mode="print.parameter">
<xsl:text>...</xsl:text> <xsl:param name="highlight" select="true()"/>
<xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'...'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>...</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="specialization"> <xsl:template match="specialization">
<xsl:param name="highlight" select="true()"/> <xsl:param name="highlight" select="true()"/>
<xsl:text>&lt;</xsl:text> <xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'&lt;'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>&lt;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="template-arg"> <xsl:apply-templates select="template-arg">
<xsl:with-param name="highlight" select="$highlight"/> <xsl:with-param name="highlight" select="$highlight"/>
</xsl:apply-templates> </xsl:apply-templates>
<xsl:text>&gt;</xsl:text> <xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'&gt;'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>&gt;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="template-arg"> <xsl:template match="template-arg">
<xsl:param name="highlight" select="true()"/>
<xsl:if test="position() &gt; 1"> <xsl:if test="position() &gt; 1">
<xsl:text>, </xsl:text> <xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="', '"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if> </xsl:if>
<xsl:apply-templates mode="highlight"/> <xsl:apply-templates mode="highlight"/>
<xsl:if test="@pack=1"> <xsl:if test="@pack=1">
<xsl:text>...</xsl:text> <xsl:choose>
<xsl:when test="$highlight">
<xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'...'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>...</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -134,7 +134,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="@name"/> <xsl:value-of select="@name"/>
<xsl:apply-templates select="specialization"/> <xsl:apply-templates select="specialization"/>
<xsl:text>;</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="';'"/>
</xsl:call-template>
</xsl:variable> </xsl:variable>
<xsl:choose> <xsl:choose>
@ -160,7 +162,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
</xsl:with-param> </xsl:with-param>
</xsl:call-template> </xsl:call-template>
<xsl:apply-templates select="specialization"/> <xsl:apply-templates select="specialization"/>
<xsl:text>;</xsl:text> <xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="';'"/>
</xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
@ -195,7 +199,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:with-param name="text" select="string(@name)"/> <xsl:with-param name="text" select="string(@name)"/>
</xsl:call-template> </xsl:call-template>
<xsl:apply-templates select="specialization"/> <xsl:apply-templates select="specialization"/>
<xsl:text>;</xsl:text> <xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="';'"/>
</xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
@ -327,8 +333,10 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:with-param name="link-type" select="$link-type"/> <xsl:with-param name="link-type" select="$link-type"/>
<xsl:with-param name="highlight" select="true()"/> <xsl:with-param name="highlight" select="true()"/>
</xsl:call-template> </xsl:call-template>
<xsl:value-of select="substring(concat(';', $name-padding), <xsl:call-template name="highlight-text">
1, $max-name-length - string-length($truncated-typedef-name))"/> <xsl:with-param name="text" select="substring(concat(';', $name-padding),
1, $max-name-length - string-length($truncated-typedef-name))"/>
</xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
@ -338,7 +346,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:with-param name="link-type" select="$link-type"/> <xsl:with-param name="link-type" select="$link-type"/>
<xsl:with-param name="highlight" select="true()"/> <xsl:with-param name="highlight" select="true()"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>;</xsl:text> <xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="';'"/>
</xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
@ -461,7 +471,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:if test="not(@name = '')"> <xsl:if test="not(@name = '')">
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="@name"/> <xsl:call-template name="source-highlight">
<xsl:with-param name="text" select="@name"/>
</xsl:call-template>
</xsl:if> </xsl:if>
<xsl:text> = </xsl:text> <xsl:text> = </xsl:text>
@ -471,7 +483,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:apply-templates select="default/*|default/text()"/> <xsl:apply-templates select="default/*|default/text()"/>
</xsl:with-param> </xsl:with-param>
</xsl:call-template> </xsl:call-template>
<xsl:text>;</xsl:text> <xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="';'"/>
</xsl:call-template>
<xsl:if test="purpose"> <xsl:if test="purpose">
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
@ -523,7 +537,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<!-- Output the type --> <!-- Output the type -->
<xsl:choose> <xsl:choose>
<xsl:when test="type"> <xsl:when test="type">
<xsl:apply-templates select="type/*|type/text()" mode="annotation"/> <xsl:apply-templates select="type/*|type/text()" mode="annotation">
<xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:message> <xsl:message>
@ -581,14 +597,20 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:when test="$single-line-candidate and <xsl:when test="$single-line-candidate and
(string-length($single-line) + $indentation + 3 (string-length($single-line) + $indentation + 3
&lt; $max-columns)"> &lt; $max-columns)">
<xsl:text> : </xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' : '"/>
</xsl:call-template>
<xsl:call-template name="print.base.classes.single"/> <xsl:call-template name="print.base.classes.single"/>
<xsl:text> {</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' {'"/>
</xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="$single-line-candidate and <xsl:when test="$single-line-candidate and
(string-length($single-line) + $base-indentation + 2 (string-length($single-line) + $base-indentation + 2
&lt; $max-columns)"> &lt; $max-columns)">
<xsl:text> :&#10;</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' :&#10;'"/>
</xsl:call-template>
<xsl:call-template name="indent"> <xsl:call-template name="indent">
<xsl:with-param name="indentation" select="$base-indentation + 2"/> <xsl:with-param name="indentation" select="$base-indentation + 2"/>
</xsl:call-template> </xsl:call-template>
@ -597,10 +619,14 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:call-template name="indent"> <xsl:call-template name="indent">
<xsl:with-param name="indentation" select="$base-indentation"/> <xsl:with-param name="indentation" select="$base-indentation"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>{</xsl:text> <xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="'{'"/>
</xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text> : </xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' : '"/>
</xsl:call-template>
<xsl:call-template name="print.base.classes.multi"> <xsl:call-template name="print.base.classes.multi">
<xsl:with-param name="indentation" select="$indentation + 3"/> <xsl:with-param name="indentation" select="$indentation + 3"/>
</xsl:call-template> </xsl:call-template>
@ -608,7 +634,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:call-template name="indent"> <xsl:call-template name="indent">
<xsl:with-param name="indentation" select="$base-indentation"/> <xsl:with-param name="indentation" select="$base-indentation"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>{</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'{'"/>
</xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
@ -736,26 +764,28 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:call-template name="indent"> <xsl:call-template name="indent">
<xsl:with-param name="indentation" select="$indentation + 2"/> <xsl:with-param name="indentation" select="$indentation + 2"/>
</xsl:call-template> </xsl:call-template>
<emphasis> <xsl:call-template name="highlight-comment">
<xsl:text>// </xsl:text> <xsl:with-param name="text">
<!-- True if there are any non-compacted typedefs --> <xsl:text>// </xsl:text>
<xsl:variable name="have-typedef-references" <!-- True if there are any non-compacted typedefs -->
select="typedef and ((typedef/para|typedef/description) or ($boost.compact.typedef='0'))"/> <xsl:variable name="have-typedef-references"
<xsl:choose> select="typedef and ((typedef/para|typedef/description) or ($boost.compact.typedef='0'))"/>
<xsl:when test="$have-typedef-references"> <xsl:choose>
<xsl:call-template name="internal-link"> <xsl:when test="$have-typedef-references">
<xsl:with-param name="to"> <xsl:call-template name="internal-link">
<xsl:call-template name="generate.id"/> <xsl:with-param name="to">
<xsl:text>types</xsl:text> <xsl:call-template name="generate.id"/>
</xsl:with-param> <xsl:text>types</xsl:text>
<xsl:with-param name="text" select="'types'"/> </xsl:with-param>
</xsl:call-template> <xsl:with-param name="text" select="'types'"/>
</xsl:when> </xsl:call-template>
<xsl:otherwise> </xsl:when>
<xsl:text>types</xsl:text> <xsl:otherwise>
</xsl:otherwise> <xsl:text>types</xsl:text>
</xsl:choose> </xsl:otherwise>
</emphasis> </xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:variable name="max-type-length"> <xsl:variable name="max-type-length">
<xsl:call-template name="find-max-type-length"/> <xsl:call-template name="find-max-type-length"/>
@ -846,7 +876,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:call-template name="highlight-keyword"> <xsl:call-template name="highlight-keyword">
<xsl:with-param name="keyword" select="$specification"/> <xsl:with-param name="keyword" select="$specification"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>:</xsl:text> <xsl:call-template name="highlight-special">
<xsl:with-param name="text" select="':'"/>
</xsl:call-template>
</xsl:template> </xsl:template>
<xsl:template match="access" mode="synopsis"> <xsl:template match="access" mode="synopsis">
@ -882,15 +914,22 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
comment. --> comment. -->
<xsl:if test="purpose"> <xsl:if test="purpose">
<xsl:text>&#10;</xsl:text> <xsl:text>&#10;</xsl:text>
<xsl:call-template name="indent"> <xsl:variable name="spaces">
<xsl:with-param name="indentation" select="$indentation"/> <xsl:call-template name="indent">
</xsl:call-template> <xsl:with-param name="indentation" select="$indentation"/>
</xsl:call-template>
</xsl:variable>
<xsl:copy-of select="$spaces"/>
<xsl:call-template name="highlight-comment"> <xsl:call-template name="highlight-comment">
<xsl:with-param name="text"> <xsl:with-param name="text">
<xsl:text>// </xsl:text> <xsl:text>// </xsl:text>
<xsl:apply-templates select="purpose" mode="comment"/> <xsl:apply-templates select="purpose" mode="comment">
<xsl:with-param name="wrap" select="true()"/>
<xsl:with-param name="prefix" select="concat($spaces, '// ')"/>
</xsl:apply-templates>
</xsl:with-param> </xsl:with-param>
</xsl:call-template> </xsl:call-template>
<xsl:text>&#10;</xsl:text>
</xsl:if> </xsl:if>
</xsl:if> </xsl:if>
@ -940,7 +979,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<!-- Opening brace --> <!-- Opening brace -->
<xsl:text> {</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' {'"/>
</xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
@ -973,7 +1014,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:call-template name="indent"> <xsl:call-template name="indent">
<xsl:with-param name="indentation" select="$indentation"/> <xsl:with-param name="indentation" select="$indentation"/>
</xsl:call-template> </xsl:call-template>
<xsl:text>};</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="'};'"/>
</xsl:call-template>
</xsl:template> </xsl:template>
<!-- Emit nested class reference documentation --> <!-- Emit nested class reference documentation -->
@ -1169,7 +1212,9 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:apply-templates select="type" mode="highlight"/> <xsl:apply-templates select="type" mode="highlight"/>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="@name"/> <xsl:value-of select="@name"/>
<xsl:text>;</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="';'"/>
</xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
@ -1283,16 +1328,22 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<xsl:with-param name="higlhight" select="false()"/> <xsl:with-param name="higlhight" select="false()"/>
</xsl:call-template> </xsl:call-template>
<xsl:text> { </xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' { '"/>
</xsl:call-template>
<xsl:call-template name="type.enum.list.compact"> <xsl:call-template name="type.enum.list.compact">
<xsl:with-param name="indentation" <xsl:with-param name="indentation"
select="$indentation + string-length(@name) + 8"/> select="$indentation + string-length(@name) + 8"/>
<xsl:with-param name="compact" select="true()"/> <xsl:with-param name="compact" select="true()"/>
</xsl:call-template> </xsl:call-template>
<xsl:text> }</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' }'"/>
</xsl:call-template>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:text>;</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="';'"/>
</xsl:call-template>
</xsl:template> </xsl:template>
<!-- Enumeration reference at namespace level --> <!-- Enumeration reference at namespace level -->
@ -1354,14 +1405,18 @@ Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.na
<!-- Header --> <!-- Header -->
<xsl:variable name="header" select="concat(' ', @name, ' { ')"/> <xsl:variable name="header" select="concat(' ', @name, ' { ')"/>
<xsl:value-of select="$header"/> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="$header"/>
</xsl:call-template>
<!-- Print the enumeration values --> <!-- Print the enumeration values -->
<xsl:call-template name="type.enum.list.compact"> <xsl:call-template name="type.enum.list.compact">
<xsl:with-param name="indentation" select="4 + string-length($header)"/> <xsl:with-param name="indentation" select="4 + string-length($header)"/>
</xsl:call-template> </xsl:call-template>
<xsl:text> };</xsl:text> <xsl:call-template name="highlight-text">
<xsl:with-param name="text" select="' };'"/>
</xsl:call-template>
</xsl:template> </xsl:template>
<!-- List enumeration values in a compact form e.g., <!-- List enumeration values in a compact form e.g.,

View File

@ -16,307 +16,22 @@
<xsl:import <xsl:import
href="http://docbook.sourceforge.net/release/xsl/current/xhtml/math.xsl"/> href="http://docbook.sourceforge.net/release/xsl/current/xhtml/math.xsl"/>
<xsl:import href="chunk-common.xsl"/> <!-- Bring in the fast chunking overrides. There's nothing
<xsl:import href="docbook-layout.xsl"/> that we need to override, so include instead of importing it. -->
<xsl:import href="navbar.xsl"/> <xsl:include
<xsl:import href="admon.xsl"/> href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunkfast.xsl"/>
<xsl:import href="xref.xsl"/>
<xsl:import href="relative-href.xsl"/> <!-- We have to make sure that our templates override all
<xsl:import href="callout.xsl"/> docbook templates. Therefore, we include our own templates
instead of importing them. In order for this to work,
<xsl:param name="html.stylesheet"> the stylesheets included here cannot also include each other -->
<xsl:choose> <xsl:include href="chunk-common.xsl"/>
<xsl:when test = "$boost.defaults = 'Boost'"> <xsl:include href="docbook-layout.xsl"/>
<xsl:value-of select = "concat($boost.root, '/doc/src/boostbook.css')"/> <xsl:include href="navbar.xsl"/>
</xsl:when> <xsl:include href="admon.xsl"/>
<xsl:otherwise> <xsl:include href="xref.xsl"/>
boostbook.css <xsl:include href="relative-href.xsl"/>
</xsl:otherwise> <xsl:include href="callout.xsl"/>
</xsl:choose> <xsl:include href="html-base.xsl"/>
</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="navig.graphics" select="1"/>
<xsl:param name="navig.graphics.extension" select="'.png'"/>
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="use.id.as.filename" select="1"/>
<xsl:param name="refentry.generate.name" select="0"/>
<xsl:param name="refentry.generate.title" select="1"/>
<xsl:param name="make.year.ranges" select="1"/>
<xsl:param name="generate.manifest" select="1"/>
<xsl:param name="generate.section.toc.level" select="3"/>
<xsl:param name="doc.standalone">false</xsl:param>
<xsl:param name="chunker.output.indent">yes</xsl:param>
<xsl:param name="chunk.quietly" select="not(number($boostbook.verbose))"/>
<xsl:param name="toc.max.depth">2</xsl:param>
<xsl:param name="callout.graphics.number.limit">15</xsl:param>
<xsl:param name = "admon.graphics.path"
select = "concat($boost.root, '/doc/xhtml/images/')"/>
<xsl:param name = "navig.graphics.path"
select = "concat($boost.root, '/doc/xhtml/images/')"/>
<xsl:param name = "callout.graphics.path"
select = "concat($boost.root, '/doc/src/images/callouts/')"/>
<xsl:param name="admon.style">
<!-- Remove the style. Let the CSS do the styling -->
</xsl:param>
<!-- Always have graphics -->
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="generate.toc">
appendix toc,title
article/appendix nop
article toc,title
book toc,title
chapter toc,title
part toc,title
preface toc,title
qandadiv toc
qandaset toc
reference toc,title
sect1 toc
sect2 toc
sect3 toc
sect4 toc
sect5 toc
section toc
set toc,title
</xsl:param>
<xsl:template name="format.cvs.revision">
<xsl:param name="text"/>
<!-- Remove the "$Date: " -->
<xsl:variable name="text.noprefix"
select="substring-after($text, '$Date: ')"/>
<!-- Grab the year -->
<xsl:variable name="year" select="substring-before($text.noprefix, '/')"/>
<xsl:variable name="text.noyear"
select="substring-after($text.noprefix, '/')"/>
<!-- Grab the month -->
<xsl:variable name="month" select="substring-before($text.noyear, '/')"/>
<xsl:variable name="text.nomonth"
select="substring-after($text.noyear, '/')"/>
<!-- Grab the year -->
<xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
<xsl:variable name="text.noday"
select="substring-after($text.nomonth, ' ')"/>
<!-- Get the time -->
<xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
<xsl:variable name="month.name">
<xsl:choose>
<xsl:when test="$month=1">January</xsl:when>
<xsl:when test="$month=2">February</xsl:when>
<xsl:when test="$month=3">March</xsl:when>
<xsl:when test="$month=4">April</xsl:when>
<xsl:when test="$month=5">May</xsl:when>
<xsl:when test="$month=6">June</xsl:when>
<xsl:when test="$month=7">July</xsl:when>
<xsl:when test="$month=8">August</xsl:when>
<xsl:when test="$month=9">September</xsl:when>
<xsl:when test="$month=10">October</xsl:when>
<xsl:when test="$month=11">November</xsl:when>
<xsl:when test="$month=12">December</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
$time, ' GMT')"/>
</xsl:template>
<xsl:template name="format.svn.revision">
<xsl:param name="text"/>
<!-- Remove the "$Date: " -->
<xsl:variable name="text.noprefix"
select="substring-after($text, '$Date: ')"/>
<!-- Grab the year -->
<xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
<xsl:variable name="text.noyear"
select="substring-after($text.noprefix, '-')"/>
<!-- Grab the month -->
<xsl:variable name="month" select="substring-before($text.noyear, '-')"/>
<xsl:variable name="text.nomonth"
select="substring-after($text.noyear, '-')"/>
<!-- Grab the year -->
<xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
<xsl:variable name="text.noday"
select="substring-after($text.nomonth, ' ')"/>
<!-- Get the time -->
<xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
<xsl:variable name="text.notime"
select="substring-after($text.noday, ' ')"/>
<!-- Get the timezone -->
<xsl:variable name="timezone" select="substring-before($text.notime, ' ')"/>
<xsl:variable name="month.name">
<xsl:choose>
<xsl:when test="$month=1">January</xsl:when>
<xsl:when test="$month=2">February</xsl:when>
<xsl:when test="$month=3">March</xsl:when>
<xsl:when test="$month=4">April</xsl:when>
<xsl:when test="$month=5">May</xsl:when>
<xsl:when test="$month=6">June</xsl:when>
<xsl:when test="$month=7">July</xsl:when>
<xsl:when test="$month=8">August</xsl:when>
<xsl:when test="$month=9">September</xsl:when>
<xsl:when test="$month=10">October</xsl:when>
<xsl:when test="$month=11">November</xsl:when>
<xsl:when test="$month=12">December</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
$time, ' ', $timezone)"/>
</xsl:template>
<!-- Footer Copyright -->
<xsl:template match="copyright" mode="boost.footer">
<xsl:if test="position() &gt; 1">
<br/>
</xsl:if>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Copyright'"/>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:call-template name="dingbat">
<xsl:with-param name="dingbat">copyright</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:call-template name="copyright.years">
<xsl:with-param name="years" select="year"/>
<xsl:with-param name="print.ranges" select="$make.year.ranges"/>
<xsl:with-param name="single.year.ranges"
select="$make.single.year.ranges"/>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:apply-templates select="holder" mode="titlepage.mode"/>
</xsl:template>
<!-- Footer License -->
<xsl:template match="legalnotice" mode="boost.footer">
<xsl:apply-templates select="para" mode="titlepage.mode" />
</xsl:template>
<xsl:template name="user.footer.content">
<table width="100%">
<tr>
<td align="left">
<xsl:variable name="revision-nodes"
select="ancestor-or-self::*
[not (attribute::rev:last-revision='')]"/>
<xsl:if test="count($revision-nodes) &gt; 0">
<xsl:variable name="revision-node"
select="$revision-nodes[last()]"/>
<xsl:variable name="revision-text">
<xsl:value-of
select="normalize-space($revision-node/attribute::rev:last-revision)"/>
</xsl:variable>
<xsl:if test="string-length($revision-text) &gt; 0">
<p>
<small>
<xsl:text>Last revised: </xsl:text>
<xsl:choose>
<xsl:when test="contains($revision-text, '/')">
<xsl:call-template name="format.cvs.revision">
<xsl:with-param name="text" select="$revision-text"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="format.svn.revision">
<xsl:with-param name="text" select="$revision-text"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</small>
</p>
</xsl:if>
</xsl:if>
</td>
<td align="right">
<div class = "copyright-footer">
<xsl:apply-templates select="ancestor::*/*/copyright"
mode="boost.footer"/>
<xsl:apply-templates select="ancestor::*/*/legalnotice"
mode="boost.footer"/>
</div>
</td>
</tr>
</table>
</xsl:template>
<!-- We don't want refentry's to show up in the TOC because they
will merely be redundant with the synopsis. -->
<xsl:template match="refentry" mode="toc"/>
<!-- override the behaviour of some DocBook elements for better
rendering facilities -->
<xsl:template match = "programlisting[ancestor::informaltable]">
<pre class = "table-{name(.)}"><xsl:apply-templates/></pre>
</xsl:template>
<xsl:template match = "refsynopsisdiv">
<h2 class = "{name(.)}-title">Synopsis</h2>
<div class = "{name(.)}">
<xsl:apply-templates/>
</div>
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="output.html.stylesheets">
<xsl:param name="stylesheets" select="''"/>
<xsl:choose>
<xsl:when test="contains($stylesheets, ' ')">
<link rel="stylesheet">
<xsl:attribute name="href">
<xsl:call-template name="href.target.relative">
<xsl:with-param name="target" select="substring-before($stylesheets, ' ')"/>
</xsl:call-template>
</xsl:attribute>
<xsl:if test="$html.stylesheet.type != ''">
<xsl:attribute name="type">
<xsl:value-of select="$html.stylesheet.type"/>
</xsl:attribute>
</xsl:if>
</link>
<xsl:call-template name="output.html.stylesheets">
<xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$stylesheets != ''">
<link rel="stylesheet">
<xsl:attribute name="href">
<xsl:call-template name="href.target.relative">
<xsl:with-param name="target" select="$stylesheets"/>
</xsl:call-template>
</xsl:attribute>
<xsl:if test="$html.stylesheet.type != ''">
<xsl:attribute name="type">
<xsl:value-of select="$html.stylesheet.type"/>
</xsl:attribute>
</xsl:if>
</link>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>