[gnome-shell/zbrown/docgen: 73/74] doc: Switch documentation to gi-docgen




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

    doc: Switch documentation to gi-docgen

 docs/meson.build                     | 55 ++++++++++++++++++++++++++++
 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-urlmap.js                 |  4 +++
 docs/shell.toml.in                   | 31 ++++++++++++++++
 docs/st-urlmap.js                    |  3 ++
 docs/st.toml.in                      | 31 ++++++++++++++++
 meson.build                          |  5 ++-
 src/meson.build                      |  2 +-
 subprojects/gi-docgen.wrap           |  6 ++++
 15 files changed, 135 insertions(+), 221 deletions(-)
---
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 0000000000..3b28816ee0
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1,55 @@
+gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'))
+
+doc_conf = configuration_data()
+doc_conf.set('SHELL_VERSION', meson.project_version())
+
+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()),
+    '@INPUT@',
+  ],
+  depend_files: [ st_toml ],
+  install: true,
+  install_dir: datadir / 'doc',
+)
+
+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.current_build_dir() / 'subprojects/gvc'),
+    '--config', shell_toml,
+    '--output-dir=@OUTPUT@',
+    '--no-namespace-dir',
+    '--content-dir=@0@'.format(meson.current_source_dir()),
+    '@INPUT@',
+  ],
+  depend_files: [ shell_toml ],
+  install: true,
+  install_dir: datadir / 'doc',
+)
diff --git a/docs/shell-urlmap.js b/docs/shell-urlmap.js
new file mode 100644
index 0000000000..a4bae91b36
--- /dev/null
+++ b/docs/shell-urlmap.js
@@ -0,0 +1,4 @@
+baseURLs = [
+    [ 'Pango', 'https://gnome.pages/gitlab.gnome.org/pango/pango/' ],
+    [ 'St', 'https://gnome.pages/gitlab.gnome.org/gnome-shell/st/' ],
+]
diff --git a/docs/shell.toml.in b/docs/shell.toml.in
new file mode 100644
index 0000000000..1bd7e0457e
--- /dev/null
+++ b/docs/shell.toml.in
@@ -0,0 +1,31 @@
+[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";
+
+  [dependencies."Pango-1.0"]
+  name = "Pango"
+  description = "Text shaping and rendering"
+  docs_url = "https://docs.gtk.org/Pango/";
+
+[theme]
+name = "basic"
+show_index_summary = true
+
+[source-location]
+base_url = "https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/HEAD/";
+
+[extra]
+urlmap_file = "shell-urlmap.js"
diff --git a/docs/st-urlmap.js b/docs/st-urlmap.js
new file mode 100644
index 0000000000..0817afb516
--- /dev/null
+++ b/docs/st-urlmap.js
@@ -0,0 +1,3 @@
+baseURLs = [
+    [ 'Pango', 'https://gnome.pages/gitlab.gnome.org/pango/pango/' ],
+]
diff --git a/docs/st.toml.in b/docs/st.toml.in
new file mode 100644
index 0000000000..077a392fc3
--- /dev/null
+++ b/docs/st.toml.in
@@ -0,0 +1,31 @@
+[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";
+
+  [dependencies."Pango-1.0"]
+  name = "Pango"
+  description = "Text shaping and rendering"
+  docs_url = "https://docs.gtk.org/Pango/";
+
+[theme]
+name = "basic"
+show_index_summary = true
+
+[source-location]
+base_url = "https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/HEAD/";
+
+[extra]
+urlmap_file = "st-urlmap.js"
diff --git a/meson.build b/meson.build
index a68a4065ba..983b0d21ce 100644
--- a/meson.build
+++ b/meson.build
@@ -279,6 +279,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')
 
@@ -290,7 +293,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 53b8b527d5..406d6c6523 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -227,7 +227,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]