docs: Remove XSLT table of contents generator

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>
This commit is contained in:
Peter Krempa 2023-05-17 12:55:20 +02:00
parent 5ff58a0ce7
commit ef01df4a5c
2 changed files with 9 additions and 56 deletions

View File

@ -15,65 +15,10 @@
</xsl:copy> </xsl:copy>
</xsl:template> </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:template match="html:div[@id='include']" mode="content">
<xsl:call-template name="include"/> <xsl:call-template name="include"/>
</xsl:template> </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 --> <!-- This is the master page structure -->
<xsl:template match="/" mode="page"> <xsl:template match="/" mode="page">
<xsl:param name="pagesrc"/> <xsl:param name="pagesrc"/>

View File

@ -423,7 +423,15 @@ print('''<?xml version="1.0" encoding="UTF-8"?>
<body id="hvsupport"> <body id="hvsupport">
<h1>libvirt API support matrix</h1> <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> <p>
This page documents which libvirt calls work on This page documents which libvirt calls work on