]> xenbits.xensource.com Git - libvirt.git/commitdiff
docs: generate API reference pages for admin, qemu & lxc libraries
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 20 Nov 2019 14:49:26 +0000 (14:49 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 22 Nov 2019 11:14:20 +0000 (11:14 +0000)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
docs/Makefile.am
docs/docs.html.in
docs/newapi.xsl

index a360b546d61408b50f8edfd017381fd80ff412e1..db9470ae07029c01c4f6e673be754399969b0d0d 100644 (file)
@@ -35,6 +35,10 @@ modules = \
        virterror \
        $(NULL)
 
+modules_admin = libvirt-admin
+modules_qemu = libvirt-qemu
+modules_lxc = libvirt-lxc
+
 apihtml = \
   html/index.html \
   $(apihtml_generated)
@@ -43,6 +47,30 @@ apihtml_generated = \
        $(addprefix html/libvirt-,$(addsuffix .html,$(modules))) \
        $(NULL)
 
+apiadminhtml = \
+  html/index-admin.html \
+  $(apiadminhtml_generated)
+
+apiadminhtml_generated = \
+       $(addprefix html/libvirt-,$(addsuffix .html,$(modules_admin))) \
+       $(NULL)
+
+apiqemuhtml = \
+  html/index-qemu.html \
+  $(apiqemuhtml_generated)
+
+apiqemuhtml_generated = \
+       $(addprefix html/libvirt-,$(addsuffix .html,$(modules_qemu))) \
+       $(NULL)
+
+apilxchtml = \
+  html/index-lxc.html \
+  $(apilxchtml_generated)
+
+apilxchtml_generated = \
+       $(addprefix html/libvirt-,$(addsuffix .html,$(modules_lxc))) \
+       $(NULL)
+
 apipng = \
   html/left.png \
   html/up.png \
@@ -50,7 +78,7 @@ apipng = \
   html/right.png
 
 apirefdir = $(HTML_DIR)/html
-apiref_DATA = $(apihtml) $(apipng)
+apiref_DATA = $(apihtml) $(apiadminhtml) $(apiqemuhtml) $(apilxchtml) $(apipng)
 
 css = \
   generic.css \
@@ -188,6 +216,9 @@ aclperms.htmlinc: $(top_srcdir)/src/access/viraccessperm.h \
 CLEANFILES = \
   $(dot_html) \
   $(apihtml) \
+  $(apiadminhtml) \
+  $(apiqemuhtml) \
+  $(apilxchtml) \
   $(internals_html) \
   $(kbase_html) \
   $(api_DATA) \
@@ -252,6 +283,9 @@ EXTRA_DIST += \
          || { rm $@ && exit 1; }
 
 $(apihtml_generated): html/index.html
+$(apiadminhtml_generated): html/index-admin.html
+$(apiqemuhtml_generated): html/index-qemu.html
+$(apilxchtml_generated): html/index-lxc.html
 
 html/index.html: libvirt-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP)
        $(AM_V_GEN)$(XSLTPROC) --nonet -o ./ \
@@ -260,6 +294,14 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP)
          $(srcdir)/newapi.xsl libvirt-api.xml && \
          $(XMLLINT) --nonet --noout html/*.html
 
+html/index-%.html: libvirt-%-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP)
+       $(AM_V_GEN)$(XSLTPROC) --nonet -o ./ \
+         --stringparam builddir '$(abs_top_builddir)' \
+         --stringparam timestamp $(timestamp) \
+         --stringparam indexfile $(@:html/%=%) \
+         $(srcdir)/newapi.xsl $< && \
+         $(XMLLINT) --nonet --noout html/*.html
+
 python_generated_files = \
                html/libvirt-libvirt-lxc.html \
                html/libvirt-libvirt-qemu.html \
index 6cf09f51bcc5d88d6dc0816e913a8d3e0750701c..268c16f3b3222149253286d04f152580ed55f4a6 100644 (file)
           <a href="html/libvirt-libvirt-secret.html">secret</a>,
           <a href="html/libvirt-libvirt-storage.html">storage</a>,
           <a href="html/libvirt-libvirt-stream.html">stream</a>
+          and
+          <a href="html/index-admin.html">admin</a>,
+          <a href="html/index-qemu.html">QEMU</a>,
+          <a href="html/index-lxc.html">LXC</a> libs
         </dd>
 
         <dt><a href="drivers.html">Drivers</a></dt>
index ca8c703d5ce69ceef9afe5e72eea8448b5f9dd90..dd6169397b58b6eadc75fa49987f8b609b2860a1 100644 (file)
@@ -23,6 +23,7 @@
   <xsl:key name="symbols" match="/api/symbols/*" use="@name"/>
 
   <xsl:param name="builddir" select="'..'"/>
+  <xsl:param name="indexfile" select="'index.html'"/>
 
   <!-- the target directory for the HTML output -->
   <xsl:variable name="htmldir">html</xsl:variable>
           <td><a accesskey="p" href="libvirt-{$previous/@name}.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td>
          <th align="left"><a href="libvirt-{$previous/@name}.html"><xsl:value-of select="$previous/@name"/></a></th>
        </xsl:if>
-        <td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td>
-       <th align="left"><a href="index.html">API documentation</a></th>
-        <td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td>
-        <th align="center"><a href="../index.html">The virtualization API</a></th>
+        <td><a accesskey="u" href="{$indexfile}"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td>
+       <th align="left"><a href="{$indexfile}">API documentation</a></th>
+        <td><a accesskey="h" href="../{$indexfile}"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td>
+        <th align="center"><a href="../{$indexfile}">The virtualization API</a></th>
         <xsl:if test="$next">
          <th align="right"><a href="libvirt-{$next/@name}.html"><xsl:value-of select="$next/@name"/></a></th>
           <td><a accesskey="n" href="libvirt-{$next/@name}.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td>
       <xsl:call-template name="mainpage"/>
     </xsl:variable>
     <xsl:document
-      href="{concat($htmldir, '/index.html')}"
+      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="pagename" select="concat($htmldir, '/index.html')"/>
+        <xsl:with-param name="pagename" select="concat($htmldir, '', $indexfile)"/>
         <xsl:with-param name="timestamp" select="$timestamp"/>
       </xsl:apply-templates>
     </xsl:document>