[buoh/wip/jtojnar/gtkdoc] Add code documentation



commit 86c466b93f7cde7ffd62f94dbc4f9c06b2daa652
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      | 34 ++++++++++++++++++++++++++++++++++
 meson.build                          |  2 ++
 meson_options.txt                    |  6 ++++++
 5 files changed, 76 insertions(+)
---
diff --git a/default.nix b/default.nix
index 9f37898..4148adf 100644
--- a/default.nix
+++ b/default.nix
@@ -41,6 +41,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     meson ninja pkgconfig gettext python3 xvfb_run libxslt 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..cd0e522
--- /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-application.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"/>
+  </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..51b111f
--- /dev/null
+++ b/docs/reference/buoh/meson.build
@@ -0,0 +1,34 @@
+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: '@BASENAME@',
+    configuration: version_conf,
+  )
+
+  glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
+  glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
+
+  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'),
+      join_paths(meson.build_root(), 'src'),
+    ],
+    dependencies: buoh,
+    fixxref_args: [
+      '--html-dir=' + docpath,
+      # '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
+      # '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
+      # '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
+      # '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gi')),
+      # '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gtk3')),
+      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gdk-pixbuf')),
+    ],
+    install: true,
+  )
+endif
diff --git a/meson.build b/meson.build
index 518c0d3..530dcce 100644
--- a/meson.build
+++ b/meson.build
@@ -17,6 +17,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())
@@ -62,3 +63,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]