[gtk-doc] mkhtml2: add tag converter for acronym



commit 6d7a12625a07803f68bbb3a093494c32cf328f1f
Author: Stefan Sauer <ensonic users sf net>
Date:   Sun Mar 25 20:04:09 2018 +0200

    mkhtml2: add tag converter for acronym
    
    This still needs the whole glossary handling, but at least we get the text.

 gtkdoc/mkhtml2.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtkdoc/mkhtml2.py b/gtkdoc/mkhtml2.py
index 2832e39..62931a4 100644
--- a/gtkdoc/mkhtml2.py
+++ b/gtkdoc/mkhtml2.py
@@ -279,6 +279,17 @@ def xml_get_title(xml):
 
 # docbook tags
 
+
+def convert_acronym(ctx, xml):
+    # TODO: resolve title from glossaries (key=glossentry/glossterm, value=glossentry/glossdef)
+    # print a sensible warning if missing
+    title='?'
+    result = ['<acronym title="%s"><span class="acronym">%s</span></acronym>' % (title, xml.text)]
+    if xml.tail:
+        result.append(xml.tail)
+    return result
+
+
 def convert_bookinfo(ctx, xml):
     result = ['<div class="titlepage">']
     convert_inner(ctx, xml, result)
@@ -612,6 +623,7 @@ def convert_ulink(ctx, xml):
 
 # TODO(ensonic): turn into class with converters as functions and ctx as self
 convert_tags = {
+    'acronym': convert_acronym,
     'bookinfo': convert_bookinfo,
     'blockquote': convert_blockquote,
     'colspec': convert_colspec,


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