Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/boostbook/xsl/macro.xsl @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 2.4 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                version="1.0">
4  <xsl:template match="macro" mode="synopsis">
5    <xsl:param name="indentation" select="0"/>
6
7    <xsl:text>&#10;</xsl:text>
8    <xsl:if 
9      test="not(local-name(preceding-sibling::*[position()=1])=local-name(.))">
10      <xsl:text>&#10;</xsl:text>
11    </xsl:if>
12    <xsl:call-template name="indent">
13      <xsl:with-param name="indentation" select="$indentation"/>
14    </xsl:call-template>
15    <xsl:call-template name="macro-synopsis">
16      <xsl:with-param name="link-type" select="'link'"/>
17    </xsl:call-template>
18  </xsl:template>
19
20  <xsl:template match="macro" mode="reference">
21    <xsl:call-template name="reference-documentation">
22      <xsl:with-param name="refname" select="@name"/>
23      <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
24      <xsl:with-param name="anchor">
25        <xsl:call-template name="generate.id"/>
26      </xsl:with-param>
27      <xsl:with-param name="name">
28        <xsl:text>Macro </xsl:text>
29        <xsl:call-template name="monospaced">
30          <xsl:with-param name="text" select="@name"/>
31        </xsl:call-template>
32      </xsl:with-param>
33      <xsl:with-param name="synopsis">
34        <xsl:call-template name="macro-synopsis">
35          <xsl:with-param name="link-type" select="'none'"/>
36        </xsl:call-template>
37      </xsl:with-param>
38      <xsl:with-param name="text">
39        <xsl:apply-templates select="description"/>
40      </xsl:with-param>
41    </xsl:call-template>
42  </xsl:template>
43
44  <xsl:template name="macro-synopsis">
45    <xsl:param name="link-type"/>
46
47    <xsl:call-template name="link-or-anchor">
48      <xsl:with-param name="to">
49        <xsl:call-template name="generate.id" select="."/>
50      </xsl:with-param>
51      <xsl:with-param name="text" select="@name"/>
52      <xsl:with-param name="link-type" select="$link-type"/>
53    </xsl:call-template>
54
55    <xsl:if test="@kind='functionlike'">
56      <xsl:text>(</xsl:text>
57      <xsl:for-each select="macro-parameter">
58        <xsl:if test="position() &gt; 1">
59          <xsl:text>, </xsl:text>
60        </xsl:if>
61        <xsl:value-of select="@name"/>
62      </xsl:for-each>
63      <xsl:text>)</xsl:text>
64    </xsl:if>
65  </xsl:template>
66
67  <xsl:template match="macro" mode="generate.id">
68    <xsl:value-of select="@name"/>
69  </xsl:template>
70</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.