[PATCH v2 2/5] doc: generate server documentation from XML too
Peter Hutterer
peter.hutterer at who-t.net
Wed Apr 3 18:28:58 PDT 2013
Same as WaylandClientAPI.xml we now also generate WaylandServerAPI.xml for
publication. Most of this hunk is just adding a client/ or server/ into the
xml path to keep the two separate.
The change in wayland.doxygen now causes a standard doxygen call to not
generate anything - what is generated is specified through the options
passed by make.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Changes to v1:
- rebased to master
doc/doxygen/Makefile.am | 19 +++++++++++++++----
doc/doxygen/wayland.doxygen.in | 5 ++---
doc/publican/Makefile.am | 33 ++++++++++++++++++++++++---------
doc/publican/doxygen-to-publican.xsl | 14 ++++++++------
doc/publican/sources/Library.xml | 1 +
5 files changed, 50 insertions(+), 22 deletions(-)
diff --git a/doc/doxygen/Makefile.am b/doc/doxygen/Makefile.am
index 40dcecb..e41c790 100644
--- a/doc/doxygen/Makefile.am
+++ b/doc/doxygen/Makefile.am
@@ -1,5 +1,5 @@
-noinst_DATA = xml/index.xml
+noinst_DATA = xml/client/index.xml xml/server/index.xml
dist_noinst_DATA = wayland.doxygen.in
scanned_src_files_client = \
@@ -61,12 +61,23 @@ server_MANPAGES = \
man3_MANS= $(client_MANPAGES) $(server_MANPAGES)
-xml/index.xml: $(scanned_src_files_client) wayland.doxygen
- doxygen wayland.doxygen
+xml/client/index.xml: $(scanned_src_files_client) wayland.doxygen
+ $(AM_V_GEN)$(MKDIR_P) xml/client
+ (cat wayland.doxygen; \
+ echo "GENERATE_XML=YES"; \
+ echo "XML_OUTPUT=xml/client"; \
+ echo "INPUT= $(scanned_src_files_client)"; \
+ ) | doxygen -
+xml/server/index.xml: $(scanned_src_files_server) wayland.doxygen
+ $(AM_V_GEN)$(MKDIR_P) xml/server
+ (cat wayland.doxygen; \
+ echo "GENERATE_XML=YES"; \
+ echo "XML_OUTPUT=xml/server"; \
+ echo "INPUT= $(scanned_src_files_server)"; \
+ ) | doxygen -
doxygen.man: $(scanned_src_files_client) $(scanned_src_files_server)
(cat wayland.doxygen; \
- echo "GENERATE_XML=NO"; \
echo "GENERATE_MAN=YES"; \
echo "MAN_OUTPUT=man"; \
echo "JAVADOC_AUTOBRIEF=NO"; \
diff --git a/doc/doxygen/wayland.doxygen.in b/doc/doxygen/wayland.doxygen.in
index e700e3d..7a2ac62 100644
--- a/doc/doxygen/wayland.doxygen.in
+++ b/doc/doxygen/wayland.doxygen.in
@@ -642,8 +642,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = @top_srcdir@/src/wayland-client.c \
- @top_srcdir@/src/wayland-client.h
+INPUT =
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -1364,7 +1363,7 @@ MAN_LINKS = YES
# generate an XML file that captures the structure of
# the code including all documentation.
-GENERATE_XML = YES
+GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
diff --git a/doc/publican/Makefile.am b/doc/publican/Makefile.am
index cba1655..202633e 100644
--- a/doc/publican/Makefile.am
+++ b/doc/publican/Makefile.am
@@ -14,6 +14,8 @@
# * ProtocolInterfaces.xml, same as above, uses a different XSLT
# * WaylandClientAPI.xml is generated from the doxygen output and saved in
# $(builddir)/en-US
+# * WaylandServerAPI.xml is generated from the doxygen output and saved in
+# $(builddir)/en-US
# * run Publican on en-US
publican_sources = \
$(srcdir)/sources/Wayland.ent \
@@ -40,7 +42,7 @@ pubdir = $(docdir)/Wayland/en-US
publican_targets = $(publican_sources:$(srcdir)/sources%=$(builddir)/en-US%) \
en-US/ProtocolSpec.xml en-US/ProtocolInterfaces.xml \
- en-US/WaylandClientAPI.xml
+ en-US/WaylandClientAPI.xml en-US/WaylandServerAPI.xml
# The Protocol.xml is purely generated and required before running publican
en-US/ProtocolSpec.xml: $(top_srcdir)/protocol/wayland.xml $(srcdir)/protocol-to-docbook.xsl
@@ -59,17 +61,30 @@ en-US/ProtocolInterfaces.xml: $(top_srcdir)/protocol/wayland.xml $(srcdir)/proto
# * use doxygen's combine.xslt to merge the xml files into one single file
# * move wayland-client_8h.xml back to its original location
# * transform the combined XML file into docbook format
-en-US/WaylandClientAPI.xml: $(top_builddir)/doc/doxygen/xml/index.xml $(srcdir)/doxygen-to-publican.xsl
+en-US/WaylandClientAPI.xml: $(top_builddir)/doc/doxygen/xml/client/index.xml $(srcdir)/doxygen-to-publican.xsl
$(AM_V_GEN)$(MKDIR_P) en-US/images
+ $(AM_V_GEN)mv $(top_builddir)/doc/doxygen/xml/client/wayland-client_8h.xml \
+ $(top_builddir)/doc/doxygen/xml/
+ $(AM_V_GEN)$(XSLTPROC) $(top_builddir)/doc/doxygen/xml/client/combine.xslt \
+ $(top_builddir)/doc/doxygen/xml/client/index.xml > \
+ $(top_builddir)/doc/doxygen/xml/client/clientAPI.xml
$(AM_V_GEN)mv $(top_builddir)/doc/doxygen/xml/wayland-client_8h.xml \
- $(top_builddir)/doc/doxygen/
- $(AM_V_GEN)$(XSLTPROC) $(top_builddir)/doc/doxygen/xml/combine.xslt \
- $(top_builddir)/doc/doxygen/xml/index.xml > \
- $(top_builddir)/doc/doxygen/xml/clientAPI.xml
- $(AM_V_GEN)mv $(top_builddir)/doc/doxygen/wayland-client_8h.xml \
+ $(top_builddir)/doc/doxygen/xml/client
+ $(AM_V_GEN)$(XSLTPROC) --stringparam which Client $(srcdir)/doxygen-to-publican.xsl \
+ $(top_builddir)/doc/doxygen/xml/client/clientAPI.xml > en-US/WaylandClientAPI.xml
+
+# WaylandServerAPI.xml: see WaylandClientAPI.xml
+en-US/WaylandServerAPI.xml: $(top_builddir)/doc/doxygen/xml/server/index.xml $(srcdir)/doxygen-to-publican.xsl
+ $(AM_V_GEN)$(MKDIR_P) en-US/images
+ $(AM_V_GEN)mv $(top_builddir)/doc/doxygen/xml/server/wayland-server_8h.xml \
$(top_builddir)/doc/doxygen/xml
- $(AM_V_GEN)$(XSLTPROC) $(srcdir)/doxygen-to-publican.xsl \
- $(top_builddir)/doc/doxygen/xml/clientAPI.xml > en-US/WaylandClientAPI.xml
+ $(AM_V_GEN)$(XSLTPROC) $(top_builddir)/doc/doxygen/xml/server/combine.xslt \
+ $(top_builddir)/doc/doxygen/xml/server/index.xml > \
+ $(top_builddir)/doc/doxygen/xml/server/serverAPI.xml
+ $(AM_V_GEN)mv $(top_builddir)/doc/doxygen/xml/wayland-server_8h.xml \
+ $(top_builddir)/doc/doxygen/xml/server
+ $(AM_V_GEN)$(XSLTPROC) --stringparam which Server $(srcdir)/doxygen-to-publican.xsl \
+ $(top_builddir)/doc/doxygen/xml/server/serverAPI.xml > en-US/WaylandServerAPI.xml
# Copy the sources source files into en-US destination
# This is required for out-of-source-tree build as publican does not allow us
diff --git a/doc/publican/doxygen-to-publican.xsl b/doc/publican/doxygen-to-publican.xsl
index 160b124..2bd677e 100644
--- a/doc/publican/doxygen-to-publican.xsl
+++ b/doc/publican/doxygen-to-publican.xsl
@@ -1,6 +1,7 @@
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
+<xsl:param name="which" />
<xsl:template match="/">
<!-- insert docbook's DOCTYPE blurb -->
@@ -11,12 +12,13 @@
]>
]]></xsl:text>
- <section id="sect-Library-Client">
- <title>Client API</title>
- <para>Following is the Wayland library classes for clients
- (<emphasis>libwayland-client</emphasis>). Note that most of the
- procedures are related with IPC, which is the main responsibility of
- the library.
+ <section id="sect-Library-$which">
+ <xsl:attribute name="id">sect-Library-<xsl:value-of select="$which"/></xsl:attribute>
+ <title><xsl:value-of select="$which"/> API</title>
+ <para>Following is the Wayland library classes for the <xsl:value-of select="$which"/>
+ (<emphasis>libwayland-<xsl:value-of select="translate($which, 'SC', 'sc')"/></emphasis>).
+ Note that most of the procedures are related with IPC, which is the main responsibility of
+ the library.
</para>
<xsl:if test="/doxygen/compounddef[@kind='class']">
diff --git a/doc/publican/sources/Library.xml b/doc/publican/sources/Library.xml
index ab325d6..77408cc 100644
--- a/doc/publican/sources/Library.xml
+++ b/doc/publican/sources/Library.xml
@@ -6,4 +6,5 @@
<chapter id="chap-Library">
<title>Wayland Library</title>
<xi:include href="WaylandClientAPI.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ <xi:include href="WaylandServerAPI.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</chapter>
--
1.8.1.4
More information about the wayland-devel
mailing list