[PATCH 5/5] docs: xsl: Don't generate pointless index pages for qemu/admin/lxc API

Peter Krempa pkrempa at redhat.com
Thu Nov 3 12:33:15 UTC 2022


The index page only really makes sense for the top level directory. The
specific index files are unreferenced since last commit. Drop them.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 docs/html/meson.build |  3 +--
 docs/newapi.xsl       | 28 +++++++++++++++-------------
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/docs/html/meson.build b/docs/html/meson.build
index 83dee91ec5..b18a8ccb5f 100644
--- a/docs/html/meson.build
+++ b/docs/html/meson.build
@@ -28,6 +28,7 @@ index_api_gen = custom_target(
     xsltproc_prog, '--nonet', '-o', docs_builddir,
     '--stringparam', 'builddir', meson.project_build_root(),
     '--stringparam', 'timestamp', docs_timestamp,
+    '--stringparam', 'indexfile', 'index.html',
     '@INPUT@',
   ],
   install: true,
@@ -48,14 +49,12 @@ foreach name : [ 'admin', 'lxc', 'qemu' ]
       get_variable('docs_ at 0@_api_xml'.format(name)),
     ],
     output: [
-      'index- at 0@.html'.format(name),
       'libvirt-libvirt- at 0@.html'.format(name),
     ],
     command: [
       xsltproc_prog, '--nonet', '-o', docs_builddir,
       '--stringparam', 'builddir', meson.project_build_root(),
       '--stringparam', 'timestamp', docs_timestamp,
-      '--stringparam', 'indexfile', 'index- at 0@.html'.format(name),
       '@INPUT@',
     ],
     install: true,
diff --git a/docs/newapi.xsl b/docs/newapi.xsl
index 7b0085930f..3de603bb00 100644
--- a/docs/newapi.xsl
+++ b/docs/newapi.xsl
@@ -22,7 +22,7 @@
   <!-- Build keys for all symbols -->
   <xsl:key name="symbols" match="/api/symbols/*" use="@name"/>

-  <xsl:param name="indexfile" select="'index.html'"/>
+  <xsl:param name="indexfile" select="''"/>

   <!-- the target directory for the HTML output -->
   <xsl:variable name="htmldir">html</xsl:variable>
@@ -823,18 +823,20 @@

   <xsl:template match="/">
     <!-- Save the main index.html as well as a couple of copies -->
-    <xsl:variable name="mainpage">
-      <xsl:call-template name="mainpage"/>
-    </xsl:variable>
-    <xsl:document
-      href="{concat($htmldir, '/', $indexfile)}"
-      method="xml"
-      indent="yes"
-      encoding="UTF-8">
-      <xsl:apply-templates select="exsl:node-set($mainpage)" mode="page">
-        <xsl:with-param name="timestamp" select="$timestamp"/>
-      </xsl:apply-templates>
-    </xsl:document>
+    <xsl:if test="$indexfile != ''">
+      <xsl:variable name="mainpage">
+        <xsl:call-template name="mainpage"/>
+      </xsl:variable>
+      <xsl:document
+        href="{concat($htmldir, '/', $indexfile)}"
+        method="xml"
+        indent="yes"
+        encoding="UTF-8">
+        <xsl:apply-templates select="exsl:node-set($mainpage)" mode="page">
+          <xsl:with-param name="timestamp" select="$timestamp"/>
+        </xsl:apply-templates>
+      </xsl:document>
+    </xsl:if>

     <xsl:for-each select="/api/files/file">
       <xsl:variable name="subpage">
-- 
2.37.3



More information about the libvir-list mailing list