summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2008-05-20 11:26:03 +0000
committerMarc-André Lureau <marcandre.lureau@gmail.com>2009-02-13 00:01:41 +0200
commit39748c0ec29b3bc78ac463154effcbfbcf227d45 (patch)
treecd2be797d6c6cc2f6da01f4997b2b5e45ed2ebe5 /tools
parent3290a1647be4e9a2cc81606972998efe4aaf2772 (diff)
Add support for tp:since and tp:deprecated (at the same levels as tp:docstring)
Diffstat (limited to 'tools')
-rw-r--r--tools/doc-generator.xsl52
1 files changed, 50 insertions, 2 deletions
diff --git a/tools/doc-generator.xsl b/tools/doc-generator.xsl
index 09194bb..c5df138 100644
--- a/tools/doc-generator.xsl
+++ b/tools/doc-generator.xsl
@@ -43,6 +43,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<xsl:apply-templates select="text() | html:* | tp:rationale" mode="html"/>
</xsl:template>
+ <xsl:template match="tp:since">
+ <p class="since">Since:
+ <xsl:apply-templates select="node()" mode="html"/></p>
+ </xsl:template>
+
+ <xsl:template match="tp:deprecated">
+ <p class="deprecated">
+ Deprecated: <xsl:apply-templates select="node()" mode="html"/></p>
+ </xsl:template>
+
<xsl:template match="tp:rationale" mode="html">
<div xmlns="http://www.w3.org/1999/xhtml" class="rationale">
<xsl:apply-templates select="node()" mode="html"/>
@@ -94,6 +104,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<xsl:template match="tp:error">
<h2 xmlns="http://www.w3.org/1999/xhtml"><a name="{concat(../@namespace, '.', translate(@name, ' ', ''))}"></a><xsl:value-of select="concat(../@namespace, '.', translate(@name, ' ', ''))"/></h2>
<xsl:apply-templates select="tp:docstring"/>
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
</xsl:template>
<xsl:template match="/tp:spec/tp:copyright">
@@ -131,6 +143,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</xsl:if>
<xsl:apply-templates select="tp:docstring" />
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
<xsl:choose>
<xsl:when test="method">
@@ -194,6 +208,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</a>
</h3>
<xsl:apply-templates select="tp:docstring" />
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
<dl xmlns="http://www.w3.org/1999/xhtml">
<xsl:variable name="value-prefix">
<xsl:choose>
@@ -209,7 +225,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<dt xmlns="http://www.w3.org/1999/xhtml"><code><xsl:value-of select="concat($value-prefix, '_', @suffix)"/> = <xsl:value-of select="@value"/></code></dt>
<xsl:choose>
<xsl:when test="tp:docstring">
- <dd xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates select="tp:docstring" /></dd>
+ <dd xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates select="tp:docstring" />
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
+ </dd>
</xsl:when>
<xsl:otherwise>
<dd xmlns="http://www.w3.org/1999/xhtml">(Undocumented)</dd>
@@ -226,6 +246,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</a>
</h3>
<xsl:apply-templates select="tp:docstring" />
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
<dl xmlns="http://www.w3.org/1999/xhtml">
<xsl:variable name="value-prefix">
<xsl:choose>
@@ -241,7 +263,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<dt xmlns="http://www.w3.org/1999/xhtml"><code><xsl:value-of select="concat($value-prefix, '_', @suffix)"/> = <xsl:value-of select="@value"/></code></dt>
<xsl:choose>
<xsl:when test="tp:docstring">
- <dd xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates select="tp:docstring" /></dd>
+ <dd xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates select="tp:docstring" />
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
+ </dd>
</xsl:when>
<xsl:otherwise>
<dd xmlns="http://www.w3.org/1999/xhtml">(Undocumented)</dd>
@@ -278,6 +304,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</dt>
<dd xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates select="tp:docstring"/>
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
</dd>
</xsl:template>
@@ -290,6 +318,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</dt>
<dd xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates select="tp:docstring"/>
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
</dd>
</xsl:template>
@@ -340,6 +370,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</h3>
<div class="docstring">
<xsl:apply-templates select="tp:docstring"/>
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
</div>
</div>
</xsl:template>
@@ -385,6 +417,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</h3>
<div class="docstring">
<xsl:apply-templates select="tp:docstring"/>
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
</div>
<xsl:choose>
<xsl:when test="string(@array-name) != ''">
@@ -429,6 +463,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</h3>
<div xmlns="http://www.w3.org/1999/xhtml" class="docstring">
<xsl:apply-templates select="tp:docstring" />
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
</div>
<xsl:if test="arg[@direction='in']">
@@ -568,8 +604,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
)</h3>
+
<div xmlns="http://www.w3.org/1999/xhtml" class="docstring">
<xsl:apply-templates select="tp:docstring"/>
+ <xsl:apply-templates select="tp:since"/>
+ <xsl:apply-templates select="tp:deprecated"/>
</div>
<xsl:if test="arg">
@@ -698,6 +737,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
padding-left: 0.5em;
}
+ .since {
+ color: #006600;
+ background: #ffffff;
+ }
+ .deprecated {
+ color: #ff0000;
+ background: #ffffff;
+ }
+
</style>
</head>
<body>