[PATCH 2/3] docs: newapi.xsl: Generate overall docs for enums too

Michal Privoznik posted 3 patches 1 year ago
[PATCH 2/3] docs: newapi.xsl: Generate overall docs for enums too
Posted by Michal Privoznik 1 year ago
There are/can be overall docs for enums (e.g.
virDomainModificationImpact) not just individual values. But
these never make it into the generated HTML which is a bit
unfortunate as they can contain valuable information for users.

Generate a block with overall enum documentation, just like we do
for functions.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 docs/newapi.xsl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/newapi.xsl b/docs/newapi.xsl
index 3ddcc27d96..56bed1ef6a 100644
--- a/docs/newapi.xsl
+++ b/docs/newapi.xsl
@@ -286,6 +286,11 @@
   <xsl:template match="typedef[@type = 'enum']">
     <xsl:variable name="name" select="string(@name)"/>
     <h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
+    <div class="description">
+    <xsl:call-template name="formattext">
+      <xsl:with-param name="text" select="info"/>
+    </xsl:call-template>
+    </div>
     <div class="api">
       <pre>
         <span class="keyword">enum</span><xsl:text> </xsl:text>
-- 
2.39.3
Re: [PATCH 2/3] docs: newapi.xsl: Generate overall docs for enums too
Posted by Peter Krempa 1 year ago
On Wed, May 24, 2023 at 18:21:06 +0200, Michal Privoznik wrote:
> There are/can be overall docs for enums (e.g.
> virDomainModificationImpact) not just individual values. But
> these never make it into the generated HTML which is a bit
> unfortunate as they can contain valuable information for users.
> 
> Generate a block with overall enum documentation, just like we do
> for functions.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  docs/newapi.xsl | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>