[evince] doc: migrate to gi-docgen
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] doc: migrate to gi-docgen
- Date: Sat, 8 Jan 2022 17:16:54 +0000 (UTC)
commit b6237a2b2ed4f65bd4c70667b75837cf41ec787f
Author: Qiu Wenbo <qiuwenbo kylinos com cn>
Date: Thu Dec 2 09:44:09 2021 +0800
doc: migrate to gi-docgen
Switch to gi-docgen to build the documentation.
Signed-off-by: Qiu Wenbo <qiuwenbo kylinos com cn>
help/meson.build | 12 +-
help/reference/libdocument/libevdocument-docs.xml | 211 -----
.../libdocument/libevdocument-sections.txt | 912 ---------------------
help/reference/libdocument/libevdocument.toml.in | 24 +
help/reference/libdocument/libevdocument.types | 62 --
help/reference/libdocument/meson.build | 57 +-
help/reference/libdocument/version.xml.in | 1 -
help/reference/libview/libevview-docs.xml | 157 ----
help/reference/libview/libevview-sections.txt | 413 ----------
help/reference/libview/libevview.toml.in | 39 +
help/reference/libview/libevview.types | 25 -
help/reference/libview/meson.build | 67 +-
help/reference/libview/version.xml.in | 1 -
libview/meson.build | 2 +-
meson.build | 4 +
subprojects/gi-docgen.wrap | 6 +
16 files changed, 125 insertions(+), 1868 deletions(-)
---
diff --git a/help/meson.build b/help/meson.build
index c7db45f2e..959071eb7 100644
--- a/help/meson.build
+++ b/help/meson.build
@@ -4,13 +4,11 @@ if enable_gtk_doc
glib_prefix = glib_dep.get_pkgconfig_variable('prefix')
gtk_prefix = gtk_dep.get_pkgconfig_variable('prefix')
- common_fixxref_args = [
- '--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('glib')),
- '--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('gio')),
- '--extra-dir=' + join_paths(gtk_prefix, gnome.gtkdoc_html_dir('gdk')),
- '--extra-dir=' + join_paths(gtk_prefix, gnome.gtkdoc_html_dir('gdk-pixbuf')),
- '--extra-dir=' + join_paths(gtk_prefix, gnome.gtkdoc_html_dir('gtk')),
- ]
+ docs_dir = get_option('prefix') / get_option('datadir') / 'doc'
+
+ toml_conf = configuration_data()
+ toml_conf.set('version', meson.project_version())
+ gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'))
subdir('reference/libdocument')
subdir('reference/libview')
diff --git a/help/reference/libdocument/libevdocument.toml.in
b/help/reference/libdocument/libevdocument.toml.in
new file mode 100644
index 000000000..46b6eb51e
--- /dev/null
+++ b/help/reference/libdocument/libevdocument.toml.in
@@ -0,0 +1,24 @@
+[library]
+version = "@version@"
+browse_url = "https://gitlab.gnome.org/GNOME/evince/"
+repository_url = "https://gitlab.gnome.org/GNOME/evince.git"
+website_url = "https://wiki.gnome.org/Apps/Evince"
+authors = "Evince Developers"
+license = "GPL-2-or-later"
+description = "Evince is a document viewer for multiple document formats."
+dependencies = [ "GObject-2.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/"
+
+[theme]
+name = "basic"
+show_index_summary = true
+show_class_hierarchy = true
+
+[source-location]
+base_url = "https://gitlab.gnome.org/GNOME/evince/-/blob/main/"
diff --git a/help/reference/libdocument/meson.build b/help/reference/libdocument/meson.build
index dcae9488e..96a9745c7 100644
--- a/help/reference/libdocument/meson.build
+++ b/help/reference/libdocument/meson.build
@@ -1,39 +1,26 @@
-doc_module = 'libevdocument'
-doc_module_dir = '@0@-@1@'.format(doc_module, ev_api_version)
-
-private_headers = [
- 'ev-backend-info.h',
- 'ev-debug.h',
- 'ev-macros.h',
- 'ev-module.h',
-]
-
-libevdocument_doc_path = join_paths(ev_prefix, gnome.gtkdoc_html_dir(doc_module_dir))
-
-fixxref_args = common_fixxref_args + ['--html-dir=' + libevdocument_doc_path]
-
-version_conf = configuration_data()
-version_conf.set('VERSION', ev_version)
-
-version_xml = 'version.xml'
-
-version = configure_file(
- input: version_xml + '.in',
- output: version_xml,
- configuration: version_conf,
+libevdocument_toml = configure_file(
+ input: 'libevdocument.toml.in',
+ output: 'libevdocument.toml',
+ configuration: toml_conf,
+ install: true,
+ install_dir: docs_dir / 'libevdocument',
)
-gnome.gtkdoc(
- doc_module,
- main_xml: doc_module + '-docs.xml',
- module_version: ev_api_version,
- src_dir: libdocument_inc,
- dependencies: libevdocument_dep,
- ignore_headers: private_headers,
- namespace: ev_code_prefix.to_lower(),
- fixxref_args: fixxref_args,
- gobject_typesfile: files(doc_module + '.types'),
- content_files: version,
+custom_target('libevdocument-doc',
+ input: [ libevdocument_toml, libevdocument_gir[0] ],
+ output: 'libevdocument',
+ command: [
+ gidocgen,
+ 'generate',
+ '--quiet',
+ '--fatal-warnings',
+ '--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: doc_module_dir,
+ install_dir: docs_dir,
)
diff --git a/help/reference/libview/libevview.toml.in b/help/reference/libview/libevview.toml.in
new file mode 100644
index 000000000..63ebacb29
--- /dev/null
+++ b/help/reference/libview/libevview.toml.in
@@ -0,0 +1,39 @@
+[library]
+version = "@version@"
+browse_url = "https://gitlab.gnome.org/GNOME/evince/"
+repository_url = "https://gitlab.gnome.org/GNOME/evince.git"
+website_url = "https://wiki.gnome.org/Apps/Evince"
+authors = "Evince Developers"
+license = "GPL-2-or-later"
+description = "Evince is a document viewer for multiple document formats."
+dependencies = [ "GObject-2.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."Graphene-1.0"]
+ name = "Graphene"
+ description = "A thin layer of mathematical types for 3D libraries"
+ docs_url = "https://ebassi.github.io/graphene/docs/"
+
+ [dependencies."Pango-1.0"]
+ name = "Pango"
+ description = "Text shaping and rendering"
+ docs_url = "https://docs.gtk.org/Pango/"
+
+ [dependencies."Gdk-4.0"]
+ name = "GDK"
+ description = "The GTK windowing system abstraction"
+ docs_url = "https://docs.gtk.org/gdk4/"
+
+[theme]
+name = "basic"
+show_index_summary = true
+show_class_hierarchy = true
+
+[source-location]
+base_url = "https://gitlab.gnome.org/GNOME/evince/-/blob/main/"
diff --git a/help/reference/libview/meson.build b/help/reference/libview/meson.build
index 38417af68..30a4f1c3a 100644
--- a/help/reference/libview/meson.build
+++ b/help/reference/libview/meson.build
@@ -1,47 +1,28 @@
-doc_module = 'libevview'
-doc_module_dir = '@0@-@1@'.format(doc_module, ev_api_version)
-
-private_headers = [
- 'ev-link-accessible.h',
- 'ev-pixbuf-cache.h',
- 'ev-timeline.h',
- 'ev-transition-animation.h',
- 'ev-view-accessible.h',
- 'ev-view-marshal.h',
- 'ev-view-private.h',
-]
-
-libevview_doc_path = join_paths(ev_prefix, gnome.gtkdoc_html_dir(doc_module_dir))
-
-fixxref_args = [
- '--html-dir=' + libevview_doc_path,
- '--extra-dir=' + libevdocument_doc_path,
-] + common_fixxref_args
-
-version_conf = configuration_data()
-version_conf.set('VERSION', ev_version)
-
-version_xml = 'version.xml'
-
-version = configure_file(
- input: version_xml + '.in',
- output: version_xml,
- configuration: version_conf,
+libevview_toml = configure_file(
+ input: 'libevview.toml.in',
+ output: 'libevview.toml',
+ configuration: toml_conf,
+ install: true,
+ install_dir: docs_dir / 'libevview',
)
-gnome.gtkdoc(
- doc_module,
- main_xml: doc_module + '-docs.xml',
- module_version: ev_api_version,
- src_dir: libview_inc,
- ignore_headers: private_headers,
- include_directories: top_inc,
- dependencies: libevview_dep,
- c_args: '-DEVINCE_COMPILATION',
- namespace: ev_code_prefix.to_lower(),
- fixxref_args: fixxref_args,
- gobject_typesfile: doc_module + '.types',
- content_files: version,
+custom_target('libevview-doc',
+ input: [ libevview_toml, libevview_gir[0] ],
+ output: 'libevview',
+ command: [
+ gidocgen,
+ 'generate',
+ '--quiet',
+ '--fatal-warnings',
+ '--config=@INPUT0@',
+ '--add-include-path=@0@'.format(meson.current_build_dir() / '..' / '..' / '..' / 'libdocument'),
+ '--output-dir=@OUTPUT@',
+ '--no-namespace-dir',
+ '--content-dir=@0@'.format(meson.current_source_dir()),
+ '@INPUT1@',
+ ],
+ depends: [ libevdocument_gir[0] ],
+ build_by_default: true,
install: true,
- install_dir: doc_module_dir,
+ install_dir: docs_dir,
)
diff --git a/libview/meson.build b/libview/meson.build
index 178fd8c8c..dfcdff849 100644
--- a/libview/meson.build
+++ b/libview/meson.build
@@ -124,7 +124,7 @@ if enable_introspection
libevdocument_gir[0],
]
- gnome.generate_gir(
+ libevview_gir = gnome.generate_gir(
[libevview, libevdocument],
sources: sources + headers + [enum_sources[1]],
includes: incs,
diff --git a/meson.build b/meson.build
index 8212342ad..48003b33a 100644
--- a/meson.build
+++ b/meson.build
@@ -161,6 +161,10 @@ hdy_dep = dependency('libhandy-1', version: hdy_req_version, fallback: ['libhand
m_dep = cc.find_library('m')
+gidocgen_dep = dependency('gi-docgen', version: '>= 2021.1',
+ fallback: ['gi-docgen', 'dummy_dep'],
+ required: get_option('gtk_doc'))
+
# Although GTK+ 3.10 includes hi-dpi functionality, it does not require a cairo with
# cairo_surface_set_device_scale(), which we also need if we're to support hi-dpi,
# so we need check for that explicitly.
diff --git a/subprojects/gi-docgen.wrap b/subprojects/gi-docgen.wrap
new file mode 100644
index 000000000..98cd92118
--- /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]