[devhelp/ebassi/gidocgen: 26/28] Add top-level 'doc' directory under data directories




commit 18a07f0022201ed8bd7858d112b18a0ee8f985ea
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Apr 7 13:17:05 2021 +0100

    Add top-level 'doc' directory under data directories
    
    We should look for DevHelp books under XDG_DATA_DIRS/doc,
    XDG_DATA_HOME/doc, and the Flatpak host /usr/share/doc directories. Not
    every API reference is built with gtk-doc, or installed under the
    DevHelp directory.
    
    Fixes: #29

 devhelp/dh-book-list-builder.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/devhelp/dh-book-list-builder.c b/devhelp/dh-book-list-builder.c
index 0936e1b7..09c64446 100644
--- a/devhelp/dh-book-list-builder.c
+++ b/devhelp/dh-book-list-builder.c
@@ -121,6 +121,10 @@ add_default_sub_book_lists_in_data_dir (DhBookListBuilder *builder,
 
         g_return_if_fail (data_dir != NULL);
 
+        dir = g_build_filename (data_dir, "doc", NULL);
+        add_book_list_directory (builder, dir);
+        g_free (dir);
+
         dir = g_build_filename (data_dir, "gtk-doc", "html", NULL);
         add_book_list_directory (builder, dir);
         g_free (dir);
@@ -139,9 +143,11 @@ add_default_sub_book_lists_in_data_dir (DhBookListBuilder *builder,
  *
  * It creates and adds a #DhBookListDirectory for the following directories (in
  * that order):
+ * - `$XDG_DATA_HOME/doc/`
  * - `$XDG_DATA_HOME/gtk-doc/html/`
  * - `$XDG_DATA_HOME/devhelp/books/`
  * - For each directory in `$XDG_DATA_DIRS`:
+ *   - `$xdg_data_dir/doc/`
  *   - `$xdg_data_dir/gtk-doc/html/`
  *   - `$xdg_data_dir/devhelp/books/`
  *
@@ -150,6 +156,7 @@ add_default_sub_book_lists_in_data_dir (DhBookListBuilder *builder,
  * Additionally, if the libdevhelp has been compiled with the `flatpak_build`
  * option, it creates and adds a #DhBookListDirectory for the following
  * directories (in that order, after the above ones):
+ * - `/run/host/usr/share/doc/`
  * - `/run/host/usr/share/gtk-doc/html/`
  * - `/run/host/usr/share/devhelp/books/`
  *


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