mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
docs/kbase/meson.build: Use template code for XSLT processing
Replace the reimplementation of the XSLT processing custom target with an identical copy form docs/meson.build and a comment to keep them in sync. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
80c927b6f9
commit
9ce9d794f5
@ -17,35 +17,51 @@ docs_kbase_files = [
|
||||
'virtiofs',
|
||||
]
|
||||
|
||||
html_xslt_gen_xslt = subsite_xsl
|
||||
html_xslt_gen_install_dir = docs_html_dir / 'kbase'
|
||||
html_xslt_gen = []
|
||||
|
||||
foreach name : docs_kbase_files
|
||||
rst_file = '@0@.rst'.format(name)
|
||||
html_file = '@0@.html'.format(name)
|
||||
|
||||
html_in = docs_rst2html_gen.process(rst_file)
|
||||
html_xslt_gen += {
|
||||
'name': name,
|
||||
'file': docs_rst2html_gen.process(rst_file),
|
||||
'source': 'docs/kbase' / rst_file,
|
||||
}
|
||||
endforeach
|
||||
|
||||
out_file = custom_target(
|
||||
html_file,
|
||||
input: html_in,
|
||||
output: html_file,
|
||||
# keep the XSLT processing code block in sync with docs/meson.build
|
||||
|
||||
# --- 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: [
|
||||
meson_python_prog,
|
||||
python3_prog.path(),
|
||||
meson_html_gen_prog.path(),
|
||||
xsltproc_prog.path(),
|
||||
xmllint_prog.path(),
|
||||
meson.build_root(),
|
||||
docs_timestamp,
|
||||
subsite_xsl,
|
||||
xsltproc_prog,
|
||||
'--stringparam', 'pagesrc', data.get('source', ''),
|
||||
'--stringparam', 'builddir', meson.build_root(),
|
||||
'--stringparam', 'timestamp', docs_timestamp,
|
||||
'--nonet',
|
||||
html_xslt_gen_xslt,
|
||||
'@INPUT@',
|
||||
'@OUTPUT@',
|
||||
'docs/kbase' / rst_file,
|
||||
],
|
||||
depends: [ aclperms_gen ],
|
||||
depends: data.get('depends', []),
|
||||
depend_files: [ page_xsl ],
|
||||
capture: true,
|
||||
install: true,
|
||||
install_dir: docs_html_dir / 'kbase',
|
||||
install_dir: html_xslt_gen_install_dir,
|
||||
)
|
||||
|
||||
install_web_deps += out_file
|
||||
install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir / 'kbase')
|
||||
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 ---
|
||||
|
Loading…
x
Reference in New Issue
Block a user