1 <?xml version="1.0" encoding="utf-8"?>
3 Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
5 Distributed under the Boost Software License, Version 1.0.
6 (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
9 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11 <xsl:template match="macro" mode="synopsis">
12 <xsl:param name="indentation" select="0"/>
14 <xsl:text> </xsl:text>
16 test="not(local-name(preceding-sibling::*[position()=1])=local-name(.))">
17 <xsl:text> </xsl:text>
19 <xsl:call-template name="indent">
20 <xsl:with-param name="indentation" select="$indentation"/>
22 <xsl:call-template name="macro-synopsis">
23 <xsl:with-param name="link-type" select="'link'"/>
27 <xsl:template match="macro" mode="reference">
28 <xsl:call-template name="reference-documentation">
29 <xsl:with-param name="refname" select="@name"/>
30 <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
31 <xsl:with-param name="anchor">
32 <xsl:call-template name="generate.id"/>
34 <xsl:with-param name="name">
35 <xsl:text>Macro </xsl:text>
36 <xsl:call-template name="monospaced">
37 <xsl:with-param name="text" select="@name"/>
40 <xsl:with-param name="synopsis">
41 <xsl:call-template name="header-link"/>
42 <xsl:call-template name="macro-synopsis">
43 <xsl:with-param name="link-type" select="'none'"/>
46 <xsl:with-param name="text">
47 <xsl:apply-templates select="description"/>
49 <xsl:if test="macro-parameter/description">
50 <variablelist spacing="compact">
51 <xsl:processing-instruction name="dbhtml">
52 list-presentation="table"
53 </xsl:processing-instruction>
55 <!-- Document parameters -->
56 <xsl:if test="macro-parameter/description">
58 <term>Parameters:</term>
60 <variablelist spacing="compact">
61 <xsl:processing-instruction name="dbhtml">
62 list-presentation="table"
63 </xsl:processing-instruction>
64 <xsl:for-each select="macro-parameter">
65 <xsl:sort select="attribute::name"/>
66 <xsl:if test="description">
69 <xsl:call-template name="monospaced">
70 <xsl:with-param name="text" select="@name"/>
74 <xsl:apply-templates select="description/*"/>
90 <xsl:template name="macro-synopsis">
91 <xsl:param name="link-type"/>
93 <xsl:call-template name="link-or-anchor">
94 <xsl:with-param name="to">
95 <xsl:call-template name="generate.id" select="."/>
97 <xsl:with-param name="text" select="@name"/>
98 <xsl:with-param name="link-type" select="$link-type"/>
101 <xsl:if test="@kind='functionlike'">
102 <xsl:text>(</xsl:text>
103 <xsl:for-each select="macro-parameter">
104 <xsl:if test="position() > 1">
105 <xsl:text>, </xsl:text>
107 <xsl:value-of select="@name"/>
109 <xsl:text>)</xsl:text>
113 <xsl:template match="macro" mode="generate.id">
114 <xsl:value-of select="@name"/>
115 <xsl:if test="count(key('named-entities',
116 translate(@name, $uppercase-letters, $lowercase-letters)))!=1">
117 <xsl:text>_</xsl:text>
118 <xsl:value-of select="generate-id(.)"/>