]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: docs/html: generate admin,lxc and qemu API documentation
authorPavel Hrdina <phrdina@redhat.com>
Thu, 18 Jun 2020 00:29:04 +0000 (02:29 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:06 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
docs/Makefile.am
docs/html/meson.build

index 7c30d75b99721392bc8dd74dd412cfb8174e16f9..9e3479f010ef9badfdf8a1d9d1b121dd7438208f 100644 (file)
 ## License along with this library.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-modules_admin = libvirt-admin
-modules_qemu = libvirt-qemu
-modules_lxc = libvirt-lxc
-
 all: vpathhack
 
 # This hack enables us to view the web pages
@@ -30,33 +26,6 @@ vpathhack:
          test -e $$dir || ln -s $(srcdir)/$$dir $$dir ; \
        done
 
-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)
-
-apirefdir = $(HTML_DIR)/html
-apiref_DATA = $(apihtml) $(apiadminhtml) $(apiqemuhtml) $(apilxchtml)
-
 javascript = \
   js/main.js \
   $(NULL)
@@ -235,18 +204,6 @@ manpages/%.html.in: manpages/%.rst
             -e 's|RUNSTATEDIR|$(runstatedir)|g' | \
          $(RST2HTML) --strict > $@ || { 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 ./ \
-         --stringparam builddir '$(abs_top_builddir)' \
-         --stringparam timestamp $(timestamp) \
-         --stringparam indexfile $(@:html/%=%) \
-         $(srcdir)/newapi.xsl $<
-
 check-html:
        $(XMLLINT) --nonet --noout html/*.html
 
index 67356c7d657644fc5cc5abe7c6be5bde309338da..7be5abe5fe546be704813c6b166792f3558b1b11 100644 (file)
@@ -42,3 +42,29 @@ custom_target(
     page_xsl,
   ],
 )
+
+foreach name : [ 'admin', 'lxc', 'qemu' ]
+  custom_target(
+    'index-@0@-api'.format(name),
+    input: [
+      newapi_xsl,
+      get_variable('docs_@0@_api_xml'.format(name)),
+    ],
+    output: [
+      'index-@0@.html'.format(name),
+      'libvirt-libvirt-@0@.html'.format(name),
+    ],
+    command: [
+      xsltproc_prog, '--nonet', '-o', docs_builddir,
+      '--stringparam', 'builddir', meson.build_root(),
+      '--stringparam', 'timestamp', docs_timestamp,
+      '--stringparam', 'indexfile', 'index-@0@.html'.format(name),
+      '@INPUT@',
+    ],
+    install: true,
+    install_dir: docs_html_dir / 'html',
+    depend_files: [
+      page_xsl,
+    ],
+  )
+endforeach