[gtksourceview: 1/21] build: migrate from gtk-doc to gi-docgen




commit 18511348eb83044f1c82cadb69a8e391cad2633d
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Mon Nov 29 19:27:48 2021 +0100

    build: migrate from gtk-doc to gi-docgen
    
    Following what other GNOME libraries do for their documentations
    
    Various commits will follow to port the docs from gtk-doc
    along with hopefully some annotations fixes

 docs/GtkSource.toml.in | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++
 docs/meson.build       | 50 +++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 101 insertions(+), 2 deletions(-)
---
diff --git a/docs/GtkSource.toml.in b/docs/GtkSource.toml.in
new file mode 100644
index 00000000..8c906694
--- /dev/null
+++ b/docs/GtkSource.toml.in
@@ -0,0 +1,53 @@
+[library]
+version = "@version@"
+browse_url = "https://gitlab.gnome.org/GNOME/gtksourceview/";
+repository_url = "https://gitlab.gnome.org/GNOME/gtksourceview.git";
+website_url = "https://gitlab.gnome.org/GNOME/gtksourceview/";
+docs_url = "https://gnome.pages.gitlab.gnome.org/gtksourceview/";
+authors = "The GtkSourceView Authors"
+logo_url = "logo.svg"
+license = "LGPL-2.1-or-later"
+description = "A GNOME library that extends GtkTextView"
+dependencies = [ "GObject-2.0", "Pango-1.0", "Gdk-4.0", "Gtk-4.0" ]
+devhelp = true
+search_index = true
+
+  [dependencies."GObject-2.0"]
+  name = "GObject"
+  description = "The base type system library"
+  docs_url = "https://docs.gtk.org/gobject/";
+
+  [dependencies."GLib-2.0"]
+  name = "GLib"
+  description = "The base type system library"
+  docs_url = "https://docs.gtk.org/glib/";
+
+  [dependencies."Gio-2.0"]
+  name = "GIO"
+  description = "GObject Interfaces and Objects, Networking, IPC, and I/O"
+  docs_url = "https://docs.gtk.org/gio/";
+
+  [dependencies."Pango-1.0"]
+  name = "Pango"
+  description = "Text shaping and rendering"
+  docs_url = "https://docs.gtk.org/Pango/";
+
+  [dependencies."Gdk-Pixbuf-2.0"]
+  name = "GdkPixbuf"
+  description = "Image loading library"
+  docs_url = "https://docs.gtk.org/gdk-pixbuf/";
+
+  [dependencies."Gdk-4.0"]
+  name = "GDK"
+  description = "The GTK windowing system abstraction"
+  docs_url = "https://docs.gtk.org/gdk4/";
+
+  [dependencies."Gtk-4.0"]
+  name = "GTK"
+  description = "The GTK toolkit"
+  docs_url = "https://docs.gtk.org/gtk4/";
+
+[theme]
+name = "basic"
+show_index_summary = true
+show_class_hierarchy = true
diff --git a/docs/meson.build b/docs/meson.build
index 84a9c7a3..4ec220a6 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -1,3 +1,49 @@
-if build_gtk_doc
-  subdir('reference')
+if build_gtk_doc and not get_option('introspection').allowed()
+  error('API reference requires introspection.')
+endif
+
+toml_conf = configuration_data()
+toml_conf.set('version', meson.project_version())
+
+gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'))
+
+gidocgen_common_args = [
+  '--quiet',
+  '--no-namespace-dir',
+]
+
+if get_option('werror')
+  gidocgen_common_args += ['--fatal-warnings']
+endif
+
+docs_dir = datadir / 'doc'
+
+subdir('reference')
+
+
+if get_option('gtk_doc')
+  source_toml = configure_file(
+    input: 'GtkSource.toml.in',
+    output: 'GtkSource.toml',
+    configuration: toml_conf,
+    install: true,
+    install_dir: docs_dir / 'gtksourceview5',
+  )
+
+  custom_target('gtksourceview-doc',
+    input: [ source_toml, gtksource_gir[0] ],
+    output: 'gtksourceview5',
+    command: [
+      gidocgen,
+      'generate',
+      gidocgen_common_args,
+      '--config=@INPUT0@',
+      '--output-dir=@OUTPUT@',
+      '--content-dir=@0@'.format(meson.current_source_dir()),
+      '@INPUT1@',
+    ],
+    build_by_default: true,
+    install: true,
+    install_dir: docs_dir,
+  )
 endif


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