mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
build: Fix API docs generation in VPATH build
XSLT allows for two ways of generating the output of transformation. Either implicit, which xsltproc prints to stdout and can be redirected to a file using -o file. Or explicit, which means the stylesheet contains <xsl:document> element which specifies where the output should be saved. This can be used for generating more files by a single run of xsltproc and -o directory/ can change the directory where the output files will be stored. devhelp.xsl is special in that it combines both options in one stylesheet, which doesn't work well with -o: xsltproc --nonet -o ./devhelp/ ./devhelp/devhelp.xsl ./libvirt-api.xml Outputs 4 *.html files into ./devhelp but then tries to write to ./devhelp/ as a file (hence the I/O error) rather than writing output to the fifth file devhelp/libvirt.devhelp. This patch modifies devhelp.xsl so that all files are generated using <xsl:document> element and -o directory/ can be used to override output directory where those files are saved.
This commit is contained in:
@@ -88,7 +88,10 @@ EXTRA_DIST= \
|
|||||||
sitemap.html.in \
|
sitemap.html.in \
|
||||||
todo.pl todo.cfg-example
|
todo.pl todo.cfg-example
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = $(dot_html) $(apihtml) $(devhelphtml)
|
MAINTAINERCLEANFILES = \
|
||||||
|
$(addprefix $(srcdir)/,$(dot_html)) \
|
||||||
|
$(addprefix $(srcdir)/,$(apihtml)) \
|
||||||
|
$(addprefix $(srcdir)/,$(devhelphtml))
|
||||||
|
|
||||||
all: web
|
all: web
|
||||||
|
|
||||||
@@ -146,19 +149,20 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
|
|||||||
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
|
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
|
||||||
-@if [ -x $(XSLTPROC) ] ; then \
|
-@if [ -x $(XSLTPROC) ] ; then \
|
||||||
echo "Rebuilding the HTML pages from the XML API" ; \
|
echo "Rebuilding the HTML pages from the XML API" ; \
|
||||||
$(XSLTPROC) --nonet $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi
|
$(XSLTPROC) --nonet -o $(srcdir)/ \
|
||||||
|
$(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi
|
||||||
-@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
|
-@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
|
||||||
if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
|
if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
|
||||||
> /dev/null ; then \
|
> /dev/null ; then \
|
||||||
echo "Validating the resulting XHTML pages" ; \
|
echo "Validating the resulting XHTML pages" ; \
|
||||||
SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
|
SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
|
||||||
$(XMLLINT) --catalogs --nonet --valid --noout html/*.html ; \
|
$(XMLLINT) --catalogs --nonet --valid --noout $(srcdir)/html/*.html ; \
|
||||||
else echo "missing XHTML1 DTD" ; fi ; fi
|
else echo "missing XHTML1 DTD" ; fi ; fi
|
||||||
|
|
||||||
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
|
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
|
||||||
-@echo Rebuilding devhelp files
|
-@echo Rebuilding devhelp files
|
||||||
-@if [ -x $(XSLTPROC) ] ; then \
|
-@if [ -x $(XSLTPROC) ] ; then \
|
||||||
$(XSLTPROC) --nonet -o devhelp/libvirt.devhelp \
|
$(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \
|
||||||
$(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
|
$(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
|
||||||
|
|
||||||
python_generated_files = \
|
python_generated_files = \
|
||||||
|
|||||||
@@ -13,6 +13,13 @@
|
|||||||
<!-- Build keys for all symbols -->
|
<!-- Build keys for all symbols -->
|
||||||
<xsl:key name="symbols" match="/api/symbols/*" use="@name"/>
|
<xsl:key name="symbols" match="/api/symbols/*" use="@name"/>
|
||||||
|
|
||||||
|
<xsl:template match="/">
|
||||||
|
<xsl:document xmlns="http://www.devhelp.net/book" href="libvirt.devhelp"
|
||||||
|
method="xml" encoding="UTF-8" indent="yes">
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:document>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="/api">
|
<xsl:template match="/api">
|
||||||
<book title="{@name} Reference Manual" link="index.html" author="" name="{@name}">
|
<book title="{@name} Reference Manual" link="index.html" author="" name="{@name}">
|
||||||
<xsl:apply-templates select="files"/>
|
<xsl:apply-templates select="files"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user