[tracker/wip/carlosg/hotdoc: 2/3] docs: Add dummy ontology to introspect the builtin one




commit f18e5d7520c994e22794ec333d71a2d89d0c1f91
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Aug 19 14:52:55 2021 +0200

    docs: Add dummy ontology to introspect the builtin one
    
    Since the builtin ontology is already loaded by default, pointing
    the doc tool to src/ontology again is full of duplicate definitions.
    Make this use a dummy ontology that adds nothing, to avoid the
    harmless but noisy output.

 docs/reference/libtracker-sparql/meson.build |  1 -
 docs/tools/dsc-ontology.gresource.xml        |  3 ++-
 docs/tools/dummy/dummy.ontology              |  1 +
 docs/tools/tracker-main.c                    | 10 +++++++---
 4 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/docs/reference/libtracker-sparql/meson.build b/docs/reference/libtracker-sparql/meson.build
index 72c9eda75..3e2f90026 100644
--- a/docs/reference/libtracker-sparql/meson.build
+++ b/docs/reference/libtracker-sparql/meson.build
@@ -21,7 +21,6 @@ base_ontology_docs = custom_target('ontology-docgen',
     output: ['dc-ontology.md'],
     command: [tracker_docgen,
               '--md',
-              '-d', join_paths(source_root, 'src/ontologies/'),
               '-o', join_paths(meson.current_build_dir())],
     depends: tracker_docgen,
     depend_files: [base_ontology],
diff --git a/docs/tools/dsc-ontology.gresource.xml b/docs/tools/dsc-ontology.gresource.xml
index c5f9b176f..3ac2ad866 100644
--- a/docs/tools/dsc-ontology.gresource.xml
+++ b/docs/tools/dsc-ontology.gresource.xml
@@ -1,5 +1,6 @@
 <gresources>
-  <gresource prefix="/org/freedesktop/tracker/doctool">
+  <gresource prefix="/org/freedesktop/tracker/doctool/">
     <file>ontology/10-dsc.ontology</file>
+    <file>dummy/dummy.ontology</file>
   </gresource>
 </gresources>
diff --git a/docs/tools/dummy/dummy.ontology b/docs/tools/dummy/dummy.ontology
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/docs/tools/dummy/dummy.ontology
@@ -0,0 +1 @@
+
diff --git a/docs/tools/tracker-main.c b/docs/tools/tracker-main.c
index c86e6090b..69005dd6c 100644
--- a/docs/tools/tracker-main.c
+++ b/docs/tools/tracker-main.c
@@ -83,11 +83,11 @@ main (gint argc, gchar **argv)
                return -1;
        }
 
-       if (!ontology_dir || !output_dir) {
+       if (!output_dir) {
                gchar *help;
 
                g_printerr ("%s\n\n",
-                           "Ontology and output dirs are mandatory");
+                           "Output dirs is mandatory");
 
                help = g_option_context_get_help (context, TRUE, NULL);
                g_option_context_free (context);
@@ -97,7 +97,11 @@ main (gint argc, gchar **argv)
                return -1;
        }
 
-       ontology_file = g_file_new_for_commandline_arg (ontology_dir);
+       if (!ontology_dir)
+               ontology_file = g_file_new_for_uri ("resource:///org/freedesktop/tracker/doctool/dummy");
+       else
+               ontology_file = g_file_new_for_commandline_arg (ontology_dir);
+
        output_file = g_file_new_for_commandline_arg (output_dir);
 
        model = tracker_ontology_model_new (ontology_file, &error);


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