From 1b7bd9a0b709672768ef3b4463a06039c5bf1dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Wagner?= Date: Thu, 21 Oct 2021 19:36:05 +0200 Subject: Add gi-docgen and proper documentation CI --- docs/librest.toml.in | 34 ++++++++++++++++++++++++++++++++++ docs/meson.build | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 docs/librest.toml.in (limited to 'docs') diff --git a/docs/librest.toml.in b/docs/librest.toml.in new file mode 100644 index 0000000..4f4c59d --- /dev/null +++ b/docs/librest.toml.in @@ -0,0 +1,34 @@ +[library] +namespace = "Rest" +version = "@REST_VERSION@" +browse_url = "https://gitlab.gnome.org/GNOME/librest/" +repository_url = "https://gitlab.gnome.org/GNOME/librest.git" +authors = "Günther Wagner" +license = "LGPL-2.1-or-later" +description = "REST client library" +dependencies = [ "GObject-2.0", "Gio-2.0", "Soup-2.4" ] +devhelp = true +search_index = true + + [dependencies."GObject-2.0"] + name = "GObject" + description = "The base type system library" + docs_url = "https://developer.gnome.org/gobject/stable" + + [dependencies."Gio-2.0"] + name = "Gio" + description = "GObject interfaces and objects" + docs_url = "https://developer.gnome.org/gio/stable" + + [dependencies."Soup-2.4"] + name = "Soup" + description = "HTTP library" + docs_url = "https://developer.gnome.org/libsoup/stable" + +[theme] +name = "basic" +show_index_summary = true +show_class_hierarchy = true + +[source-location] +base_url = "https://gitlab.gnome.org/GNOME/librest/-/blob/master/" diff --git a/docs/meson.build b/docs/meson.build index 164cf27..2eeb084 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -1 +1,43 @@ subdir('reference/rest') + +if get_option('gtk_doc') and get_option('introspection') + dependency('gi-docgen', version: '>= 2021.6', + fallback: ['gi-docgen', 'dummy_dep'], + ) + + gidocgen = find_program('gi-docgen', required: get_option('gtk_doc')) + + rest_docdir = rest_datadir / 'doc' + + toml_conf = configuration_data() + toml_conf.set('REST_VERSION', meson.project_version()) + + rest_toml = configure_file( + input: 'librest.toml.in', + output: 'librest.toml', + configuration: toml_conf, + ) + + custom_target('librest-doc', + input: librest_gir[0], + output: 'librest-1.0', + command: [ + gidocgen, + 'generate', + '--quiet', + '--fatal-warnings', + '--add-include-path=@0@'.format(meson.current_build_dir() / '../rest'), + '--config', rest_toml, + '--output-dir=@OUTPUT@', + '--no-namespace-dir', + '--content-dir=@0@'.format(meson.current_source_dir()), + '@INPUT@', + ], + depend_files: [ rest_toml ], + build_by_default: true, + install: true, + install_dir: rest_docdir, + ) + +endif + -- cgit v1.2.1