meson: docs/html: generate admin,lxc and qemu API documentation

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-06-18 02:29:04 +02:00
parent db9a02ccf0
commit 91c1d8e047
2 changed files with 26 additions and 43 deletions

View File

@ -16,10 +16,6 @@
## 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

View 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