[tracker/sam/ontology-docs: 16/25] docs: Add synopsis section
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/sam/ontology-docs: 16/25] docs: Add synopsis section
- Date: Fri, 17 Apr 2020 00:48:22 +0000 (UTC)
commit b62121fdb9d53a2266272318c0eef602b9623969
Author: Sam Thursfield <sam afuera me uk>
Date: Sun Apr 12 21:13:58 2020 +0200
docs: Add synopsis section
This is just a line showing the Turtle @prefix statement to use.
It provides a nice summary of the base URL and prefix.
docs/tools/ttl_xml.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/docs/tools/ttl_xml.c b/docs/tools/ttl_xml.c
index ef185e137..0aab96a61 100644
--- a/docs/tools/ttl_xml.c
+++ b/docs/tools/ttl_xml.c
@@ -178,6 +178,17 @@ get_extra_properties (GList *classes,
return extra_properties;
}
+static void
+print_synopsis (FILE *f,
+ OntologyDescription *desc)
+{
+ g_fprintf (f, "<refsynopsisdiv>\n");
+ g_fprintf (f, "<synopsis>\n");
+ g_fprintf (f, "@prefix %s: <%s>\n", desc->localPrefix, desc->baseUrl);
+ g_fprintf (f, "</synopsis>\n");
+ g_fprintf (f, "</refsynopsisdiv>\n");
+}
+
static void
print_toc_classes (FILE *f,
Ontology *ontology,
@@ -277,6 +288,7 @@ ttl_xml_print (OntologyDescription *description,
print_xml_header (f, description);
+ print_synopsis (f, description);
print_toc_classes (f, ontology, description->localPrefix, classes);
print_toc_extra_properties (f, ontology, description->localPrefix, extra_properties);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]