]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: docs/html: generate libvirt API documentation
authorPavel Hrdina <phrdina@redhat.com>
Thu, 18 Jun 2020 00:28:33 +0000 (02:28 +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 [new file with mode: 0644]
docs/meson.build

index 7398628b6c0576daabfd67ce4cd0f4650f8387d7..7c30d75b99721392bc8dd74dd412cfb8174e16f9 100644 (file)
 ## License along with this library.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-modules = \
-       libvirt-common \
-       libvirt-domain \
-       libvirt-domain-checkpoint \
-       libvirt-domain-snapshot \
-       libvirt-event \
-       libvirt-host \
-       libvirt-interface \
-       libvirt-network \
-       libvirt-nodedev \
-       libvirt-nwfilter \
-       libvirt-secret \
-       libvirt-storage \
-       libvirt-stream \
-       virterror \
-       $(NULL)
-
 modules_admin = libvirt-admin
 modules_qemu = libvirt-qemu
 modules_lxc = libvirt-lxc
@@ -47,14 +30,6 @@ vpathhack:
          test -e $$dir || ln -s $(srcdir)/$$dir $$dir ; \
        done
 
-apihtml = \
-  html/index.html \
-  $(apihtml_generated)
-
-apihtml_generated = \
-       $(addprefix html/libvirt-,$(addsuffix .html,$(modules))) \
-       $(NULL)
-
 apiadminhtml = \
   html/index-admin.html \
   $(apiadminhtml_generated)
@@ -79,14 +54,8 @@ apilxchtml_generated = \
        $(addprefix html/libvirt-,$(addsuffix .html,$(modules_lxc))) \
        $(NULL)
 
-apipng = \
-  html/left.png \
-  html/up.png \
-  html/home.png \
-  html/right.png
-
 apirefdir = $(HTML_DIR)/html
-apiref_DATA = $(apihtml) $(apiadminhtml) $(apiqemuhtml) $(apilxchtml) $(apipng)
+apiref_DATA = $(apihtml) $(apiadminhtml) $(apiqemuhtml) $(apilxchtml)
 
 javascript = \
   js/main.js \
@@ -271,12 +240,6 @@ $(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) \
-         $(srcdir)/newapi.xsl libvirt-api.xml
-
 html/index-%.html: libvirt-%-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP)
        $(AM_V_GEN)$(XSLTPROC) --nonet -o ./ \
          --stringparam builddir '$(abs_top_builddir)' \
diff --git a/docs/html/meson.build b/docs/html/meson.build
new file mode 100644 (file)
index 0000000..67356c7
--- /dev/null
@@ -0,0 +1,44 @@
+apipng = [
+  'home.png',
+  'left.png',
+  'right.png',
+  'up.png',
+]
+
+install_data(apipng, install_dir: docs_html_dir / 'html')
+
+custom_target(
+  'index-api',
+  input: [
+    newapi_xsl,
+    docs_api_xml,
+  ],
+  output: [
+    'index.html',
+    'libvirt-libvirt-common.html',
+    'libvirt-libvirt-domain.html',
+    'libvirt-libvirt-domain-checkpoint.html',
+    'libvirt-libvirt-domain-snapshot.html',
+    'libvirt-libvirt-event.html',
+    'libvirt-libvirt-host.html',
+    'libvirt-libvirt-interface.html',
+    'libvirt-libvirt-network.html',
+    'libvirt-libvirt-nodedev.html',
+    'libvirt-libvirt-nwfilter.html',
+    'libvirt-libvirt-secret.html',
+    'libvirt-libvirt-storage.html',
+    'libvirt-libvirt-stream.html',
+    'libvirt-virterror.html',
+  ],
+  command: [
+    xsltproc_prog, '--nonet', '-o', docs_builddir,
+    '--stringparam', 'builddir', meson.build_root(),
+    '--stringparam', 'timestamp', docs_timestamp,
+    '@INPUT@',
+  ],
+  install: true,
+  install_dir: docs_html_dir / 'html',
+  depend_files: [
+    page_xsl,
+  ],
+)
index 7c741041c8c3bdfa476436743381653f787b4bdf..d9cb845a8f4ad61ad54a7b0faa4304dd8a45961c 100644 (file)
@@ -1,5 +1,8 @@
 docs_html_dir = docdir / 'html'
 
+# xsltproc requires that the -o path ends with '/'
+docs_builddir = meson.current_build_dir() / ''
+
 docs_assets = [
   'android-chrome-192x192.png',
   'android-chrome-256x256.png',
@@ -289,6 +292,7 @@ foreach data : docs_html_in_gen
 endforeach
 
 subdir('fonts')
+subdir('html')
 
 
 # This hack enables us to view the web pages