mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 13:38:43 +02:00
docs: convert settings specification to docbook
This commit is contained in:
parent
65e6f27276
commit
6ef8a6d12d
3 changed files with 43 additions and 23 deletions
|
|
@ -34,15 +34,14 @@ OTHER_FILES= \
|
||||||
$(top_srcdir)/tools/doc-generator.xsl \
|
$(top_srcdir)/tools/doc-generator.xsl \
|
||||||
$(top_srcdir)/introspection/generic-types.xml
|
$(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)
|
spec.html: $(XMLS) $(OTHER_FILES)
|
||||||
$(XSLTPROC) $(top_srcdir)/tools/doc-generator.xsl $(top_srcdir)/introspection/all.xml > $@
|
$(XSLTPROC) $(top_srcdir)/tools/doc-generator.xsl $(top_srcdir)/introspection/all.xml > $@
|
||||||
cp $(builddir)/$@ $(builddir)/html/
|
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)/$@
|
$(builddir)/generate-settings-spec $(builddir)/$@
|
||||||
cp $(builddir)/$@ $(builddir)/html/
|
|
||||||
|
|
||||||
all: $(GENERATED_FILES)
|
all: $(GENERATED_FILES)
|
||||||
|
|
||||||
|
|
@ -63,6 +62,7 @@ MKTMPL_OPTIONS=
|
||||||
# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE)
|
# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE)
|
||||||
content_files = \
|
content_files = \
|
||||||
version.xml \
|
version.xml \
|
||||||
|
settings-spec.xml \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(top_srcdir)/gtk-doc.make
|
include $(top_srcdir)/gtk-doc.make
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,6 @@ static TypeNameElement name_map[] = {
|
||||||
static void
|
static void
|
||||||
write_one_setting (FILE *f, SettingNewFunc func)
|
write_one_setting (FILE *f, SettingNewFunc func)
|
||||||
{
|
{
|
||||||
int w;
|
|
||||||
NMSetting *s;
|
NMSetting *s;
|
||||||
GParamSpec **props, **iter;
|
GParamSpec **props, **iter;
|
||||||
guint num;
|
guint num;
|
||||||
|
|
@ -104,13 +103,21 @@ write_one_setting (FILE *f, SettingNewFunc func)
|
||||||
s = func ();
|
s = func ();
|
||||||
|
|
||||||
/* write out section header */
|
/* write out section header */
|
||||||
w = fprintf (f, "<p><h2>Setting name: '%s'</h2></p>\n", nm_setting_get_name (s));
|
(void) fprintf (f,
|
||||||
|
"<table>\n"
|
||||||
|
" <title>%s setting</title>\n"
|
||||||
|
" <tgroup cols=\"4\">\n"
|
||||||
|
" <thead>\n"
|
||||||
|
" <row>\n"
|
||||||
|
" <entry>Key Name</entry>\n"
|
||||||
|
" <entry>Value Type</entry>\n"
|
||||||
|
" <entry>Default Value</entry>\n"
|
||||||
|
" <entry>Value Description</entry>\n"
|
||||||
|
" </row>\n"
|
||||||
|
" </thead>\n"
|
||||||
|
" <tbody>\n",
|
||||||
|
nm_setting_get_name (s));
|
||||||
|
|
||||||
w = fprintf (f, "<table cellspacing=10 border=0 cellpadding=2>\n");
|
|
||||||
w = fprintf (f, "<th align=left>Key Name</th>\n");
|
|
||||||
w = fprintf (f, "<th align=left>Value Type</th>\n");
|
|
||||||
w = fprintf (f, "<th align=left>Default Value</th>\n");
|
|
||||||
w = fprintf (f, "<th align=left>Value Description</th>\n");
|
|
||||||
props = g_object_class_list_properties (G_OBJECT_GET_CLASS (G_OBJECT (s)), &num);
|
props = g_object_class_list_properties (G_OBJECT_GET_CLASS (G_OBJECT (s)), &num);
|
||||||
for (iter = props; iter && *iter; iter++) {
|
for (iter = props; iter && *iter; iter++) {
|
||||||
const char *key_name, *value_type, *value_desc;
|
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);
|
g_object_get (G_OBJECT (s), NM_SETTING_NAME, &default_value, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
w = fprintf (f, "<tr align=left valign=top>\n");
|
(void) fprintf (f,
|
||||||
w = fprintf (f, "<td><strong>%s</strong></td>\n", key_name);
|
" <row>\n"
|
||||||
w = fprintf (f, "<td>%s</td>\n", value_type);
|
" <entry>%s</entry>\n"
|
||||||
w = fprintf (f, "<td>%s</td>\n", default_value ? default_value : "");
|
" <entry>%s</entry>\n"
|
||||||
w = fprintf (f, "<td>%s</td>\n", value_desc);
|
" <entry>%s</entry>\n"
|
||||||
w = fprintf (f, "</tr>\n");
|
" <entry>%s</entry>\n"
|
||||||
|
" </row>\n",
|
||||||
|
key_name, value_type, default_value ? default_value : "", value_desc);
|
||||||
|
|
||||||
g_free (default_value);
|
g_free (default_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
w = fprintf (f, "</table><br/>\n");
|
(void) fprintf (f,
|
||||||
|
" </tbody>\n"
|
||||||
|
" </tgroup>\n"
|
||||||
|
"</table>\n");
|
||||||
|
|
||||||
g_object_unref (s);
|
g_object_unref (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -162,7 +175,6 @@ main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int w;
|
|
||||||
SettingNewFunc *fptr;
|
SettingNewFunc *fptr;
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
|
|
@ -183,14 +195,22 @@ main (int argc, char *argv[])
|
||||||
_exit (3);
|
_exit (3);
|
||||||
}
|
}
|
||||||
|
|
||||||
w = fprintf (f, "<html>\n<head>\n");
|
(void) fprintf (f,
|
||||||
w = fprintf (f, "<title>NetworkManager " PACKAGE_VERSION " Settings Specification</title>");
|
"<?xml version=\"1.0\"?>\n"
|
||||||
w = fprintf (f, "</head>\n<body>\n");
|
"<!DOCTYPE chapter PUBLIC \"-//OASIS//DTD DocBook XML V4.3//EN\"\n"
|
||||||
|
" \"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd\" [\n"
|
||||||
|
"<!ENTITY %% local.common.attrib \"xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'\">"
|
||||||
|
"]>"
|
||||||
|
"<section>\n"
|
||||||
|
" <title>NetworkManager " PACKAGE_VERSION " Settings Specification</title>\n"
|
||||||
|
" <para>\n");
|
||||||
|
|
||||||
for (fptr = funcs; fptr && *fptr; fptr++)
|
for (fptr = funcs; fptr && *fptr; fptr++)
|
||||||
write_one_setting (f, *fptr);
|
write_one_setting (f, *fptr);
|
||||||
|
|
||||||
w = fprintf (f, "</body>\n</html>\n");
|
(void) fprintf (f,
|
||||||
|
" </para>\n"
|
||||||
|
"</section>\n");
|
||||||
|
|
||||||
fclose (f);
|
fclose (f);
|
||||||
_exit (0);
|
_exit (0);
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
the "Connection".
|
the "Connection".
|
||||||
</para>
|
</para>
|
||||||
</partintro>
|
</partintro>
|
||||||
<ulink url="settings-spec.html"/>
|
<xi:include href="settings-spec.xml" />
|
||||||
</reference>
|
</reference>
|
||||||
|
|
||||||
<index>
|
<index>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue