[buoh/gtkdoc] Add code documentation



commit 67f40a5de169c05902937f69fdac9a0767b4b8df
Author: Jan Tojnar <jtojnar gmail com>
Date:   Fri Sep 14 06:58:29 2018 +0200

    Add code documentation

 default.nix                          |  1 +
 docs/reference/buoh/buoh-docs.xml.in | 33 +++++++++++++++++++++++++++++++++
 docs/reference/buoh/meson.build      | 22 ++++++++++++++++++++++
 meson.build                          |  2 ++
 meson_options.txt                    |  6 ++++++
 5 files changed, 64 insertions(+)
---
diff --git a/default.nix b/default.nix
index 35b7cdf..689333c 100644
--- a/default.nix
+++ b/default.nix
@@ -41,6 +41,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     meson ninja pkgconfig gettext python3 xvfb_run wrapGAppsHook
+    gtk-doc docbook_xsl
   ];
 
   buildInputs = [
diff --git a/docs/reference/buoh/buoh-docs.xml.in b/docs/reference/buoh/buoh-docs.xml.in
new file mode 100644
index 0000000..2923679
--- /dev/null
+++ b/docs/reference/buoh/buoh-docs.xml.in
@@ -0,0 +1,33 @@
+<book id="index" version="5.0" xmlns="http://docbook.org/ns/docbook"; 
xmlns:xi="http://www.w3.org/2001/XInclude"; xmlns:xlink="http://www.w3.org/1999/xlink";>
+  <bookinfo>
+    <title>Buoh Reference Manual</title>
+    <releaseinfo>for Buoh @BUOH_VERSION@</releaseinfo>
+  </bookinfo>
+  <chapter id="buoh">
+    <title>Buoh Overview</title>
+    <para>Buoh is a comic strip viewer for GNOME.</para>
+  </chapter>
+  <chapter id="buoh-data-types">
+    <title>Buoh Data Types</title>
+    <xi:include xlink:href="xml/buoh-add-comic-dialog.xml"/>
+    <xi:include xlink:href="xml/buoh-comic-cache.xml"/>
+    <xi:include xlink:href="xml/buoh-comic-list.xml"/>
+    <xi:include xlink:href="xml/buoh-comic-loader.xml"/>
+    <xi:include xlink:href="xml/buoh-comic-manager-date.xml"/>
+    <xi:include xlink:href="xml/buoh-comic-manager.xml"/>
+    <xi:include xlink:href="xml/buoh-comic.xml"/>
+    <xi:include xlink:href="xml/buoh-properties-dialog.xml"/>
+    <xi:include xlink:href="xml/buoh-settings.xml"/>
+    <xi:include xlink:href="xml/buoh-view-comic.xml"/>
+    <xi:include xlink:href="xml/buoh-view-message.xml"/>
+    <xi:include xlink:href="xml/buoh-view.xml"/>
+    <xi:include xlink:href="xml/buoh-window.xml"/>
+    <xi:include xlink:href="xml/buoh.xml"/>
+  </chapter>
+  <index id="api-index-full">
+    <title>Index</title>
+    <xi:include xlink:href="xml/api-index-full.xml">
+      <xi:fallback/>
+    </xi:include>
+  </index>
+</book>
diff --git a/docs/reference/buoh/meson.build b/docs/reference/buoh/meson.build
new file mode 100644
index 0000000..992b3f1
--- /dev/null
+++ b/docs/reference/buoh/meson.build
@@ -0,0 +1,22 @@
+if get_option('gtk_doc')
+  version_conf = configuration_data()
+  version_conf.set('BUOH_VERSION', meson.project_version())
+  buoh_docs = configure_file(
+    input: 'buoh-docs.xml.in',
+    output: 'buoh-docs.xml',
+    configuration: version_conf,
+  )
+
+  gnome.gtkdoc(
+    'buoh',
+    main_xml: join_paths(meson.current_build_dir(), 'buoh-docs.xml'),
+    namespace: 'buoh',
+    mode: 'none',
+    src_dir: join_paths(meson.source_root(), 'src'),
+    dependencies: buoh,
+    fixxref_args: [
+      '--html-dir=' + docpath,
+    ],
+    install: true,
+  )
+endif
diff --git a/meson.build b/meson.build
index c7a4535..479510b 100644
--- a/meson.build
+++ b/meson.build
@@ -14,6 +14,7 @@ po_dir = join_paths(meson.source_root(), 'po')
 prefix = get_option('prefix')
 bindir = join_paths(prefix, get_option('bindir'))
 datadir = join_paths(prefix, get_option('datadir'))
+docpath = join_paths(datadir, 'gtk-doc', 'html')
 icondir = join_paths(datadir, 'icons', 'hicolor')
 localedir = join_paths(prefix, get_option('localedir'))
 pkgdatadir = join_paths(datadir, meson.project_name())
@@ -48,3 +49,4 @@ meson.add_install_script(
 subdir('src')
 subdir('data')
 subdir('po')
+subdir('docs/reference/buoh')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..b0c8297
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,6 @@
+option(
+  'gtk_doc',
+  type: 'boolean',
+  value: false,
+  description: 'Use gtk-doc to build documentation',
+)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]