Add API reference generation using gi-docgen

This commit is contained in:
Juan Pablo Ugarte 2025-08-28 08:42:01 -04:00
parent 4c0d5308ed
commit 7662c0e332
No known key found for this signature in database
7 changed files with 113 additions and 74 deletions

40
docs/casilda.toml.in Normal file
View file

@ -0,0 +1,40 @@
# SPDX-FileCopyrightText: 2025 Juan Pablo Ugarte
# SPDX-License-Identifier: CC0-1.0
[library]
version = "@VERSION@"
description = "A simple Wayland compositor widget for Gtk 4"
authors = "Juan Pablo Ugarte"
license = "LGPL-2.1-only"
website_url = "https://gitlab.gnome.org/jpu/casilda"
browse_url = "https://gitlab.gnome.org/jpu/casilda"
repository_url = "https://gitlab.gnome.org/jpu/casilda.git"
devhelp = true
search_index = true
dependencies = [
"Gtk-4.0",
"GLib-2.0",
"GObject-2.0"
]
[dependencies."Gtk-4.0"]
name = "Gtk"
description = "The GTK toolkit"
docs_url = "https://docs.gtk.org/gtk4/"
[dependencies."GLib-2.0"]
name = "GLib"
description = "The base utility library"
docs_url = "https://docs.gtk.org/glib/"
[dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://docs.gtk.org/gobject/"
[source-location]
base_url = "https://gitlab.gnome.org/jpu/casilda/-/blob/@VERSION@/"
[extra]
urlmap_file = "urlmap.js"

32
docs/meson.build Normal file
View file

@ -0,0 +1,32 @@
toml_conf = configuration_data()
toml_conf.set('VERSION', meson.project_version())
docs_dir = get_option('datadir') / 'doc'
casilda_toml = configure_file(
input: 'casilda.toml.in',
output: 'casilda.toml',
configuration: toml_conf,
install: true,
install_dir: docs_dir / 'casilda',
)
custom_target('casilda-doc',
input: [ casilda_toml, casilda_gir[0] ],
output: 'casilda',
command: [
gidocgen,
'generate',
['--quiet', '--no-namespace-dir'],
'--add-include-path=@0@'.format(meson.current_source_dir() / '../src'),
'--add-include-path=@0@'.format(meson.current_build_dir() / '../src'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
build_by_default: true,
install: true,
install_dir: docs_dir,
install_tag: 'doc',
)

10
docs/urlmap.js Normal file
View file

@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: 2025 Juan Pablo Ugarte
// SPDX-License-Identifier: LGPL-2.1-only
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/' ],
[ 'Gtk', 'https://docs.gtk.org/gtk4/' ],
]