[gnome-builder] sdk: move to gi-docgen for sdk documentation



commit 3fb4a9415b0b1013440436ce05c6ffc913805d44
Author: Günther Wagner <info gunibert de>
Date:   Sat Aug 7 14:01:50 2021 +0200

    sdk: move to gi-docgen for sdk documentation
    
    This is probably not complete. It generates the libide docs fine but the
    references outside of libide are not resolved right now.

 build-aux/flatpak/python-deps.json |  52 +++--
 doc/help/plugins/apiref.rst        |   6 -
 doc/help/plugins/index.rst         |   1 -
 doc/sdk/libide-docs.sgml           | 377 -------------------------------------
 doc/sdk/libide.toml.in             |  57 ++++++
 doc/sdk/meson.build                | 135 +++----------
 doc/sdk/urlmap.js                  |  16 ++
 doc/sdk/xml/gtkdocentities.ent.in  |   8 -
 doc/sdk/xml/meson.build            |  11 --
 9 files changed, 142 insertions(+), 521 deletions(-)
---
diff --git a/build-aux/flatpak/python-deps.json b/build-aux/flatpak/python-deps.json
index 25e5521c7..ff3b51ead 100644
--- a/build-aux/flatpak/python-deps.json
+++ b/build-aux/flatpak/python-deps.json
@@ -2,7 +2,7 @@
     "name": "python3-jedi",
     "buildsystem": "simple",
     "build-commands": [
-        "pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} jedi sphinx 
sphinx_rtd_theme lxml docutils codespell"
+        "pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} jedi sphinx 
sphinx_rtd_theme lxml docutils codespell gi-docgen"
     ],
     "sources": [
         {
@@ -75,16 +75,6 @@
             "url": 
"https://files.pythonhosted.org/packages/20/6b/d2a7cb176d4d664d94a6debf52cd8dbae1f7203c8e42426daa077051d59c/snowballstemmer-1.2.1.tar.gz";,
             "sha256": "919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128"
         },
-        {
-            "type": "file",
-            "url": 
"https://files.pythonhosted.org/packages/64/69/413708eaf3a64a6abb8972644e0f20891a55e621c6759e2c3f3891e05d63/Pygments-2.3.1.tar.gz";,
-            "sha256": "5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a"
-        },
-        {
-            "type": "file",
-            "url": 
"https://files.pythonhosted.org/packages/56/e6/332789f295cf22308386cf5bbd1f4e00ed11484299c5d7383378cf48ba47/Jinja2-2.10.tar.gz";,
-            "sha256": "f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4"
-        },
         {
             "type": "file",
             "url": 
"https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz";,
@@ -124,6 +114,46 @@
             "type": "file",
             "url": 
"https://files.pythonhosted.org/packages/7e/37/b15b4133e90bbef5acecfd2f3f3871c1352ee281c042fd64a22a72735fb8/codespell-1.17.1.tar.gz";,
             "sha256": "25a2ecd86b9cdc111dc40a30d0ed28c578e13a0ce158d1c383f9d47811bfcd23"
+        },
+        {
+            "type": "file",
+            "url": 
"https://files.pythonhosted.org/packages/bf/10/ff66fea6d1788c458663a84d88787bae15d45daa16f6b3ef33322a51fc7e/MarkupSafe-2.0.1.tar.gz";,
+            "sha256": "594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a"
+        },
+        {
+            "type": "file",
+            "url": 
"https://files.pythonhosted.org/packages/da/ed/1da76d11aa858ee23dac5b52d9ac2db7df02b89f7679d5d8970bcd44b59c/smartypants-2.0.1-py2.py3-none-any.whl";,
+            "sha256": "8db97f7cbdf08d15b158a86037cd9e116b4cf37703d24e0419a0d64ca5808f0d"
+        },
+        {
+            "type": "file",
+            "url": 
"https://files.pythonhosted.org/packages/8a/bf/64959d6187d42472acb846bcf462347c9124952c05bd57e5769d5f28f9a6/typogrify-2.0.7.tar.gz";,
+            "sha256": "8be4668cda434163ce229d87ca273a11922cb1614cb359970b7dc96eed13cb38"
+        },
+        {
+            "type": "file",
+            "url": 
"https://files.pythonhosted.org/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl";,
+            "sha256": "806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"
+        },
+        {
+            "type": "file",
+            "url": 
"https://files.pythonhosted.org/packages/a6/c9/be11fce9810793676017f79ffab3c6cb18575844a6c7b8d4ed92f95de604/Pygments-2.9.0-py3-none-any.whl";,
+            "sha256": "d66e804411278594d764fc69ec36ec13d9ae9147193a1740cd34d272ca383b8e"
+        },
+        {
+            "type": "file",
+            "url": 
"https://files.pythonhosted.org/packages/6e/33/1ae0f71395e618d6140fbbc9587cc3156591f748226075e0f7d6f9176522/Markdown-3.3.4-py3-none-any.whl";,
+            "sha256": "96c3ba1261de2f7547b46a00ea8463832c921d3f9d6aba3f255a6f71386db20c"
+        },
+        {
+            "type": "file",
+            "url": 
"https://files.pythonhosted.org/packages/80/21/ae597efc7ed8caaa43fb35062288baaf99a7d43ff0cf66452ddf47604ee6/Jinja2-3.0.1-py3-none-any.whl";,
+            "sha256": "1f06f2da51e7b56b8f238affdd6b4e2c61e39598a378cc49345bc1bd42a978a4"
+        },
+        {
+            "type": "file",
+            "url": 
"https://files.pythonhosted.org/packages/08/41/f01bb2d95f207a6563b5942a506a29f2e6508bd1bd9ec04d70e04b3a0eae/gi_docgen-2021.6-py2.py3-none-any.whl";,
+            "sha256": "2d5cfdf45f4d12816902cfe7e38474032779133bbb41e321fe0ec46e42726b6a"
         }
     ]
 }
