[planner: 22/40] build: Add gtk-doc libplanner API doc building support
- From: Mart Raudsepp <mraudsepp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planner: 22/40] build: Add gtk-doc libplanner API doc building support
- Date: Thu, 3 Jun 2021 16:28:55 +0000 (UTC)
commit a5f4ccf88301635490786bda9fe0d727b5917df5
Author: Mart Raudsepp <leio gentoo org>
Date: Wed Mar 4 14:20:50 2020 +0200
build: Add gtk-doc libplanner API doc building support
docs/libplanner/meson.build | 52 +++++++++++++++++++++++++++++++++++++++++++++
docs/meson.build | 4 ++++
docs/user-guide/meson.build | 7 ++++++
meson.build | 2 ++
meson_options.txt | 5 +++++
5 files changed, 70 insertions(+)
---
diff --git a/docs/libplanner/meson.build b/docs/libplanner/meson.build
new file mode 100644
index 00000000..f8a12732
--- /dev/null
+++ b/docs/libplanner/meson.build
@@ -0,0 +1,52 @@
+doc_module = 'libplanner'
+docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')
+glib_prefix = glib_dep.get_pkgconfig_variable('prefix')
+glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
+
+ignore_headers = [
+ 'mrp-file-module.h',
+ 'mrp-marshal.h',
+ 'mrp-old-xml.h',
+ 'mrp-parser.h',
+ 'mrp-paths.h',
+ 'mrp-private.h',
+ 'mrp-sql.h',
+ 'mrp-storage-module-factory.h',
+ 'mrp-storage-module.h',
+ 'mrp-storage-module-xml.h',
+ 'mrp-storage-mrproject.h',
+ 'mrp-storage-sql.h',
+ 'mrp-task-manager.h',
+]
+
+scan_args = [
+ '--rebuild-sections',
+ '--rebuild-types',
+ '--ignore-headers=' + ' '.join(ignore_headers),
+]
+
+mkdb_args = [
+ '--xml-mode',
+ '--output-format=xml',
+]
+
+fixxref_args = [
+ '--html-dir=@0@'.format(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')),
+]
+
+gnome.gtkdoc(
+ doc_module,
+ main_xml: doc_module + '-docs.xml',
+ gobject_typesfile: doc_module + '.types',
+ src_dir: libplanner_inc,
+ ignore_headers: ignore_headers,
+ dependencies: libplanner_dep,
+ namespace: doc_module,
+ scan_args: scan_args,
+ mkdb_args: mkdb_args,
+ fixxref_args: fixxref_args,
+ install: true,
+)
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 00000000..609bf4e2
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1,4 @@
+if get_option('gtk_doc')
+ subdir('libplanner')
+endif
+subdir('user-guide')
diff --git a/docs/user-guide/meson.build b/docs/user-guide/meson.build
new file mode 100644
index 00000000..e94c3f01
--- /dev/null
+++ b/docs/user-guide/meson.build
@@ -0,0 +1,7 @@
+help_files = [
+ 'planner.xml',
+ 'legal.xml',
+]
+
+# TODO: Help needs porting to modern ways first
+#gnome.yelp(meson.project_name(), sources: help_files)
diff --git a/meson.build b/meson.build
index ec5a056f..ab710726 100644
--- a/meson.build
+++ b/meson.build
@@ -27,6 +27,7 @@ configure_file(
configuration: conf_data,
)
toplevel_inc = include_directories('.')
+libplanner_inc = include_directories('libplanner')
eds_req = '>= 3.6'
@@ -65,3 +66,4 @@ subdir('tests')
if python_dep.found() and pygobject_codegen.found()
subdir('python')
endif
+subdir('docs')
diff --git a/meson_options.txt b/meson_options.txt
index ae29853c..ac18ef87 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -15,3 +15,8 @@ option('examples',
type: 'boolean',
value: false,
)
+option('gtk_doc',
+ type: 'boolean',
+ value: false,
+ description: 'Build API reference with gtk-doc'
+)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]