]> xenbits.xensource.com Git - libvirt.git/commitdiff
docs: Span cells if there's not doc text for enum val
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 22 Jul 2017 07:12:36 +0000 (09:12 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 24 Jul 2017 10:08:02 +0000 (12:08 +0200)
When generating HTML documentation we put enum values into a
table so that we can display the value's name, numerical value
and description (if it has one). Now the last part is problem. If
the value doesn't have description the table row has just two
cells and if it has one the row counts three cells. This makes
HTML engines render the description into very little space - for
instance see:

  html/libvirt-libvirt-domain.html#virDomainMemoryStatTags

We can avoid this problem if we let the cell that corresponds to
numerical value span over two cells if there's no description.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
docs/newapi.xsl

index 815c1b9d770c2e960289065b580a0fbd959c385f..9dd961507af47e6f75fdaf6fc5d3afbd827c5f52 100644 (file)
           <tr>
             <td><a name="{@name}"><xsl:value-of select="@name"/></a></td>
             <td><xsl:text> = </xsl:text></td>
-            <td><xsl:value-of select="@value"/></td>
-            <xsl:if test="@info != ''">
-              <td>
-                <div class="comment">
-                  <xsl:call-template name="dumptext">
-                    <xsl:with-param name="text" select="@info"/>
-                  </xsl:call-template>
-                </div>
-              </td>
-            </xsl:if>
+            <xsl:choose>
+              <xsl:when test="@info != ''">
+                <td><xsl:value-of select="@value"/></td>
+                <td>
+                  <div class="comment">
+                    <xsl:call-template name="dumptext">
+                      <xsl:with-param name="text" select="@info"/>
+                    </xsl:call-template>
+                  </div>
+                </td>
+              </xsl:when>
+              <xsl:otherwise>
+                <td colspan="2"><xsl:value-of select="@value"/></td>
+              </xsl:otherwise>
+            </xsl:choose>
           </tr>
         </xsl:for-each>
       </table>