[gxml] Simplified documentation generation using --enable-docs
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Simplified documentation generation using --enable-docs
- Date: Mon, 29 Aug 2016 00:29:29 +0000 (UTC)
commit 191c81aee6899ce3463b94f307a5b51c5c29b2ca
Author: Daniel Espinosa <esodan gmail com>
Date: Sun Aug 28 19:27:15 2016 -0500
Simplified documentation generation using --enable-docs
Now to generate documentation you need to use --enable-docs
any tool used to generate documentation found is used
automatically.
If no Valadoc is found fails to configure.
configure.ac | 108 ++++++++++++++------------------------------
docs/Makefile.am | 2 +-
docs/valadoc/Makefile.am | 6 +-
gxml/DomCollections.vala | 6 +-
gxml/GXmlHashMapAttr.vala | 6 ++-
gxml/Makefile.am | 2 +-
gxml/Node.vala | 4 +-
7 files changed, 49 insertions(+), 85 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 265f371..cff92f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,95 +144,57 @@ PKG_CHECK_MODULES(GIO, $GIO_MODULES)
GOBJECT_INTROSPECTION_CHECK([1.32.0])
# Documentation with Valadoc
+AC_PATH_PROG(YELP_BUILD, [yelp-build], [no])
+AC_PATH_PROG([VALADOC], [valadoc], [no])
+
AC_ARG_ENABLE([docs],
AS_HELP_STRING([--enable-docs],[Enable documentation generation]),
[enable_docs=$enableval], [enable_docs=no])
AM_CONDITIONAL([ENABLE_DOCS], [test x$enable_docs = xyes])
have_valadoc=no
-if test x$enable_docs = xyes; then
- # make sure the library is new enough and the program exists
- AC_PATH_PROG([VALADOC], [valadoc], [no])
- if test "x$VALADOC" = "xno";
- then
- AC_MSG_RESULT([valadoc documentation not build because not found])
- else
- VAPIDIR=`$PKG_CONFIG --variable=vapidir libvala-$LIBVALA_REQUIRED`
- have_valadoc="yes"
- AC_SUBST(VALADOC)
- fi
+if test x$enable_docs = xyes -a "x$VALADOC" = "xno"; then
+ AC_MSG_RESULT([Required documentation but no valadoc found])
+ else
+ have_valadoc="yes"
fi
AM_CONDITIONAL([HAVE_VALADOC], [test x$have_valadoc = xyes])
-
-AC_ARG_ENABLE([devhelp-docs],
- AS_HELP_STRING([--enable-devhelp-docs],[Enable DevHelp documentation generation]),
- [enable_devhelp_docs=$enableval], [enable_devhelp_docs=no])
-
-AC_ARG_ENABLE([gtk-docs],
- AS_HELP_STRING([--enable-gtk-docs],[Enable gtk-doc documentation generation]),
- [enable_gtk_docs=$enableval], [enable_gtk_docs=no])
-
-AC_ARG_ENABLE([gir-docs],
- AS_HELP_STRING([--enable-gir-docs],[Enable documented GIR generation]),
- [enable_gir_docs=$enableval], [enable_gir_docs=no])
-
-have_gtkdoc=no
-if test x$enable_gtk_docs = xyes; then
+build_gtkdoc=no
+PKG_CHECK_MODULES([GTKDOC], gtk-doc,[
+ found_gtk_docs=yes
+ ],[
+ found_gtk_docs=no
+ ])
+if test x$enable_docs = xyes; then
if test x$have_valadoc = xyes; then
- PKG_CHECK_MODULES([GTKDOC], gtk-doc)
- have_gtkdoc=yes
- else
- AC_MSG_ERROR([valadoc is required, to generate gtk-doc documentation. Use --enable-valadoc])
- fi
-fi
-
-
-if test x$enable_devhelp_docs = xyes; then
- if test x$have_valadoc = xno -o x$have_gtkdoc = xno; then
- AC_MSG_ERROR([valadoc and gtk-doc is required, to generate devhelp documentation. Use --enable-valadoc
and --enable-gtk-docs])
- fi
-fi
-
-if test x$enable_gir_docs = xyes; then
- if test x$have_valadoc = xno; then
- AC_MSG_ERROR([valadoc is required, to generate GIR documentation. Use --enable-valadoc and
--enable-gtk-docs])
+ if test $found_gtk_docs=xyes; then
+ build_gtkdoc=yes
+ else
+ build_gtkdoc=no
+ fi
fi
fi
+AM_CONDITIONAL([BUILD_GTK_DOCS], [test "x$build_gtkdoc" = "xyes"])
-dnl Find yelp-build program
-enable_mallard_doc="no"
-girdocs=no
-devhelpdocs=no
-gtkdocs=no
+build_devhelp=no
+build_mallard_doc=no
+build_gir_doc=no
if test x$enable_docs = xyes; then
- AC_PATH_PROG(YELP_BUILD, [yelp-build], [no])
- if test "x$YELP_BUILD" = "xno";
- then
- AC_MSG_RESULT([Mallard documentation not build because yelp-build has not been found])
- else
+ if test x$have_valadoc = "xyes"; then
+ if test x$YELP_BUILD != "xno"; then
+ build_devhelp=yes
YELP_HELP_INIT
- AC_SUBST(YELP_BUILD)
- enable_mallard_doc="yes"
- fi
- if test x$enable_devhelp_docs = xyes; then
- devhelpdocs=yes
- fi
- if test x$enable_gtk_docs = xyes; then
- gtkdocs=yes
- fi
- if test x$enable_gir_docs = xyes; then
- if test x$found_introspection = xyes; then
- girdocs=yes
+ build_mallard_doc=yes;
else
- girdocs="no, use --enable-introspection"
+ build_devhelp=no;
fi
fi
fi
-AM_CONDITIONAL(ENABLE_MALLARD_DOC, [test "$enable_mallard_doc" = "yes"])
-AM_CONDITIONAL([ENABLE_GIR_DOCS], [test "x$girdocs" = "xyes"])
-AM_CONDITIONAL([ENABLE_DEVHELP_DOCS], [test "x$devhelpdocs" = "xyes"])
-AM_CONDITIONAL([ENABLE_GTK_DOCS], [test "x$gtkdocs" = "xyes"])
+AM_CONDITIONAL([BUILD_DEVHELP_DOCS], [test "x$build_devhelp" = "xyes"])
+AM_CONDITIONAL(BUILD_MALLARD_DOCS, [test "$build_mallard_doc" = "yes"])
+# This conditional is not set, because a bug to create documented GIR
+AM_CONDITIONAL(BUILD_GIR_DOCS, [test "$build_gir_doc" = "yes"])
debug=no
AC_ARG_ENABLE(debug,
@@ -321,9 +283,9 @@ echo " Configuration summary for GXml-$GXML_VERSION"
echo " Installation prefix: $prefix"
echo " GObject Introspection: $found_introspection"
echo " Documentation: ${enable_docs}"
-echo " DevHelp Doc: `if test x${devhelpdocs} = xyes; then echo yes; else echo no; fi`"
-echo " Gtk-Doc: `if test x${gtkdocs} = xyes; then echo yes; else echo no; fi`"
-echo " GIR Documented: $girdocs"
+echo " DevHelp Docs: ${build_devhelp}"
+echo " Gtk-Docs: ${build_gtkdoc}"
+echo " Mallard Docs: ${build_mallard_doc}"
echo " Enable Performance Test: $performance"
echo " Debug: $debug"
echo " Platform: $host"
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 3c31eb7..d9d850c 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS=
-if ENABLE_MALLARD_DOC
+if BUILD_MALLARD_DOCS
SUBDIRS += mallard
endif
diff --git a/docs/valadoc/Makefile.am b/docs/valadoc/Makefile.am
index cdb1e9e..2b7757d 100644
--- a/docs/valadoc/Makefile.am
+++ b/docs/valadoc/Makefile.am
@@ -1,14 +1,14 @@
SUBDIRS=
-if ENABLE_DEVHELP_DOCS
+if BUILD_DEVHELP_DOCS
SUBDIRS+=devhelp
endif
-if ENABLE_GTK_DOCS
+if BUILD_GTK_DOCS
SUBDIRS+=gtk-doc
endif
-if ENABLE_GIR_DOCS
+if BUILD_GIR_DOCS
SUBDIRS+=gir-docs
endif
diff --git a/gxml/DomCollections.vala b/gxml/DomCollections.vala
index 770c203..261b474 100644
--- a/gxml/DomCollections.vala
+++ b/gxml/DomCollections.vala
@@ -149,9 +149,9 @@ public interface GXml.DomTokenList : GLib.Object, Gee.BidirList<string> {
public abstract void add (string[] tokens) throws GLib.Error;
public abstract void remove (string[] tokens);
/**
- * If @auto is true, adds @token if not present and removing if it is, @force value
- * is taken in account. If @auto is false, then @force is considered; if true adds
- * @token, if false removes it.
+ * If @auto is true, adds @param token if not present and removing if it is, @force value
+ * is taken in account. If @param auto is false, then @force is considered; if true adds
+ * @param token, if false removes it.
*/
public abstract bool toggle (string token, bool force = false, bool auto = true) throws GLib.Error;
public abstract string to_string ();
diff --git a/gxml/GXmlHashMapAttr.vala b/gxml/GXmlHashMapAttr.vala
index 0c0642f..cf3b00d 100644
--- a/gxml/GXmlHashMapAttr.vala
+++ b/gxml/GXmlHashMapAttr.vala
@@ -217,11 +217,13 @@ public class GXml.GHashMapAttr : Gee.AbstractMap<string,GXml.Node>,
}
/**
* Search items in this collection and return the object found at
- * @index, but not order is warrantied
+ * index, but not order is warrantied
*
- * If @index is greather than collection size, then last element found
+ * If index is greather than collection size, then last element found
* is returned. This function falls back to first element found on any
* issue.
+ *
+ * @param index of required {@link DomNode}
*/
public DomNode? item (ulong index) {
int i = 0;
diff --git a/gxml/Makefile.am b/gxml/Makefile.am
index e4e0fae..1de2fac 100644
--- a/gxml/Makefile.am
+++ b/gxml/Makefile.am
@@ -155,7 +155,7 @@ AM_CFLAGS = \
$(NULL)
-if ENABLE_DEVHELP_DOCS
+if BUILD_DEVHELP_DOCS
AM_VALAFLAGS += \
--vapi-comments
diff --git a/gxml/Node.vala b/gxml/Node.vala
index b8db74f..269af41 100644
--- a/gxml/Node.vala
+++ b/gxml/Node.vala
@@ -157,10 +157,10 @@ public interface GXml.Node : Object
/**
* Copy a {@link GXml.Node} relaying on {@link GXml.Document} to other {@link GXml.Node}.
*
- * @node could belongs from different {@link GXml.Document}, while source is a node
+ * {@link node} could belongs from different {@link GXml.Document}, while source is a node
* belonging to given document.
*
- * Just {@link GXml.Element} objects are supported. For attributes, use
+ * Only {@link GXml.Element} objects are supported. For attributes, use
* {@link GXml.Element.set_attr} method, passing source's name and value as arguments.
*
* @param doc a {@link GXml.Document} owning destiny node
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]