[libgit2-glib] meson: Improve documentation generation



commit 3b69dca01a5c27f260a523fc32134af8311149aa
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Mon Nov 12 17:05:22 2018 +0100

    meson: Improve documentation generation
    
    GtkDoc generated documentation takes advantage of different new
    meson's improvements.
    
    It uses the `gtkdoc_html_dir` function to set the paths to be fixed.
    It also makes use of the `ignore_headers` parameter. Finally, it
    uses the `version.xml` file target as a content file instad of
    assuming the same build location.

 docs/reference/meson.build | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 4a414f2..ea6b0af 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -1,32 +1,32 @@
+glib_prefix = glib_dep.get_pkgconfig_variable('prefix')
+
+fixxref_args = [
+  '--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('glib')),
+  '--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('gobject')),
+  '--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('gio')),
+  '--html-dir=' + join_paths(libgit2_glib_prefix, gnome.gtkdoc_html_dir(libgit2_glib_api_name)),
+]
+
 docs_conf = configuration_data()
 docs_conf.set('PACKAGE_VERSION', libgit2_glib_version)
 
 name = 'version.xml'
 
-configure_file(
+content_files = configure_file(
   input: name + '.in',
   output: name,
   configuration: docs_conf,
 )
 
-glib_prefix = glib_dep.get_pkgconfig_variable('prefix')
-glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
-
 gnome.gtkdoc(
   libgit2_glib_api_name,
   main_sgml: libgit2_glib_api_name + '-docs.sgml',
   src_dir: join_paths(meson.source_root(), 'libgit2-glib'),
   dependencies: libgit2_glib_dep,
+  ignore_headers: private_headers,
   gobject_typesfile: libgit2_glib_api_name + '.types',
-  scan_args: [
-    '--rebuild-types',
-    '--ignore-headers=' + ' '.join(private_headers),
-  ],
-  fixxref_args: [
-    '--extra-dir=' + join_paths(glib_docpath, 'glib'),
-    '--extra-dir=' + join_paths(glib_docpath, 'gobject'),
-    '--extra-dir=' + join_paths(glib_docpath, 'gio'),
-    '--html-dir=' + join_paths(libgit2_glib_prefix, gnome.gtkdoc_html_dir(libgit2_glib_api_name)),
-  ],
+  scan_args: '--rebuild-types',
+  fixxref_args: fixxref_args,
+  content_files: content_files,
   install: true,
 )


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