[PATCH 5/7] docs: html: Add a manually written index page

Peter Krempa pkrempa at redhat.com
Wed May 17 15:28:19 UTC 2023


The auto-generated index contains only references to one run of the
generator but we in total run it 4 times missing the admin, lxc, and
qemu specific apis.

Rewrite it manually so that we can drop the generator for it.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 docs/html/index.rst   | 65 +++++++++++++++++++++++++++++++++++++++++++
 docs/html/meson.build | 46 ++++++++++++++++++++++++++++--
 2 files changed, 109 insertions(+), 2 deletions(-)
 create mode 100644 docs/html/index.rst

diff --git a/docs/html/index.rst b/docs/html/index.rst
new file mode 100644
index 0000000000..7977ec1f05
--- /dev/null
+++ b/docs/html/index.rst
@@ -0,0 +1,65 @@
+============================
+Reference Manual for libvirt
+============================
+
+.. contents::
+
+Main libvirt APIs
+-----------------
+
+`libvirt-common <libvirt-libvirt-common.html>`__
+    common macros and enums for the libvirt and libvirt-admin library
+
+`libvirt-domain-checkpoint <libvirt-libvirt-domain-checkpoint.html>`__
+    APIs for management of domain checkpoints
+
+`libvirt-domain-snapshot <libvirt-libvirt-domain-snapshot.html>`__
+    APIs for management of domain snapshots
+
+`libvirt-domain <libvirt-libvirt-domain.html>`__
+    APIs for management of domains
+
+`libvirt-event <libvirt-libvirt-event.html>`__
+    APIs for management of events
+
+`libvirt-host <libvirt-libvirt-host.html>`__
+    APIs for management of hosts
+
+`libvirt-interface <libvirt-libvirt-interface.html>`__
+    APIs for management of interfaces
+
+`libvirt-network <libvirt-libvirt-network.html>`__
+    APIs for management of networks
+
+`libvirt-nodedev <libvirt-libvirt-nodedev.html>`__
+    APIs for management of nodedevs
+
+`libvirt-nwfilter <libvirt-libvirt-nwfilter.html>`__
+    APIs for management of nwfilters
+
+`libvirt-secret <libvirt-libvirt-secret.html>`__
+    APIs for management of secrets
+
+`libvirt-storage <libvirt-libvirt-storage.html>`__
+    APIs for management of storage pools and volumes
+
+`libvirt-stream <libvirt-libvirt-stream.html>`__
+    APIs for management of streams
+
+Error handling
+--------------
+
+`virterror <libvirt-virterror.html>`__
+    error handling interfaces for the libvirt library
+
+Special specific APIs
+---------------------
+
+`admin interface <libvirt-libvirt-admin.html>`__
+    APIs for management of the libvirt daemons
+
+`qemu driver <libvirt-libvirt-qemu.html>`__
+   qemu-driver specific APIs
+
+`lxc driver <libvirt-libvirt-lxc.html>`__
+   lxc-driver specific APIs
diff --git a/docs/html/meson.build b/docs/html/meson.build
index b18a8ccb5f..4d8d44d783 100644
--- a/docs/html/meson.build
+++ b/docs/html/meson.build
@@ -8,7 +8,6 @@ index_api_gen = custom_target(
     docs_api_xml,
   ],
   output: [
-    'index.html',
     'libvirt-libvirt-common.html',
     'libvirt-libvirt-domain.html',
     'libvirt-libvirt-domain-checkpoint.html',
@@ -28,7 +27,6 @@ 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,
@@ -77,6 +75,50 @@ foreach file : docs_html_gen
   install_web_files += '@0@:@1@'.format(file.full_path(), docs_html_dir / 'html')
 endforeach

+html_xslt_gen_install_dir = docs_html_dir / 'html'
+html_xslt_gen = []
+
+html_xslt_gen += {
+  'name': 'index',
+  'file': docs_rst2html5_gen.process('index.rst'),
+  'source': 'docs' / 'html' / 'index.rst',
+  'href_base': '../',
+  }
+
+# --- begin of XSLT processing ---
+
+foreach data : html_xslt_gen
+  html_filename = data['name'] + '.html'
+
+  html_file = custom_target(
+    html_filename,
+    input: data.get('file', data['name'] + '.html.in'),
+    output: html_filename,
+    command: [
+      xsltproc_prog,
+      '--stringparam', 'pagesrc', data.get('source', ''),
+      '--stringparam', 'builddir', meson.project_build_root(),
+      '--stringparam', 'timestamp', docs_timestamp,
+      '--stringparam', 'href_base', data.get('href_base', ''),
+      '--nonet',
+      site_xsl,
+      '@INPUT@',
+    ],
+    depends: data.get('depends', []),
+    depend_files: [ page_xsl ],
+    capture: true,
+    install: true,
+    install_dir: html_xslt_gen_install_dir,
+  )
+
+  install_web_deps += html_file
+  install_web_files += html_file.full_path() + ':' + html_xslt_gen_install_dir
+endforeach
+
+html_xslt_gen = []
+
+# --- end of XSLT processing ---
+
 test(
   'check-html',
   xmllint_prog,
-- 
2.40.1



More information about the libvir-list mailing list