1 | <?xml version="1.0" encoding="utf-8"?> |
---|
2 | <!-- |
---|
3 | Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com> |
---|
4 | |
---|
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) |
---|
8 | --> |
---|
9 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
10 | version="1.0"> |
---|
11 | <xsl:template match="macro" mode="synopsis"> |
---|
12 | <xsl:param name="indentation" select="0"/> |
---|
13 | |
---|
14 | <xsl:text> </xsl:text> |
---|
15 | <xsl:if |
---|
16 | test="not(local-name(preceding-sibling::*[position()=1])=local-name(.))"> |
---|
17 | <xsl:text> </xsl:text> |
---|
18 | </xsl:if> |
---|
19 | <xsl:call-template name="indent"> |
---|
20 | <xsl:with-param name="indentation" select="$indentation"/> |
---|
21 | </xsl:call-template> |
---|
22 | <xsl:call-template name="macro-synopsis"> |
---|
23 | <xsl:with-param name="link-type" select="'link'"/> |
---|
24 | </xsl:call-template> |
---|
25 | </xsl:template> |
---|
26 | |
---|
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"/> |
---|
33 | </xsl:with-param> |
---|
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"/> |
---|
38 | </xsl:call-template> |
---|
39 | </xsl:with-param> |
---|
40 | <xsl:with-param name="synopsis"> |
---|
41 | <xsl:call-template name="macro-synopsis"> |
---|
42 | <xsl:with-param name="link-type" select="'none'"/> |
---|
43 | </xsl:call-template> |
---|
44 | </xsl:with-param> |
---|
45 | <xsl:with-param name="text"> |
---|
46 | <xsl:apply-templates select="description"/> |
---|
47 | </xsl:with-param> |
---|
48 | </xsl:call-template> |
---|
49 | </xsl:template> |
---|
50 | |
---|
51 | <xsl:template name="macro-synopsis"> |
---|
52 | <xsl:param name="link-type"/> |
---|
53 | |
---|
54 | <xsl:call-template name="link-or-anchor"> |
---|
55 | <xsl:with-param name="to"> |
---|
56 | <xsl:call-template name="generate.id" select="."/> |
---|
57 | </xsl:with-param> |
---|
58 | <xsl:with-param name="text" select="@name"/> |
---|
59 | <xsl:with-param name="link-type" select="$link-type"/> |
---|
60 | </xsl:call-template> |
---|
61 | |
---|
62 | <xsl:if test="@kind='functionlike'"> |
---|
63 | <xsl:text>(</xsl:text> |
---|
64 | <xsl:for-each select="macro-parameter"> |
---|
65 | <xsl:if test="position() > 1"> |
---|
66 | <xsl:text>, </xsl:text> |
---|
67 | </xsl:if> |
---|
68 | <xsl:value-of select="@name"/> |
---|
69 | </xsl:for-each> |
---|
70 | <xsl:text>)</xsl:text> |
---|
71 | </xsl:if> |
---|
72 | </xsl:template> |
---|
73 | |
---|
74 | <xsl:template match="macro" mode="generate.id"> |
---|
75 | <xsl:value-of select="@name"/> |
---|
76 | </xsl:template> |
---|
77 | </xsl:stylesheet> |
---|