diff --git a/doc/help/plugins/index.rst b/doc/help/plugins/index.rst
index 3437de234..f6d4a8e35 100644
--- a/doc/help/plugins/index.rst
+++ b/doc/help/plugins/index.rst
@@ -12,7 +12,6 @@ You may also chooser to implement extensions in C or Vala.
    :maxdepth: 3
    :titlesonly:
 
-   apiref
    enabling
    creating
    workbench/index
diff --git a/doc/sdk/libide.toml.in b/doc/sdk/libide.toml.in
new file mode 100644
index 000000000..247b952b8
--- /dev/null
+++ b/doc/sdk/libide.toml.in
@@ -0,0 +1,57 @@
+[library]
+version = "@version@"
+browse_url = "https://gitlab.gnome.org/GNOME/gnome-builder/";
+repository_url = "https://gitlab.gnome.org/GNOME/gnome-builder.git";
+website_url = "https://wiki.gnome.org/Apps/Builder";
+authors = "Christian Hergert"
+logo_url = "org.gnome.Builder.svg"
+license = "GPL-3.0-or-later"
+description = "An IDE for GNOME"
+dependencies = [ "GObject-2.0", "Gtk-3.0", "Dazzle-1.0", "GLib-2.0", "Json-GLib-1.0", "GtkSource-4", 
"Peas-1.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."Gtk-3.0"]
+  name = "Gtk+ 3"
+  description = "The GUI toolkit"
+  docs_url = "https://docs.gtk.org/gtk3/";
+
+  [dependencies."Dazzle-1.0"]
+  name = "Dazzle"
+  description = "Supporting library for Gtk Applications"
+
+  [dependencies."Json-GLib-1.0"]
+  name = "Json-GLib"
+  description = "A Json parser/generator library"
+  docs_url = "https://gnome.pages.gitlab.gnome.org/json-glib/json-glib-1.0/";
+
+  [dependencies."GLib-2.0"]
+  name = "GLib"
+  description = "The base type system library"
+  docs_url = "https://docs.gtk.org/glib/";
+
+  [dependencies."GtkSource-4"]
+  name = "GtkSourceView 4"
+  description = "A GNOME library that extends GtkTextView"
+  docs_url = "https://developer-old.gnome.org/gtksourceview/stable/";
+
+  [dependencies."Peas-1.0"]
+  name = "Libpeas"
+  description = "A GObject based plugin engine"
+  docs_url = "https://developer-old.gnome.org/libpeas/stable/";
+
+[theme]
+name = "basic"
+show_index_summary = true
+show_class_hierarchy = true
+
+[extra]
+content_images = [
+  "../../data/icons/hicolor/scalable/apps/org.gnome.Builder.svg"
+]
+urlmap_file = "urlmap.js"
diff --git a/doc/sdk/meson.build b/doc/sdk/meson.build
index f6ff1a3b7..4b4b15907 100644
--- a/doc/sdk/meson.build
+++ b/doc/sdk/meson.build
@@ -1,116 +1,37 @@
 if get_option('docs')
 
-subdir('xml')
+gidocgen = find_program('gi-docgen')
 
-private_headers = ['config.h']
-foreach source : gnome_builder_private_sources + gnome_builder_private_headers
-  private_headers += ['@0@/@1@'.format(meson.source_root(), source)]
-endforeach
+docs_dir = join_paths(get_option('datadir'), 'doc')
 
-# Locate the dependency documentation location to fix cross-references
-libdazzle_prefix = dependency('libdazzle-1.0').get_pkgconfig_variable('prefix')
-libdazzle_docpath = join_paths(libdazzle_prefix, 'share', 'gtk-doc', 'html')
-glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
-glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
-json_prefix = dependency('json-glib-1.0').get_pkgconfig_variable('prefix')
-json_docpath = join_paths(json_prefix, 'share', 'gtk-doc', 'html')
-cairo_prefix = dependency('cairo').get_pkgconfig_variable('prefix')
-cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html')
-gi_prefix = dependency('gobject-introspection-1.0').get_pkgconfig_variable('prefix')
-gi_docpath = join_paths(gi_prefix, 'share', 'gtk-doc', 'html')
-gtk_prefix = dependency('gtk+-3.0').get_pkgconfig_variable('prefix')
-gtk_docpath = join_paths(gtk_prefix, 'share', 'gtk-doc', 'html')
-gsv_prefix = dependency('gtksourceview-4').get_pkgconfig_variable('prefix')
-gsv_docpath = join_paths(gsv_prefix, 'share', 'gtk-doc', 'html')
-vte_prefix = dependency('vte-2.91').get_pkgconfig_variable('prefix')
-vte_docpath = join_paths(vte_prefix, 'share', 'vte-doc', 'html')
+toml_conf = configuration_data()
+toml_conf.set('version', libide_api_version)
 
-# Locate our directory for documentation
-docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')
-
-libide_gtk_doc = shared_library('ide-gtk-doc',
-            c_args: libide_args + release_args,
-        link_whole: gnome_builder_static,
+libide_toml = configure_file(
+    input: 'libide.toml.in',
+    output: 'libide.toml',
+    configuration: toml_conf,
+    install: true,
+    install_dir: docs_dir / 'libide',
 )
 
-libide_gtk_doc_dep = declare_dependency(
-         dependencies: gnome_builder_deps,
-            link_with: libide_gtk_doc,
+custom_target('libide-doc',
+    input: [ libide_toml, libide_gir[0] ],
+    output: 'libide',
+    command: [
+      gidocgen,
+      'generate',
+      '--quiet',
+      '--fatal-warnings',
+      '--add-include-path=@0@'.format(meson.current_build_dir() / '../../src'),
+      '--config=@INPUT0@',
+      '--output-dir=@OUTPUT@',
+      '--no-namespace-dir',
+      '--content-dir=@0@'.format(meson.current_source_dir()),
+      '@INPUT1@',
+    ],
+    build_by_default: true,
+    install: true,
+    install_dir: docs_dir,
 )
-
-gnome.gtkdoc('libide',
-           main_xml: 'libide-docs.sgml',
-            src_dir: [
-              join_paths(meson.source_root(), 'src', 'libide', 'core'),
-              join_paths(meson.build_root(), 'src', 'libide', 'core'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'io'),
-              join_paths(meson.build_root(), 'src', 'libide', 'io'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'threading'),
-              join_paths(meson.build_root(), 'src', 'libide', 'threading'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'code'),
-              join_paths(meson.build_root(), 'src', 'libide', 'code'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'foundry'),
-              join_paths(meson.build_root(), 'src', 'libide', 'foundry'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'sourceview'),
-              join_paths(meson.build_root(), 'src', 'libide', 'sourceview'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'editor'),
-              join_paths(meson.build_root(), 'src', 'libide', 'editor'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'vcs'),
-              join_paths(meson.build_root(), 'src', 'libide', 'vcs'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'debugger'),
-              join_paths(meson.build_root(), 'src', 'libide', 'debugger'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'greeter'),
-              join_paths(meson.build_root(), 'src', 'libide', 'greeter'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'gui'),
-              join_paths(meson.build_root(), 'src', 'libide', 'gui'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'lsp'),
-              join_paths(meson.build_root(), 'src', 'libide', 'lsp'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'plugins'),
-              join_paths(meson.build_root(), 'src', 'libide', 'plugins'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'search'),
-              join_paths(meson.build_root(), 'src', 'libide', 'search'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'terminal'),
-              join_paths(meson.build_root(), 'src', 'libide', 'terminal'),
-
-              join_paths(meson.source_root(), 'src', 'libide', 'tree'),
-              join_paths(meson.build_root(), 'src', 'libide', 'tree'),
-            ],
-
-       dependencies: [ libide_gtk_doc_dep ],
-  gobject_typesfile: 'libide.types',
-          scan_args: [
-            '--rebuild-types',
-            '--ignore-decorators=_IDE_EXTERN',
-          ],
-     ignore_headers: private_headers,
-      content_files: gnome_builder_public_sources + gnome_builder_public_headers,
-             c_args: libide_args,
-
-       fixxref_args: [
-         '--html-dir=@0@'.format(docpath),
-         '--extra-dir=@0@'.format(cairo_docpath),
-         '--extra-dir=@0@'.format(gi_docpath),
-         '--extra-dir=@0@'.format(glib_docpath),
-         '--extra-dir=@0@'.format(gtk_docpath),
-         '--extra-dir=@0@'.format(json_docpath),
-         '--extra-dir=@0@'.format(libdazzle_docpath),
-         '--extra-dir=@0@'.format(vte_docpath),
-       ],
-            install: true)
-
-
 endif
diff --git a/doc/sdk/urlmap.js b/doc/sdk/urlmap.js
new file mode 100644
index 000000000..355f47e35
--- /dev/null
+++ b/doc/sdk/urlmap.js
@@ -0,0 +1,16 @@
+// SPDX-FileCopyrightText: 2021 GNOME Foundation
+// SPDX-License-Identifier: LGPL-2.1-or-later
+
+// A map between namespaces and base URLs for their online documentation
+baseURLs = [
+    [ 'GLib', 'https://docs.gtk.org/glib/' ],
+    [ 'GObject', 'https://docs.gtk.org/gobject/' ],
+    [ 'Gio', 'https://docs.gtk.org/gio/' ],
+    [ 'Gdk', 'https://docs.gtk.org/gdk4/' ],
+    [ 'GdkWayland', 'https://docs.gtk.org/gdk4-wayland/' ],
+    [ 'GdkX11', 'https://docs.gtk.org/gdk4-x11/' ],
+    [ 'Gsk', 'https://docs.gtk.org/gsk4/' ],
+    [ 'Gtk', 'https://docs.gtk.org/gtk4/' ],
+    [ 'Pango', 'https://docs.gtk.org/Pango/' ],
+    [ 'PangoCairo', 'https://docs.gtk.org/PangoCairo/' ],
+]


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