[libvirt PATCH 329/351] meson: docs/html: generate libvirt API documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 docs/Makefile.am      | 39 +-------------------------------------
 docs/html/meson.build | 44 +++++++++++++++++++++++++++++++++++++++++++
 docs/meson.build      |  4 ++++
 3 files changed, 49 insertions(+), 38 deletions(-)
 create mode 100644 docs/html/meson.build

diff --git a/docs/Makefile.am b/docs/Makefile.am
index 7398628b6c0..7c30d75b997 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -16,23 +16,6 @@
 ## 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
index 00000000000..67356c7d657
--- /dev/null
+++ b/docs/html/meson.build
@@ -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,
+  ],
+)
diff --git a/docs/meson.build b/docs/meson.build
index 7dc2bbdc42a..d6944ad642a 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -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',
@@ -282,6 +285,7 @@ foreach data : docs_html_in_gen
 endforeach
 
 subdir('fonts')
+subdir('html')
 
 
 # This hack enables us to view the web pages
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux