[libmediaart/ebassi/no-more-autotools: 5/8] docs: Use a more idiomatic gtk-doc set up




commit 8cd7a12717a07c9a7b8705c12c5192c72ecb4fb7
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu May 20 20:31:42 2021 +0100

    docs: Use a more idiomatic gtk-doc set up
    
     - look for sources in both source and build directories
     - depend on the built library
     - ignore the generated, uninstalled marshallers header
     - make gtk-doc track the overview.xml file
     - add the missing indices
     - add the missing symbols
     - use a boolean `gtk_doc` build option, like every other
       GNOME project

 docs/libmediaart-docs.xml            | 31 ++++++++++++++++++++++++++++++-
 docs/libmediaart-sections.txt        | 13 ++++++-------
 docs/meson.build                     | 14 ++++++++++++--
 docs/{overview.sgml => overview.xml} |  0
 meson.build                          |  1 +
 meson_options.txt                    |  5 ++++-
 6 files changed, 53 insertions(+), 11 deletions(-)
---
diff --git a/docs/libmediaart-docs.xml b/docs/libmediaart-docs.xml
index 38a5021..4e3c17b 100644
--- a/docs/libmediaart-docs.xml
+++ b/docs/libmediaart-docs.xml
@@ -17,7 +17,7 @@
   </bookinfo>
 
   <!-- The Library Overview -->
-  <xi:include href="overview.sgml"/>
+  <xi:include href="overview.xml"/>
 
   <!-- The API Reference -->
   <part id="libmediaart-reference">
@@ -37,5 +37,34 @@
 
   </part>
 
+  <index id="api-index-full">
+    <title>Index</title>
+    <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
+  </index>
+  <index id="api-index-deprecated" role="deprecated">
+    <title>Index of deprecated symbols</title>
+    <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
+  </index>
+  <index id="api-index-0-1" role="0.1">
+    <title>Index of new symbols in 0.1</title>
+    <xi:include href="xml/api-index-0.1.0.xml"><xi:fallback /></xi:include>
+  </index>
+  <index id="api-index-0-2" role="0.2">
+    <title>Index of new symbols in 0.2</title>
+    <xi:include href="xml/api-index-0.2.0.xml"><xi:fallback /></xi:include>
+  </index>
+  <index id="api-index-0-3" role="0.3">
+    <title>Index of new symbols in 0.3</title>
+    <xi:include href="xml/api-index-0.3.0.xml"><xi:fallback /></xi:include>
+  </index>
+  <index id="api-index-0-5" role="0.5">
+    <title>Index of new symbols in 0.5</title>
+    <xi:include href="xml/api-index-0.5.0.xml"><xi:fallback /></xi:include>
+  </index>
+  <index id="api-index-0-7" role="0.7">
+    <title>Index of new symbols in 0.7</title>
+    <xi:include href="xml/api-index-0.7.0.xml"><xi:fallback /></xi:include>
+  </index>
+
   <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
 </book>
diff --git a/docs/libmediaart-sections.txt b/docs/libmediaart-sections.txt
index 1de8fe7..eb94ed2 100644
--- a/docs/libmediaart-sections.txt
+++ b/docs/libmediaart-sections.txt
@@ -20,8 +20,14 @@ media_art_error_quark
 media_art_process_get_type
 media_art_process_new
 media_art_process_uri
+media_art_process_uri_async
+media_art_process_uri_finish
 media_art_process_file
+media_art_process_file_async
+media_art_process_file_finish
 media_art_process_buffer
+media_art_process_buffer_async
+media_art_process_buffer_finish
 <SUBSECTION Standard>
 MEDIA_ART_IS_PROCESS
 MEDIA_ART_IS_PROCESS_CLASS
@@ -38,10 +44,3 @@ media_art_plugin_shutdown
 media_art_file_to_jpeg
 media_art_buffer_to_jpeg
 </SECTION>
-
-<SECTION>
-<FILE>marshal</FILE>
-media_art_marshal_VOID__STRING_STRING
-media_art_marshal_VOID__STRING_STRING_STRING_BOOLEAN_BOOLEAN
-</SECTION>
-
diff --git a/docs/meson.build b/docs/meson.build
index 601ea43..fce7248 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -1,10 +1,20 @@
-if get_option('with-docs') != 'no'
+if get_option('gtk_doc')
     version_xml = configure_file(input: 'version.xml.in',
         output: 'version.xml',
         configuration: conf)
 
+    ignored_headers = [
+        'marshal.h',
+    ]
+
     gnome.gtkdoc('libmediaart',
-        src_dir: 'libmediaart',
+        namespace: 'media_art',
+        src_dir: include_directories('../libmediaart'),
         main_xml: 'libmediaart-docs.xml',
+        scan_args: [
+            '--ignore-headers=' + ' '.join(ignored_headers),
+        ],
+        content_files: ['overview.xml'],
+        dependencies: libmediaart_dep,
         install: true)
 endif
diff --git a/docs/overview.sgml b/docs/overview.xml
similarity index 100%
rename from docs/overview.sgml
rename to docs/overview.xml
diff --git a/meson.build b/meson.build
index f69ab8f..82af328 100644
--- a/meson.build
+++ b/meson.build
@@ -128,3 +128,4 @@ summary('includedir', get_option('includedir'), section: 'Directories')
 summary('libdir', get_option('libdir'), section: 'Directories')
 
 summary('Image processing library', image_library_name, section: 'Build')
+summary('Documentation', get_option('gtk_doc'), section: 'Build', bool_yn: true)
diff --git a/meson_options.txt b/meson_options.txt
index 6169e46..3ef49ba 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,6 @@
 option('image_library', type: 'combo', choices: ['auto', 'gdk-pixbuf', 'qt4', 'qt5'],
        description: 'Which image processing backend to use')
-option('with-docs', type : 'combo', choices : ['auto', 'yes', 'no'], value : 'auto')
+option('gtk_doc',
+  type: 'boolean',
+  value: 'false',
+  description: 'Build the API reference (requires gtk-doc)')


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