[tracker/sam/ontology-docs-xml: 1/2] docs: Update ontology docs to Docbook XML 4.5
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/sam/ontology-docs-xml: 1/2] docs: Update ontology docs to Docbook XML 4.5
- Date: Tue, 25 Feb 2020 12:18:56 +0000 (UTC)
commit 8a99f6fec6c0c48d18fbb67e9b217bdf7a9230a7
Author: Sam Thursfield <sam afuera me uk>
Date: Tue Feb 25 13:16:50 2020 +0100
docs: Update ontology docs to Docbook XML 4.5
We were already using this with other reference docs, but the ontology
docs are a little more tricky as we generate them using a C program.
docs/reference/libtracker-sparql/meson.build | 4 ++--
docs/reference/ontology/meson.build | 6 +++---
.../ontology/{ontology-docs.sgml => ontology-docs.xml} | 6 +++---
docs/tools/meson.build | 6 +++---
docs/tools/{ttl2sgml.c => ttl2xml.c} | 6 +++---
docs/tools/{ttl_sgml.c => ttl_xml.c} | 18 +++++++++---------
docs/tools/{ttl_sgml.h => ttl_xml.h} | 12 ++++++------
docs/tools/{ttlresource2sgml.c => ttlresource2xml.c} | 12 ++++++------
docs/tools/{ttlresource2sgml.h => ttlresource2xml.h} | 6 +++---
9 files changed, 38 insertions(+), 38 deletions(-)
---
diff --git a/docs/reference/libtracker-sparql/meson.build b/docs/reference/libtracker-sparql/meson.build
index 2d50d78f4..7833617cd 100644
--- a/docs/reference/libtracker-sparql/meson.build
+++ b/docs/reference/libtracker-sparql/meson.build
@@ -4,11 +4,11 @@ version_xml = configure_file(input: 'version.xml.in',
generated = custom_target('base-ontology-doc-generated',
output: 'gen-doc.stamp',
- command: [ttl2sgml,
+ command: [ttl2xml,
'-d', join_paths(source_root, 'src/ontologies/'),
'-o', join_paths(meson.current_build_dir(), 'xml/'),
'-e', meson.current_source_dir()],
- depends: ttl2sgml,
+ depends: ttl2xml,
depend_files: base_ontology,
build_by_default: true,
)
diff --git a/docs/reference/ontology/meson.build b/docs/reference/ontology/meson.build
index ee2f9e929..e4813c449 100644
--- a/docs/reference/ontology/meson.build
+++ b/docs/reference/ontology/meson.build
@@ -4,16 +4,16 @@ version_xml = configure_file(input: 'version.xml.in',
generated = custom_target('ontology-doc-generated',
output: 'gen-doc.stamp',
- command: [ttl2sgml,
+ command: [ttl2xml,
'-d', join_paths(source_root, 'src/ontologies/nepomuk'),
'-o', join_paths(meson.current_build_dir(), 'xml/'),
'-e', meson.current_source_dir()],
- depends: ttl2sgml,
+ depends: ttl2xml,
depend_files: nepomuk,
build_by_default: true,
)
gnome.gtkdoc('ontology',
src_dir: include_directories('.'),
- main_sgml: 'ontology-docs.sgml',
+ main_xml: 'ontology-docs.xml',
install: true)
diff --git a/docs/reference/ontology/ontology-docs.sgml b/docs/reference/ontology/ontology-docs.xml
similarity index 94%
rename from docs/reference/ontology/ontology-docs.sgml
rename to docs/reference/ontology/ontology-docs.xml
index 8a7efbc57..463bf4e17 100644
--- a/docs/reference/ontology/ontology-docs.sgml
+++ b/docs/reference/ontology/ontology-docs.xml
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
-<book id="index">
+<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
<title>Tracker Ontology Reference Manual</title>
<releaseinfo>
diff --git a/docs/tools/meson.build b/docs/tools/meson.build
index 7be6dd7ea..e3672fe2c 100644
--- a/docs/tools/meson.build
+++ b/docs/tools/meson.build
@@ -3,9 +3,9 @@
ttl_loader_files = [
'ttl_loader.c',
'ttl_model.c',
- 'ttl_sgml.c',
+ 'ttl_xml.c',
]
-ttl2sgml = executable('ttl2sgml',
- ttl_loader_files, 'ttl2sgml.c', 'ttlresource2sgml.c',
+ttl2xml = executable('ttl2xml',
+ ttl_loader_files, 'ttl2xml.c', 'ttlresource2xml.c',
dependencies: [tracker_data_dep, tracker_sparql_dep])
diff --git a/docs/tools/ttl2sgml.c b/docs/tools/ttl2xml.c
similarity index 97%
rename from docs/tools/ttl2sgml.c
rename to docs/tools/ttl2xml.c
index 7acf53482..e22b4fef0 100644
--- a/docs/tools/ttl2sgml.c
+++ b/docs/tools/ttl2xml.c
@@ -23,8 +23,8 @@
#include <stdio.h>
#include "ttl_loader.h"
#include "ttl_model.h"
-#include "ttl_sgml.h"
-#include "ttlresource2sgml.h"
+#include "ttl_xml.h"
+#include "ttlresource2xml.h"
static gchar *ontology_dir = NULL;
static gchar *output_dir = NULL;
@@ -166,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, description_dir);
+ ttl_xml_print (description, file_ontology, ttl_output_file, description_dir);
ttl_loader_free_ontology (file_ontology);
ttl_loader_free_description (description);
diff --git a/docs/tools/ttl_sgml.c b/docs/tools/ttl_xml.c
similarity index 92%
rename from docs/tools/ttl_sgml.c
rename to docs/tools/ttl_xml.c
index 7f08ca4d8..44d10379c 100644
--- a/docs/tools/ttl_sgml.c
+++ b/docs/tools/ttl_xml.c
@@ -19,7 +19,7 @@
#include <glib/gprintf.h>
-#include "ttl_sgml.h"
+#include "ttl_xml.h"
typedef struct {
Ontology *ontology;
@@ -87,17 +87,17 @@ print_deprecated_message (FILE *f)
#endif
static void
-print_sgml_header (FILE *f, OntologyDescription *desc)
+print_xml_header (FILE *f, OntologyDescription *desc)
{
gchar *upper_name;
g_fprintf (f, "<?xml version='1.0' encoding='UTF-8'?>\n");
- g_fprintf (f, "<!DOCTYPE book PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\"\n"
- " \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\" [\n");
+ g_fprintf (f, "<!DOCTYPE book PUBLIC \"-//OASIS//DTD DocBook XML V4.5//EN\"\n"
+ " \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\" [\n");
g_fprintf (f, "<!ENTITY %% local.common.attrib \"xmlns:xi CDATA #FIXED
'http://www.w3.org/2003/XInclude'\">\n");
g_fprintf (f, "]>");
- g_fprintf (f, "<chapter id='%s-ontology'>\n", desc->localPrefix);
+ g_fprintf (f, "<chapter id='%s-ontology' xmlns:xi=\"http://www.w3.org/2003/XInclude\">\n",
desc->localPrefix);
upper_name = g_ascii_strup (desc->localPrefix, -1);
g_fprintf (f, "<title>%s: %s</title>\n", desc->title, desc->description ? desc->description : "");
@@ -121,7 +121,7 @@ print_sgml_header (FILE *f, OntologyDescription *desc)
}
static void
-print_sgml_footer (FILE *f)
+print_xml_footer (FILE *f)
{
g_fprintf (f,"</chapter>\n");
}
@@ -144,7 +144,7 @@ print_ontology_class (Ontology *ontology,
}
void
-ttl_sgml_print (OntologyDescription *description,
+ttl_xml_print (OntologyDescription *description,
Ontology *ontology,
GFile *file,
const gchar *description_dir)
@@ -160,7 +160,7 @@ ttl_sgml_print (OntologyDescription *description,
g_free (path);
upper_name = g_ascii_strup (description->localPrefix, -1);
- print_sgml_header (f, description);
+ print_xml_header (f, description);
basename = g_strdup_printf ("%s-introduction.xml", description->localPrefix);
introduction = g_build_filename (description_dir, basename, NULL);
@@ -180,7 +180,7 @@ ttl_sgml_print (OntologyDescription *description,
}
g_fprintf (f, "</section>\n");
- print_sgml_footer (f);
+ print_xml_footer (f);
g_free (upper_name);
g_free (introduction);
diff --git a/docs/tools/ttl_sgml.h b/docs/tools/ttl_xml.h
similarity index 77%
rename from docs/tools/ttl_sgml.h
rename to docs/tools/ttl_xml.h
index 6558d6929..f22745621 100644
--- a/docs/tools/ttl_sgml.h
+++ b/docs/tools/ttl_xml.h
@@ -17,8 +17,8 @@
* 02110-1301, USA.
*/
-#ifndef __TTL_SGML_H__
-#define __TTL_SGML_H__
+#ifndef __TTL_XML_H__
+#define __TTL_XML_H__
#include <gio/gio.h>
#include "ttl_model.h"
@@ -26,10 +26,10 @@
G_BEGIN_DECLS
-void ttl_sgml_print (OntologyDescription *description,
- Ontology *ontology,
- GFile *file,
- const gchar *description_dir);
+void ttl_xml_print (OntologyDescription *description,
+ Ontology *ontology,
+ GFile *file,
+ const gchar *description_dir);
G_END_DECLS
diff --git a/docs/tools/ttlresource2sgml.c b/docs/tools/ttlresource2xml.c
similarity index 99%
rename from docs/tools/ttlresource2sgml.c
rename to docs/tools/ttlresource2xml.c
index fe8b6f42b..e5139583e 100644
--- a/docs/tools/ttlresource2sgml.c
+++ b/docs/tools/ttlresource2xml.c
@@ -24,8 +24,8 @@
#include <gio/gio.h>
#include "ttl_loader.h"
#include "ttl_model.h"
-#include "ttl_sgml.h"
-#include "ttlresource2sgml.h"
+#include "ttl_xml.h"
+#include "ttlresource2xml.h"
#define TRACKER_ONTOLOGY_CLASS "http://www.tracker-project.org/ontologies/tracker#Ontology"
@@ -75,7 +75,7 @@ class_get_hierarchy (Ontology *ontology,
}
static void
-print_sgml_header (FILE *f,
+print_xml_header (FILE *f,
OntologyClass *klass,
Ontology *ontology)
{
@@ -111,7 +111,7 @@ print_sgml_header (FILE *f,
}
static void
-print_sgml_footer (FILE *f)
+print_xml_footer (FILE *f)
{
g_fprintf (f, "</refentry>\n");
}
@@ -667,12 +667,12 @@ generate_class_docs (OntologyClass *klass,
Ontology *ontology,
FILE *f)
{
- print_sgml_header (f, klass, ontology);
+ print_xml_header (f, klass, ontology);
print_class_hierarchy (f, klass, ontology);
print_predefined_instances (f, klass, ontology);
print_fts_properties (f, klass, ontology);
print_properties (f, klass, ontology);
- print_sgml_footer (f);
+ print_xml_footer (f);
}
void
diff --git a/docs/tools/ttlresource2sgml.h b/docs/tools/ttlresource2xml.h
similarity index 91%
rename from docs/tools/ttlresource2sgml.h
rename to docs/tools/ttlresource2xml.h
index 2a7dfc57d..546ca8b9b 100644
--- a/docs/tools/ttlresource2sgml.h
+++ b/docs/tools/ttlresource2xml.h
@@ -19,8 +19,8 @@
* Author: Carlos Garnacho <carlosg gnome org>
*/
-#ifndef __TTLRESOURCE2SGML_H__
-#define __TTLRESOURCE2SGML_H__
+#ifndef __TTLRESOURCE2XML_H__
+#define __TTLRESOURCE2XML_H__
#include <glib.h>
#include "ttl_model.h"
@@ -32,4 +32,4 @@ void generate_ontology_class_docs (Ontology *ontology,
G_END_DECLS
-#endif /* __TTLRESOURCE2SGML__ */
+#endif /* __TTLRESOURCE2XML__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]