Commit 2245d856 authored by Carlos Garnacho's avatar Carlos Garnacho

docs: Fix xrefs to glib docs

So we get proper links to glib types.
parent 3c628b30
......@@ -8,4 +8,5 @@ gnome.gtkdoc('libtracker-control',
content_files: ['migrating-1to2.xml'],
dependencies: tracker_control_dep,
gobject_typesfile: 'libtracker-control.types',
fixxref_args: fixxref_args,
install: true)
......@@ -8,4 +8,5 @@ gnome.gtkdoc('libtracker-miner',
content_files: ['overview.sgml', 'migrating-1to2.xml'],
dependencies: tracker_miner_dep,
gobject_typesfile: 'libtracker-miner.types',
fixxref_args: fixxref_args,
install: true)
......@@ -6,7 +6,8 @@ generated = custom_target('base-ontology-doc-generated',
output: 'gen-doc.stamp',
command: [ttl2sgml,
'-d', join_paths(source_root, 'src/ontologies/'),
'-o', join_paths(meson.current_build_dir(), 'xml/')],
'-o', join_paths(meson.current_build_dir(), 'xml/'),
'-e', meson.current_source_dir()],
depends: ttl2sgml,
# FIXME: this shouldn't be necessary, but currently the 'dependencies'
# parameter to gnome.gtkdoc() doesn't actually trigger building of custom
......@@ -33,4 +34,5 @@ gnome.gtkdoc('libtracker-sparql',
content_files: ['overview.sgml', 'examples.sgml', 'ontologies.sgml', 'private-store.xml', 'migrating-1to2.xml', example_files],
dependencies: tracker_sparql_dep,
gobject_typesfile: 'libtracker-sparql.types',
fixxref_args: fixxref_args,
install: true)
glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
docpath = join_paths(datadir, 'gtk-doc', 'html')
fixxref_args = [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
]
subdir('libtracker-control')
subdir('libtracker-miner')
subdir('libtracker-sparql')
......
......@@ -2,22 +2,12 @@ version_xml = configure_file(input: 'version.xml.in',
output: 'version.xml',
configuration: conf)
#for f in `find $ONTOLOGIES_DATA_DIR -name "*.description"` ; do
# # ../../src/ontologies/XX-aaa.description -> PREFIX=aaa
# TMPNAME=${f%.description}
# PREFIX=${TMPNAME#*-}
# echo "- Generating $PREFIX documentation"
#
# $TTL2SGML -d $f -o $BUILD_DIR/$PREFIX-ontology.xml \
# -e $ONTOLOGIES_INFO_DIR/$PREFIX/explanation.xml
generated = custom_target('ontology-doc-generated',
output: 'gen-doc.stamp',
command: [ttl2sgml,
'-d', join_paths(source_root, 'src/ontologies/nepomuk'),
'-o', join_paths(meson.current_build_dir(), 'xml/')],
'-o', join_paths(meson.current_build_dir(), 'xml/'),
'-e', meson.current_source_dir()],
depends: ttl2sgml,
# FIXME: this shouldn't be necessary, but currently the 'dependencies'
# parameter to gnome.gtkdoc() doesn't actually trigger building of custom
......
......@@ -28,6 +28,7 @@
static gchar *ontology_dir = NULL;
static gchar *output_dir = NULL;
static gchar *description_dir = NULL;
static GOptionEntry entries[] = {
{ "ontology-dir", 'd', 0, G_OPTION_ARG_FILENAME, &ontology_dir,
......@@ -38,6 +39,10 @@ static GOptionEntry entries[] = {
"File to write the output (default stdout)",
NULL
},
{ "description-dir", 'e', 0, G_OPTION_ARG_FILENAME, &description_dir,
"Directory to find ontology descriptions",
NULL
},
{ NULL }
};
......@@ -161,7 +166,7 @@ main (gint argc, gchar **argv)
ttl_loader_load_ontology (file_ontology, ttl_file);
ttl_loader_load_prefix_from_description (ontology, description);
ttl_sgml_print (description, file_ontology, ttl_output_file);
ttl_sgml_print (description, file_ontology, ttl_output_file, description_dir);
ttl_loader_free_ontology (file_ontology);
ttl_loader_free_description (description);
......
......@@ -146,10 +146,11 @@ print_ontology_class (Ontology *ontology,
void
ttl_sgml_print (OntologyDescription *description,
Ontology *ontology,
GFile *file)
GFile *file,
const gchar *description_dir)
{
GHashTableIter iter;
gchar *upper_name, *path;
gchar *upper_name, *path, *introduction, *basename;
OntologyClass *def;
FILE *f;
......@@ -160,8 +161,14 @@ ttl_sgml_print (OntologyDescription *description,
upper_name = g_ascii_strup (description->localPrefix, -1);
print_sgml_header (f, description);
g_fprintf (f, "<xi:include href='../%s-introduction.xml'><xi:fallback/></xi:include>",
description->localPrefix);
basename = g_strdup_printf ("%s-introduction.xml", description->localPrefix);
introduction = g_build_filename (description_dir, basename, NULL);
g_free (basename);
if (g_file_test (introduction, G_FILE_TEST_EXISTS)) {
g_fprintf (f, "<xi:include href='%s'><xi:fallback/></xi:include>",
introduction);
}
g_fprintf (f, "<section id='%s-classes'>\n", description->localPrefix);
g_fprintf (f, "<title>%s Ontology Classes</title>\n", upper_name);
......@@ -175,5 +182,6 @@ ttl_sgml_print (OntologyDescription *description,
print_sgml_footer (f);
g_free (upper_name);
g_free (introduction);
fclose (f);
}
......@@ -28,7 +28,8 @@ G_BEGIN_DECLS
void ttl_sgml_print (OntologyDescription *description,
Ontology *ontology,
GFile *file);
GFile *file,
const gchar *description_dir);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment