diff options
author | Günther Wagner <info@gunibert.de> | 2021-10-21 19:36:05 +0200 |
---|---|---|
committer | Günther Wagner <info@gunibert.de> | 2021-10-21 20:04:40 +0200 |
commit | 1b7bd9a0b709672768ef3b4463a06039c5bf1dac (patch) | |
tree | 2d6726357190e9cc19d54ab331a7e2347f4c7d90 /docs | |
parent | c10242ed45eb6bcb5f27a2a2e7b7eda944324179 (diff) | |
download | librest-1b7bd9a0b709672768ef3b4463a06039c5bf1dac.tar.gz |
Add gi-docgen and proper documentation CI
Diffstat (limited to 'docs')
-rw-r--r-- | docs/librest.toml.in | 34 | ||||
-rw-r--r-- | docs/meson.build | 42 |
2 files changed, 76 insertions, 0 deletions
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 + |