Hi,

One issue against viking's code is the lack of documentation. IMHO, one
of the best way to easily improve the code documentation is... to
extract it.

So, I decided to add some support for gtk-doc. This is fully
experimental. I'm interested to know the impact of this patch on
viking's dependencies. For me, all goes right, but I do not remember if
I needed to install something or not.

I'm interested in any feedback about this. Thanks in advance.

http://www.gtk.org/gtk-doc/
From: Guilhem Bonnefille <guilhem.bonnefi...@gmail.com>
Subject: [PATCH] Add reference doc


Signed-off-by: Guilhem Bonnefille <guilhem.bonnefi...@gmail.com>

---
 configure.ac              |    2 +
 doc/reference/Makefile.am |   90 +++++++++++++++++++++++++++++++++++++++++++++
 doc/reference/README      |    9 ++++
 3 files changed, 101 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index bb282ee..22e369f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,6 +6,7 @@ AC_INIT(viking, 1.1)
 AM_INIT_AUTOMAKE()
 dnl AC_CONFIG_SRCDIR([src/main.c])
 AC_CONFIG_HEADERS([src/config.h])
+GTK_DOC_CHECK(1.0)
 
 # Checks for programs.
 AC_PROG_CC
@@ -328,6 +329,7 @@ AC_CONFIG_FILES([Makefile
                  test/Makefile
                  help/Makefile
                  doc/Makefile
+                 doc/reference/Makefile
                  doc/examples/Makefile
                  doc/dev/Makefile])
 AC_OUTPUT([
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
new file mode 100644
index 0000000..d589b82
--- /dev/null
+++ b/doc/reference/Makefile.am
@@ -0,0 +1,90 @@
+## Process this file with automake to produce Makefile.in
+
+# We require automake 1.6 at least.
+AUTOMAKE_OPTIONS = 1.6
+
+# This is a blank Makefile.am for using gtk-doc.
+# Copy this to your project's API docs directory and modify the variables to
+# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
+# of using the various options.
+
+# The name of the module, e.g. 'glib'.
+DOC_MODULE=viking
+
+# The top-level SGML file. You can change this if you want to.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
+
+# The directory containing the source code. Relative to $(srcdir).
+# gtk-doc will search all .c & .h files beneath here for inline comments
+# documenting the functions and macros.
+# e.g. DOC_SOURCE_DIR=../../../gtk
+DOC_SOURCE_DIR=../../src
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS=
+
+# Extra options to supply to gtkdoc-scan.
+# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
+SCAN_OPTIONS=--rebuild-types
+
+# Extra options to supply to gtkdoc-mkdb.
+# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
+MKDB_OPTIONS=--sgml-mode --output-format=xml
+
+# Extra options to supply to gtkdoc-mktmpl
+# e.g. MKTMPL_OPTIONS=--only-section-tmpl
+MKTMPL_OPTIONS=
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
+FIXXREF_OPTIONS=
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
+# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
+HFILE_GLOB=
+CFILE_GLOB=
+
+# Header files to ignore when scanning.
+# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
+IGNORE_HFILES=
+
+# Images to copy into HTML directory.
+# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
+HTML_IMAGES=
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
+content_files=
+
+# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
+# These files must be listed here *and* in content_files
+# e.g. expand_content_files=running.sgml
+expand_content_files=
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+# Only needed if you are using gtkdoc-scangobj to dynamically query widget
+# signals and properties.
+# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
+# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
+INCLUDES        = @PACKAGE_CFLAGS@ @EXPAT_CFLAGS@ @LIBCURL_CPPFLAGS@
+GTKDOC_LIBS     =  -L$(top_srcdir)/src -lviking -L$(top_srcdir)/src/icons -licons @PACKAGE_LIBS@ @EXPAT_LIBS@ @LIBCURL@ 
+if REALTIME_GPS_TRACKING
+GTKDOC_LIBS     += -lgps
+endif
+
+# This includes the standard gtk-doc make rules, copied by gtkdocize.
+include $(top_srcdir)/gtk-doc.make
+
+# Other files to distribute
+# e.g. EXTRA_DIST += version.xml.in
+EXTRA_DIST +=
+
+# Files not to distribute
+# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
+# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
+#DISTCLEANFILES +=
+
+# Comment this out if you want your docs-status tested during 'make check'
+#TESTS = $(GTKDOC_CHECK)
+
diff --git a/doc/reference/README b/doc/reference/README
new file mode 100644
index 0000000..ab5a4af
--- /dev/null
+++ b/doc/reference/README
@@ -0,0 +1,9 @@
+In order to activate reference documentation, you have to specify
+the following configure command line:
+$ ./configure --enable-gtk-doc --enable-gtk-doc-html
+
+Then, cd to doc/reference and launch make command.
+
+(This directory is not recursively make when launching make from top
+directory. So, this avoid spending time in reference documentation
+computation when not really needed.)
-- 
tg: (c85f7bc..) t/doc/reference (depends on: master)
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to