Setup documentation via gi-docgen
--- a/meson.build Fri Dec 01 00:07:32 2023 -0600
+++ b/meson.build Fri Dec 01 00:18:15 2023 -0600
@@ -4,6 +4,26 @@
meson_version : '>=1.0.0',
+parts = meson.project_version().split('-') +parts = parts[0].split('.') +XEME_MAJOR_VERSION = parts[0] +XEME_MINOR_VERSION = parts[1] +XEME_MICRO_VERSION = parts[2] +XEME_LIB_VERSION = f'@XEME_MAJOR_VERSION@.@XEME_MINOR_VERSION@.@XEME_MICRO_VERSION@' +version_config = configuration_data() +version_config.set('XEME_MAJOR_VERSION', XEME_MAJOR_VERSION) +version_config.set('XEME_MINOR_VERSION', XEME_MINOR_VERSION) +version_config.set('XEME_MICRO_VERSION', XEME_MICRO_VERSION) +version_config.set('XEME_EXTRA_VERSION', extra) +version_config.set('XEME_VERSION', meson.project_version()) glib_dep = dependency('glib-2.0', version : '>=2.76.0')
gio_dep = dependency('gio-2.0')
@@ -22,3 +42,15 @@
command : ['ninja', '-C', '@BUILD_ROOT@', 'all', 'test'])
+ 'prefix': get_option('prefix'), + 'bindir': get_option('bindir'), + 'libdir': get_option('libdir'), + 'datadir': get_option('datadir'), +}, section : 'Directories') + 'introspection': get_option('introspection'), + 'documentation': get_option('doc'), --- a/meson_options.txt Fri Dec 01 00:07:32 2023 -0600
+++ b/meson_options.txt Fri Dec 01 00:18:15 2023 -0600
@@ -1,3 +1,9 @@
+ type : 'boolean', value : true, yield : true, + description : 'build documentation with gi-docgen' type : 'boolean', value : true, yield : true,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/subprojects/gi-docgen.wrap Fri Dec 01 00:18:15 2023 -0600
@@ -0,0 +1,5 @@
+directory = gi-docgen-2023.1 +source_url = https://download.gnome.org/sources/gi-docgen/2023/gi-docgen-2023.1.tar.xz +source_filename = gi-docgen-2023.1.tar.xz +source_hash = a9a687c1b7c4a4139a214bd451e01ca86131a3161f68aa3e07325b06002bbfb6 --- a/xeme/meson.build Fri Dec 01 00:07:32 2023 -0600
+++ b/xeme/meson.build Fri Dec 01 00:18:15 2023 -0600
@@ -81,4 +81,5 @@
###############################################################################
###############################################################################
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xeme/reference/meson.build Fri Dec 01 00:18:15 2023 -0600
@@ -0,0 +1,44 @@
+if not get_option('doc') +if not get_option('introspection') + error('Documentation requires GObject Introspection.') +gidocgen_dep = dependency( + 'gi-docgen', version: '>= 2023.1', + fallback: ['gi-docgen', 'dummy_dep'], +gidocgen = find_program('gi-docgen', required : get_option('doc')) +docs_dir = get_option('prefix') / get_option('datadir') / 'doc' +xeme_doc_content_files = [] +xeme_gidocgen_toml = configure_file( + input : 'xeme.toml.in', + configuration : version_config, + install_dir : docs_dir / 'xeme') +xeme_doc = custom_target('xeme-doc', + input : [ xeme_gidocgen_toml, xeme_gir[0] ], + '--output-dir=@OUTPUT@', + '--content-dir=@0@'.format(meson.current_source_dir()), + depend_files : [ xeme_doc_content_files ], + build_by_default : true, + install_dir : docs_dir, --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xeme/reference/urlmap.js Fri Dec 01 00:18:15 2023 -0600
@@ -0,0 +1,8 @@
+// SPDX-FileCopyrightText: 2021 GNOME Foundation +// SPDX-License-Identifier: LGPL-2.1-or-later +// A map between namespaces and base URLs for their online documentation + [ 'GLib', 'https://docs.gtk.org/glib/' ], + [ 'GObject', 'https://docs.gtk.org/gobject/' ], --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xeme/reference/xeme.toml.in Fri Dec 01 00:18:15 2023 -0600
@@ -0,0 +1,36 @@
+version = "@XEME_VERSION@" +browse_url = "https://keep.imfreedom.org/xeme/xeme/" +repository_url = "https://keep.imfreedom.org/xeme/xeme/" +website_url = "https://keep.imfreedom.org/xeme/xeme/" +authors = "Xeme Developers" +license = "LGPL-2.1-or-later" +description = "Xeme High Level XMPP Parsing Library" +dependencies = [ "GLib-2.0", "GObject-2.0" ] + [dependencies."GLib-2.0"] + description = "General-purpose, portable utility library." + docs_url = "https://docs.gtk.org/glib/" + [dependencies."GObject-2.0"] + description = "The base type system library" + docs_url = "https://docs.gtk.org/gobject/" +show_index_summary = true +show_class_hierarchy = true +base_url = "https://keep.imfreedom.org/xeme/xeme/file/default/" +# The same order will be used when generating the index +urlmap_file = "urlmap.js" --- a/xeme/xemeinputstream.h Fri Dec 01 00:07:32 2023 -0600
+++ b/xeme/xemeinputstream.h Fri Dec 01 00:18:15 2023 -0600
@@ -44,8 +44,6 @@
* Creates a new input stream.
- * > Note: this is typically only necessary for [class@Client].
* Returns: (transfer full): The new instance.
--- a/xeme/xemeoutputstream.h Fri Dec 01 00:07:32 2023 -0600
+++ b/xeme/xemeoutputstream.h Fri Dec 01 00:18:15 2023 -0600
@@ -37,8 +37,6 @@
* @cancellable: (nullable): A [class@Gio.Cancellable] for the stream.
* Creates a new output stream.
- * > Note: this is typically only necessary for [class@Client].
* Returns: (transfer full): The new instance.