Skip to content

Commit 22aa68b

Browse files
committed
docs: Add D-Bus API reference generation
Closes: #244
1 parent 08c86c6 commit 22aa68b

7 files changed

+154
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ thd_dbus_interface.h
3838
.project
3939
*thermald.service
4040
.dirstamp
41+
version.xml

Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include $(GLIB_MAKEFILE)
22

3-
SUBDIRS = data
3+
SUBDIRS = . docs data
44

55
ACLOCAL_AMFLAGS =
66

autogen.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ olddir=`pwd`
66

77
cd "$srcdir"
88

9-
autoreconf --install --verbose
9+
aclocal --install || exit 1
10+
gtkdocize --copy --flavour no-tmpl || exit 1
11+
autoreconf --install --verbose || exit 1
1012

1113
cd "$olddir"
1214

configure.ac

+7
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ m4_define([td_version],
88
AC_INIT([thermald], [td_version], [], [thermald])
99
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
1010

11+
AC_CONFIG_MACRO_DIR([m4])
1112
AC_CONFIG_AUX_DIR(build-aux)
1213
AC_CONFIG_HEADERS([config.h])
1314

1415
AM_INIT_AUTOMAKE([1.11 foreign no-define subdir-objects])
1516
AM_MAINTAINER_MODE([enable])
1617

18+
GTK_DOC_CHECK([1.11],[--flavour no-tmpl])
19+
1720
AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
1821
if test -n "$with_dbus_sys_dir" ; then
1922
DBUS_SYS_DIR="$with_dbus_sys_dir"
@@ -71,6 +74,8 @@ AC_SUBST(GLIB_LIBS)
7174

7275
PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.4)
7376

77+
AC_PATH_PROG([GDBUS_CODEGEN],[gdbus-codegen])
78+
7479
AC_PROG_CC
7580
AC_PROG_CPP
7681
AC_PROG_CXX
@@ -102,6 +107,8 @@ done
102107
], [AC_MSG_ERROR([AX_CHECK_COMPILE_FLAG not found, you'll need to install autoconf-archive])])
103108

104109
AC_CONFIG_FILES([Makefile
110+
docs/Makefile
111+
docs/version.xml
105112
data/Makefile])
106113

107114
AC_OUTPUT

docs/Makefile.am

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
NULL =
2+
3+
AUTOMAKE_OPTIONS = 1.7
4+
5+
# The name of the module.
6+
DOC_MODULE=thermal_daemon
7+
8+
# The top-level SGML file.
9+
DOC_MAIN_SGML_FILE=thermal_daemon-docs.xml
10+
11+
# Extra options to supply to gtkdoc-scan
12+
SCAN_OPTIONS= \
13+
--ignore-headers="config.h thd*.h thermald.h acpi_*.h" \
14+
--rebuild-sections --rebuild-types
15+
16+
# The directory containing the source code. Relative to $(srcdir)
17+
DOC_SOURCE_DIR=
18+
19+
# Used for dependencies
20+
HFILE_GLOB=
21+
CFILE_GLOB=
22+
23+
# Headers to ignore
24+
IGNORE_HFILES= \
25+
$(NULL)
26+
27+
GTKDOC_LIBS =
28+
29+
# Extra options to supply to gtkdoc-mkdb
30+
MKDB_OPTIONS=--sgml-mode --output-format=xml
31+
32+
docs-thd_dbus_interface.xml: $(top_srcdir)/src/thd_dbus_interface.xml
33+
$(AM_V_GEN)$(GDBUS_CODEGEN) --generate-docbook=docs $<
34+
35+
# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE)
36+
content_files = \
37+
version.xml \
38+
docs-thd_dbus_interface.xml \
39+
$(NULL)
40+
41+
# FIXME
42+
MAINTAINERCLEANFILES = \
43+
*~ \
44+
Makefile.in \
45+
thermal_daemon.types \
46+
thermal_daemon-*.txt \
47+
$(NULL)
48+
49+
include $(top_srcdir)/gtk-doc.make
50+
51+
EXTRA_DIST = thermal_daemon-docs.xml
52+
53+
CLEANFILES += \
54+
docs-thermal_daemon.xml \
55+
$(NULL)
56+
57+
# Version information for marking the documentation
58+
EXTRA_DIST += version.xml.in
59+
60+
-include $(top_srcdir)/git.mk

docs/thermal_daemon-docs.xml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3+
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
4+
<!ENTITY version SYSTEM "version.xml">
5+
]>
6+
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
7+
<bookinfo>
8+
<title>Thermal Daemon Reference Manual</title>
9+
<releaseinfo>Version &version;</releaseinfo>
10+
<authorgroup>
11+
<author>
12+
<firstname>Bastien</firstname>
13+
<surname>Nocera</surname>
14+
<affiliation>
15+
<address>
16+
<email>hadess@hadess.net</email>
17+
</address>
18+
</affiliation>
19+
</author>
20+
</authorgroup>
21+
22+
<copyright>
23+
<year>2020</year>
24+
<holder>Red Hat, Inc.</holder>
25+
</copyright>
26+
27+
<legalnotice>
28+
<para>
29+
Permission is granted to copy, distribute and/or modify this
30+
document under the terms of the <citetitle>GNU Free
31+
Documentation License</citetitle>, Version 1.1 or any later
32+
version published by the Free Software Foundation with no
33+
Invariant Sections, no Front-Cover Texts, and no Back-Cover
34+
Texts. You may obtain a copy of the <citetitle>GNU Free
35+
Documentation License</citetitle> from the Free Software
36+
Foundation by visiting <ulink type="http"
37+
url="http://www.fsf.org">their Web site</ulink> or by writing
38+
to:
39+
40+
<address>
41+
The Free Software Foundation, Inc.,
42+
<street>59 Temple Place</street> - Suite 330,
43+
<city>Boston</city>, <state>MA</state> <postcode>02111-1307</postcode>,
44+
<country>USA</country>
45+
</address>
46+
</para>
47+
48+
<para>
49+
Many of the names used by companies to distinguish their
50+
products and services are claimed as trademarks. Where those
51+
names appear in any GNOME documentation, and those trademarks
52+
are made aware to the members of the GNOME Documentation
53+
Project, the names have been printed in caps or initial caps.
54+
</para>
55+
</legalnotice>
56+
</bookinfo>
57+
58+
<reference id="ref-dbus">
59+
<title>D-Bus API Reference</title>
60+
<partintro>
61+
<para>
62+
This part documents the D-Bus interface used to access the
63+
Thermal Daemon service.
64+
</para>
65+
</partintro>
66+
<xi:include href="docs-org.freedesktop.thermald.xml"/>
67+
</reference>
68+
69+
<index>
70+
<title>Index</title>
71+
</index>
72+
73+
<!-- License -->
74+
75+
<appendix id="license">
76+
<title>License</title>
77+
<para>
78+
<programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../COPYING" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
79+
</para>
80+
</appendix>
81+
</book>

docs/version.xml.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@VERSION@

0 commit comments

Comments
 (0)