[nautilus/wip/jtojnar/gi-docgen: 160/162] docs: Switch to gi-docgen
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/jtojnar/gi-docgen: 160/162] docs: Switch to gi-docgen
- Date: Sat, 3 Sep 2022 23:03:40 +0000 (UTC)
commit d47403bcede0f331c04c7fb28cec2583fed16724
Author: Jan Tojnar <jtojnar gmail com>
Date: Wed Aug 10 21:15:44 2022 +0200
docs: Switch to gi-docgen
.../libnautilus-extension-docs.xml | 39 ------
.../libnautilus-extension-overrides.txt | 0
.../libnautilus-extension-sections.txt | 154 ---------------------
docs/reference/libnautilus-extension/meson.build | 20 ---
.../reference/libnautilus-extension/version.xml.in | 1 -
docs/reference/meson.build | 32 ++++-
docs/reference/nautilus.toml.in | 22 +++
docs/reference/urlmap.js | 9 ++
libnautilus-extension/meson.build | 2 +-
meson.build | 4 +-
10 files changed, 66 insertions(+), 217 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index a352d2680..b617ba914 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -1 +1,31 @@
-subdir('libnautilus-extension')
+toml_data = configuration_data()
+toml_data.set('VERSION', meson.project_version())
+
+nautilus_toml = configure_file(
+ input: 'nautilus.toml.in',
+ output: 'nautilus.toml',
+ configuration: toml_data,
+)
+
+custom_target(
+ 'nautilus-doc',
+ input: [
+ nautilus_toml,
+ nautilus_extension_gir[0],
+ ],
+ output: 'nautilus',
+ command: [
+ gi_docgen,
+ 'generate',
+ '--quiet',
+ '--add-include-path=@0@'.format(meson.project_source_root() / 'libnautilus-extension'),
+ '--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: docdir,
+)
diff --git a/docs/reference/nautilus.toml.in b/docs/reference/nautilus.toml.in
new file mode 100644
index 000000000..1d160ad62
--- /dev/null
+++ b/docs/reference/nautilus.toml.in
@@ -0,0 +1,22 @@
+[library]
+version = "@VERSION@"
+description = "Nautilus Extension API"
+license = "GPL-2.0-or-later"
+browse_url = "https://gitlab.gnome.org/GNOME/nautilus/"
+repository_url = "https://gitlab.gnome.org/GNOME/nautilus.git"
+devhelp = true
+search_index = true
+
+[theme]
+name = "basic"
+show_index_summary = true
+show_class_hierarchy = true
+
+[source-location]
+# The base URL for the web UI
+base_url = "https://gitlab.gnome.org/GNOME/nautilus/-/blob/master/"
+# The format for links, using "filename" and "line" for the format
+file_format = "{filename}#L{line}"
+
+[extra]
+urlmap_file = "urlmap.js"
diff --git a/docs/reference/urlmap.js b/docs/reference/urlmap.js
new file mode 100644
index 000000000..84b05c3e6
--- /dev/null
+++ b/docs/reference/urlmap.js
@@ -0,0 +1,9 @@
+// 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/"],
+ ["Gio", "https://docs.gtk.org/gio/"],
+ ["GObject", "https://docs.gtk.org/gobject/"],
+];
diff --git a/libnautilus-extension/meson.build b/libnautilus-extension/meson.build
index 457166993..3c2ab4bcf 100644
--- a/libnautilus-extension/meson.build
+++ b/libnautilus-extension/meson.build
@@ -65,7 +65,7 @@ libnautilus_extension = shared_library(
)
if get_option('introspection')
- gnome.generate_gir(
+ nautilus_extension_gir = gnome.generate_gir(
libnautilus_extension,
export_packages: [
'libnautilus-extension'
diff --git a/meson.build b/meson.build
index 99464e9ff..65dacb133 100644
--- a/meson.build
+++ b/meson.build
@@ -23,6 +23,7 @@ desktopdir = join_paths(datadir, 'applications')
includedir = get_option('includedir')
libdir = get_option('libdir')
localedir = get_option('localedir')
+docdir = datadir / 'doc'
extensiondir = join_paths(libdir, 'nautilus', 'extensions-' + nautilus_extension_version)
servicedir = join_paths(datadir, 'dbus-1', 'services')
@@ -121,6 +122,7 @@ endif
tracker_sparql = dependency('tracker-sparql-3.0')
xml = dependency('libxml-2.0', version: '>= 2.7.8')
cloudproviders = dependency('cloudproviders', version: '>= 0.3.1')
+gi_docgen = find_program('gi-docgen', required: get_option('docs'))
####################
# End dependencies #
@@ -203,7 +205,7 @@ subdirs = [
# Conditional building #
########################
-if get_option('docs')
+if gi_docgen.found()
subdirs += 'docs'
endif
if get_option('tests') != 'none'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]