From 6ef8a6d12d9f790d095cf34c8dc90e790bc974e0 Mon Sep 17 00:00:00 2001
From: Dan Williams
Date: Fri, 18 Feb 2011 11:25:48 -0600
Subject: [PATCH] docs: convert settings specification to docbook
---
docs/api/Makefile.am | 6 ++--
docs/api/generate-settings-spec.c | 58 +++++++++++++++++++++----------
docs/api/network-manager-docs.xml | 2 +-
3 files changed, 43 insertions(+), 23 deletions(-)
diff --git a/docs/api/Makefile.am b/docs/api/Makefile.am
index 76d63b256d..baf21123c3 100644
--- a/docs/api/Makefile.am
+++ b/docs/api/Makefile.am
@@ -34,15 +34,14 @@ OTHER_FILES= \
$(top_srcdir)/tools/doc-generator.xsl \
$(top_srcdir)/introspection/generic-types.xml
-GENERATED_FILES = spec.html settings-spec.html
+GENERATED_FILES = spec.html settings-spec.xml
spec.html: $(XMLS) $(OTHER_FILES)
$(XSLTPROC) $(top_srcdir)/tools/doc-generator.xsl $(top_srcdir)/introspection/all.xml > $@
cp $(builddir)/$@ $(builddir)/html/
-settings-spec.html: generate-settings-spec $(top_builddir)/libnm-util/libnm-util.la
+settings-spec.xml: generate-settings-spec $(top_builddir)/libnm-util/libnm-util.la
$(builddir)/generate-settings-spec $(builddir)/$@
- cp $(builddir)/$@ $(builddir)/html/
all: $(GENERATED_FILES)
@@ -63,6 +62,7 @@ MKTMPL_OPTIONS=
# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE)
content_files = \
version.xml \
+ settings-spec.xml \
$(NULL)
include $(top_srcdir)/gtk-doc.make
diff --git a/docs/api/generate-settings-spec.c b/docs/api/generate-settings-spec.c
index 5e229c12ff..09dee00a4c 100644
--- a/docs/api/generate-settings-spec.c
+++ b/docs/api/generate-settings-spec.c
@@ -96,7 +96,6 @@ static TypeNameElement name_map[] = {
static void
write_one_setting (FILE *f, SettingNewFunc func)
{
- int w;
NMSetting *s;
GParamSpec **props, **iter;
guint num;
@@ -104,13 +103,21 @@ write_one_setting (FILE *f, SettingNewFunc func)
s = func ();
/* write out section header */
- w = fprintf (f, "Setting name: '%s'
\n", nm_setting_get_name (s));
+ (void) fprintf (f,
+ "\n"
+ " %s setting\n"
+ " \n"
+ " \n"
+ " \n"
+ " Key Name\n"
+ " Value Type\n"
+ " Default Value\n"
+ " Value Description\n"
+ "
\n"
+ " \n"
+ " \n",
+ nm_setting_get_name (s));
- w = fprintf (f, "\n");
- w = fprintf (f, "| Key Name | \n");
- w = fprintf (f, "Value Type | \n");
- w = fprintf (f, "Default Value | \n");
- w = fprintf (f, "Value Description | \n");
props = g_object_class_list_properties (G_OBJECT_GET_CLASS (G_OBJECT (s)), &num);
for (iter = props; iter && *iter; iter++) {
const char *key_name, *value_type, *value_desc;
@@ -143,17 +150,23 @@ write_one_setting (FILE *f, SettingNewFunc func)
g_object_get (G_OBJECT (s), NM_SETTING_NAME, &default_value, NULL);
}
- w = fprintf (f, "\n");
- w = fprintf (f, "| %s | \n", key_name);
- w = fprintf (f, "%s | \n", value_type);
- w = fprintf (f, "%s | \n", default_value ? default_value : "");
- w = fprintf (f, "%s | \n", value_desc);
- w = fprintf (f, "
\n");
+ (void) fprintf (f,
+ " \n"
+ " %s\n"
+ " %s\n"
+ " %s\n"
+ " %s\n"
+ "
\n",
+ key_name, value_type, default_value ? default_value : "", value_desc);
g_free (default_value);
}
- w = fprintf (f, "
\n");
+ (void) fprintf (f,
+ " \n"
+ " \n"
+ "
\n");
+
g_object_unref (s);
}
@@ -162,7 +175,6 @@ main (int argc, char *argv[])
{
GError *error = NULL;
FILE *f;
- int w;
SettingNewFunc *fptr;
if (argc != 2) {
@@ -183,14 +195,22 @@ main (int argc, char *argv[])
_exit (3);
}
- w = fprintf (f, "\n\n");
- w = fprintf (f, "NetworkManager " PACKAGE_VERSION " Settings Specification");
- w = fprintf (f, "\n\n");
+ (void) fprintf (f,
+ "\n"
+ ""
+ "]>"
+ "\n"
+ " NetworkManager " PACKAGE_VERSION " Settings Specification\n"
+ " \n");
for (fptr = funcs; fptr && *fptr; fptr++)
write_one_setting (f, *fptr);
- w = fprintf (f, "\n\n");
+ (void) fprintf (f,
+ " \n"
+ "\n");
fclose (f);
_exit (0);
diff --git a/docs/api/network-manager-docs.xml b/docs/api/network-manager-docs.xml
index 92618f01fa..0099f54cb8 100644
--- a/docs/api/network-manager-docs.xml
+++ b/docs/api/network-manager-docs.xml
@@ -75,7 +75,7 @@
the "Connection".
-
+