We have plenty of generic typedefs (that basically just alias a
struct, or our popular virXXXPtr). Because we do not generate
HTML docs for it, the documentation is placed at random places,
e.g.: comment from virDomainPtr typedef ("a virDomainPtr is
pointer to a virDomain private structure ...") ends up after
virDomainProcessSignal enum block.
There are some less weird occurrences of this problem (e.g.
virBlkioParameterPtr), but yet - the typedef appears in TOC.
Therefore, generate a block for each typedef and put its
description there.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/newapi.xsl | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/docs/newapi.xsl b/docs/newapi.xsl
index a8797f800d..3ddcc27d96 100644
--- a/docs/newapi.xsl
+++ b/docs/newapi.xsl
@@ -324,6 +324,26 @@
</div>
</xsl:template>
+ <xsl:template match="typedef">
+ <xsl:variable name="name" select="string(@name)"/>
+ <xsl:variable name="type" select="string(@type)"/>
+ <h3><a id="{$name}"><code><xsl:value-of
select="$name"/></code></a></h3>
+ <div class="api">
+ <pre>
+ <span class="keyword">typedef</span><xsl:text>
</xsl:text>
+ <xsl:value-of select="$type"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>;</xsl:text>
+ </pre>
+ </div>
+ <div class="description">
+ <xsl:call-template name="formattext">
+ <xsl:with-param name="text" select="info"/>
+ </xsl:call-template>
+ </div>
+ </xsl:template>
+
<xsl:template match="struct" mode="toc">
<span class="keyword">typedef</span><xsl:text>
</xsl:text>
<span class="type"><xsl:value-of
select="@type"/></span>
--
2.39.3