[folks/fix-gtkdoc-errors: 2/2] docs: Fix gtkdoc errors




commit b6497e058f1dc82836f1002b390b60f5b47f5038
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Mon Feb 15 09:39:00 2021 +0100

    docs: Fix gtkdoc errors
    
    By configuring a `gtkdocentities.in`, gtk-doc stops complaining about a
    missing `package_name` and `package_string` entity.

 docs/gtkdoc/folks-dummy/xml/meson.build     | 8 ++++++++
 docs/gtkdoc/folks-eds/xml/meson.build       | 8 ++++++++
 docs/gtkdoc/folks-telepathy/xml/meson.build | 8 ++++++++
 docs/gtkdoc/folks/xml/meson.build           | 8 ++++++++
 docs/gtkdoc/gtkdocentities.ent.in           | 2 ++
 docs/gtkdoc/meson.build                     | 9 ++++++++-
 6 files changed, 42 insertions(+), 1 deletion(-)
---
diff --git a/docs/gtkdoc/folks-dummy/xml/meson.build b/docs/gtkdoc/folks-dummy/xml/meson.build
new file mode 100644
index 00000000..f28b5c83
--- /dev/null
+++ b/docs/gtkdoc/folks-dummy/xml/meson.build
@@ -0,0 +1,8 @@
+configure_file(
+  input: gtkdocentities_in,
+  output: '@BASENAME@',
+  configuration: {
+    'PACKAGE_NAME': doc_name,
+    'PACKAGE_STRING': doc_name + ' ' + meson.project_version(),
+  },
+)
diff --git a/docs/gtkdoc/folks-eds/xml/meson.build b/docs/gtkdoc/folks-eds/xml/meson.build
new file mode 100644
index 00000000..f28b5c83
--- /dev/null
+++ b/docs/gtkdoc/folks-eds/xml/meson.build
@@ -0,0 +1,8 @@
+configure_file(
+  input: gtkdocentities_in,
+  output: '@BASENAME@',
+  configuration: {
+    'PACKAGE_NAME': doc_name,
+    'PACKAGE_STRING': doc_name + ' ' + meson.project_version(),
+  },
+)
diff --git a/docs/gtkdoc/folks-telepathy/xml/meson.build b/docs/gtkdoc/folks-telepathy/xml/meson.build
new file mode 100644
index 00000000..f28b5c83
--- /dev/null
+++ b/docs/gtkdoc/folks-telepathy/xml/meson.build
@@ -0,0 +1,8 @@
+configure_file(
+  input: gtkdocentities_in,
+  output: '@BASENAME@',
+  configuration: {
+    'PACKAGE_NAME': doc_name,
+    'PACKAGE_STRING': doc_name + ' ' + meson.project_version(),
+  },
+)
diff --git a/docs/gtkdoc/folks/xml/meson.build b/docs/gtkdoc/folks/xml/meson.build
new file mode 100644
index 00000000..f28b5c83
--- /dev/null
+++ b/docs/gtkdoc/folks/xml/meson.build
@@ -0,0 +1,8 @@
+configure_file(
+  input: gtkdocentities_in,
+  output: '@BASENAME@',
+  configuration: {
+    'PACKAGE_NAME': doc_name,
+    'PACKAGE_STRING': doc_name + ' ' + meson.project_version(),
+  },
+)
diff --git a/docs/gtkdoc/gtkdocentities.ent.in b/docs/gtkdoc/gtkdocentities.ent.in
new file mode 100644
index 00000000..5d964322
--- /dev/null
+++ b/docs/gtkdoc/gtkdocentities.ent.in
@@ -0,0 +1,2 @@
+<!ENTITY package_name "@PACKAGE_NAME@">
+<!ENTITY package_string "@PACKAGE_STRING@">
diff --git a/docs/gtkdoc/meson.build b/docs/gtkdoc/meson.build
index c756e4d6..f2ccdb87 100644
--- a/docs/gtkdoc/meson.build
+++ b/docs/gtkdoc/meson.build
@@ -1,7 +1,14 @@
+gtkdocentities_in = files('gtkdocentities.ent.in')
+
 # Build the gtkdoc documentation for libfolks and each backend library
 foreach doc_target : valadoc_targets
   doc_name = doc_target.get('name')
 
+  # Meson doesn't allow subdirectories in configure_file, so we have to
+  # generate each gtkdocentities.ent in their respective subfolder, at the
+  # place gtk-doc magically expects it to be
+  subdir(doc_name / 'xml')
+
   doc_gtkdoc = custom_target(doc_name + '-gtkdoc',
     input: doc_target.get('source_files'),
     output: doc_name,
@@ -14,7 +21,7 @@ foreach doc_target : valadoc_targets
       doc_target.get('dependencies'),
       '-X', meson.build_root() / 'folks' / 'folks' / 'folks.h',
       '@INPUT@',
-     ],
+    ],
     depends: doc_target.get('library'),
     install: true,
     install_dir: get_option('datadir') / 'gtk-doc' / 'html',


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