]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
docs: Remove XSLT table of contents generator
authorPeter Krempa <pkrempa@redhat.com>
Wed, 17 May 2023 10:55:20 +0000 (12:55 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 18 May 2023 08:06:51 +0000 (10:06 +0200)
The only remaining page was 'hvsupport.html' which is generated by
'scripts/hvsupport.py'. The script already has all the data to generate
the table of contents internally so we can remove the whole complicated
template.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
docs/page.xsl
scripts/hvsupport.py

index 20b49d1afd4c48979d6e118632d1c42f8cfc7e90..a93f24fb091813e39fbd197250ff04d45ac76ed9 100644 (file)
     </xsl:copy>
   </xsl:template>
 
-
-  <xsl:template match="html:ul[@id='toc']" mode="content">
-    <xsl:call-template name="toc"/>
-  </xsl:template>
-
   <xsl:template match="html:div[@id='include']" mode="content">
     <xsl:call-template name="include"/>
   </xsl:template>
 
-  <xsl:template name="toc">
-    <ul>
-      <xsl:for-each select="/html:html/html:body/html:h2[count(html:a) = 1]">
-        <xsl:variable name="thish2" select="."/>
-        <li>
-          <a href="#{html:a/@id}"><xsl:value-of select="html:a/text()"/></a>
-          <xsl:if test="count(./following-sibling::html:h3[preceding-sibling::html:h2[1] = $thish2 and count(html:a) = 1]) > 0">
-            <ul>
-              <xsl:for-each select="./following-sibling::html:h3[preceding-sibling::html:h2[1] = $thish2 and count(html:a) = 1]">
-                <xsl:variable name="thish3" select="."/>
-                <li>
-                  <a href="#{html:a/@id}"><xsl:value-of select="html:a/text()"/></a>
-                  <xsl:if test="count(./following-sibling::html:h4[preceding-sibling::html:h3[1] = $thish3 and count(html:a) = 1]) > 0">
-                    <ul>
-                      <xsl:for-each select="./following-sibling::html:h4[preceding-sibling::html:h3[1] = $thish3 and count(html:a) = 1]">
-                        <xsl:variable name="thish4" select="."/>
-                        <li>
-                          <a href="#{html:a/@id}"><xsl:value-of select="html:a/text()"/></a>
-                          <xsl:if test="count(./following-sibling::html:h5[preceding-sibling::html:h4[1] = $thish4 and count(html:a) = 1]) > 0">
-                            <ul>
-                              <xsl:for-each select="./following-sibling::html:h5[preceding-sibling::html:h4[1] = $thish4 and count(html:a) = 1]">
-                                <xsl:variable name="thish5" select="."/>
-                                <li>
-                                  <a href="#{html:a/@id}"><xsl:value-of select="html:a/text()"/></a>
-                                  <xsl:if test="count(./following-sibling::html:h6[preceding-sibling::html:h5[1] = $thish5 and count(html:a) = 1]) > 0">
-                                    <ul>
-                                      <xsl:for-each select="./following-sibling::html:h6[preceding-sibling::html:h5[1] = $thish5 and count(html:a) = 1]">
-                                        <li>
-                                          <a href="#{html:a/@id}"><xsl:value-of select="html:a/text()"/></a>
-                                        </li>
-                                      </xsl:for-each>
-                                    </ul>
-                                  </xsl:if>
-                                </li>
-                              </xsl:for-each>
-                            </ul>
-                          </xsl:if>
-                        </li>
-                      </xsl:for-each>
-                    </ul>
-                  </xsl:if>
-                </li>
-              </xsl:for-each>
-            </ul>
-          </xsl:if>
-        </li>
-      </xsl:for-each>
-    </ul>
-  </xsl:template>
-
   <!-- This is the master page structure -->
   <xsl:template match="/" mode="page">
     <xsl:param name="pagesrc"/>
index 89fd0d1d946c32d1217f4fa6c409da7f3263ef8d..5ae93f66d3a2e1112951bffb83c2fd5894e0d6e0 100755 (executable)
@@ -423,7 +423,15 @@ print('''<?xml version="1.0" encoding="UTF-8"?>
 <body id="hvsupport">
 <h1>libvirt API support matrix</h1>
 
-<ul id="toc"></ul>
+<nav class="contents" id="contents">
+<ul>
+''')
+
+for grp in sorted(groups.keys()):
+    print("<li><p><a href=\"#%s\">%s</a></p></li>" % (grp, groupheaders[grp]))
+
+print('''</ul>
+</nav>
 
 <p>
 This page documents which libvirt calls work on