[tracker/sam/ontology-docs: 17/22] docs: Add synopsis section



commit 6435c7489e80cf81bade7c9cddbb35779a99d176
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: &lt;%s&gt;\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]