[gnome-shell/zbrown/docgen: 7/8] doc: Switch documentation to gi-docgen




commit 909c761e6f4a8ef5072d38a468ec2942a28c3117
Author: Zander Brown <zbrown gnome org>
Date:   Mon Jun 7 01:04:55 2021 +0100

    doc: Switch documentation to gi-docgen

 docs/meson.build                     | 58 ++++++++++++++++++++++++++++++
 docs/reference/meson.build           |  5 ---
 docs/reference/shell/meson.build     | 51 --------------------------
 docs/reference/shell/shell-docs.sgml | 69 ------------------------------------
 docs/reference/shell/version.xml.in  |  1 -
 docs/reference/st/meson.build        | 23 ------------
 docs/reference/st/st-docs.sgml       | 69 ------------------------------------
 docs/reference/st/version.xml.in     |  1 -
 docs/shell.toml.in                   | 23 ++++++++++++
 docs/st.toml.in                      | 23 ++++++++++++
 meson.build                          |  5 ++-
 src/meson.build                      |  2 +-
 subprojects/gi-docgen.wrap           |  6 ++++
 13 files changed, 115 insertions(+), 221 deletions(-)
---
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 0000000000..eed3c32f84
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1,58 @@
+gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'))
+
+doc_conf = configuration_data()
+doc_conf.set('SHELL_VERSION', meson.project_version())
+
+shell_toml = configure_file(input: 'shell.toml.in',
+                            output: 'shell.toml',
+                            configuration: doc_conf)
+
+custom_target('shell-doc',
+  input: libshell_gir[0],
+  output: 'Shell',
+  command: [
+    gidocgen,
+    'generate',
+    '--quiet',
+    '--add-include-path=@0@'.format(meson.current_build_dir() / '../src'),
+    '--add-include-path=@0@'.format(meson.current_build_dir() / '../src/st'),
+    '--add-include-path=@0@'.format(mutter_dep.get_pkgconfig_variable('girdir')),
+    '--add-include-path=@0@'.format(meson.build_root() / 'subprojects/gvc'),
+    '--config', shell_toml,
+    '--output-dir=@OUTPUT@',
+    '--no-namespace-dir',
+    '--content-dir=@0@'.format(meson.current_source_dir()),
+    '@INPUT@',
+  ],
+  depend_files: [ shell_toml ],
+  build_by_default: true,
+  install: true,
+  install_dir: datadir / 'doc/shell/reference',
+)
+
+st_toml = configure_file(input: 'st.toml.in',
+                         output: 'st.toml',
+                         configuration: doc_conf)
+
+custom_target('st-doc',
+  input: libst_gir[0],
+  output: 'St',
+  command: [
+    gidocgen,
+    'generate',
+    '--quiet',
+    '--add-include-path=@0@'.format(meson.current_build_dir() / '../src'),
+    '--add-include-path=@0@'.format(meson.current_build_dir() / '../src/st'),
+    '--add-include-path=@0@'.format(mutter_dep.get_pkgconfig_variable('girdir')),
+    '--config', st_toml,
+    '--output-dir=@OUTPUT@',
+    '--no-namespace-dir',
+    '--content-dir=@0@'.format(meson.current_source_dir()),
+    '--fatal-warnings',
+    '@INPUT@',
+  ],
+  depend_files: [ st_toml ],
+  build_by_default: true,
+  install: true,
+  install_dir: datadir / 'doc/st/reference',
+)
diff --git a/docs/shell.toml.in b/docs/shell.toml.in
new file mode 100644
index 0000000000..d20b2e3982
--- /dev/null
+++ b/docs/shell.toml.in
@@ -0,0 +1,23 @@
+[library]
+namespace = "Shell"
+version = "@SHELL_VERSION@"
+browse_url = "https://gitlab.gnome.org/GNOME/gnome-shell/";
+repository_url = "https://gitlab.gnome.org/GNOME/gnome-shell.git";
+website_url = "https://www.gnome.org";
+license = "GPL-2.0-or-later"
+description = "Shell"
+dependencies = [ "GObject-2.0", "Shell-1.0" ]
+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";
+
+[theme]
+name = "basic"
+show_index_summary = true
+
+[source-location]
+base_url = "https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/master/";
diff --git a/docs/st.toml.in b/docs/st.toml.in
new file mode 100644
index 0000000000..8e51ca303f
--- /dev/null
+++ b/docs/st.toml.in
@@ -0,0 +1,23 @@
+[library]
+namespace = "St"
+version = "@SHELL_VERSION@"
+browse_url = "https://gitlab.gnome.org/GNOME/gnome-shell/";
+repository_url = "https://gitlab.gnome.org/GNOME/gnome-shell.git";
+website_url = "https://www.gnome.org";
+license = "LGPL-2.0-or-later"
+description = "Shell Toolkit"
+dependencies = [ "GObject-2.0" ]
+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";
+
+[theme]
+name = "basic"
+show_index_summary = true
+
+[source-location]
+base_url = "https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/master/";
diff --git a/meson.build b/meson.build
index 20ba7edc1c..52e288d2b6 100644
--- a/meson.build
+++ b/meson.build
@@ -277,6 +277,9 @@ if get_option('extensions_app')
   )
 endif
 
+gidocgen_dep = dependency('gi-docgen', version: '>= 2021.1',
+                          fallback: ['gi-docgen', 'dummy_dep'],
+                          required: get_option('gtk_doc'))
 
 po_dir = join_paths(meson.current_source_dir(), 'po')
 
@@ -288,7 +291,7 @@ subdir('tests')
 subdir('tools')
 
 if get_option('gtk_doc')
-  subdir('docs/reference')
+  subdir('docs')
 endif
 
 meson.add_install_script('meson/postinstall.py')
diff --git a/src/meson.build b/src/meson.build
index d235c37438..78092d3ceb 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -228,7 +228,7 @@ libshell_gir_includes += [
   libst_gir[0]
 ]
 
-gnome.generate_gir(libshell,
+libshell_gir = gnome.generate_gir(libshell,
   sources: libshell_gir_sources,
   nsversion: '0.1',
   namespace: 'Shell',
diff --git a/subprojects/gi-docgen.wrap b/subprojects/gi-docgen.wrap
new file mode 100644
index 0000000000..98cd921182
--- /dev/null
+++ b/subprojects/gi-docgen.wrap
@@ -0,0 +1,6 @@
+[wrap-git]
+directory=gi-docgen
+url=https://gitlab.gnome.org/GNOME/gi-docgen.git
+push-url=ssh://git gitlab gnome org:GNOME/gi-docgen.git
+revision=main
+depth=1


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