[gtk-doc] db2html: add more tags



commit f9fb66216b80eee39c58b8fc0aa2a5515deb4e77
Author: Stefan Sauer <ensonic users sf net>
Date:   Sun Jan 14 13:14:23 2018 +0100

    db2html: add more tags
    
    Cover lists and informalexample.

 tools/db2html.py |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/tools/db2html.py b/tools/db2html.py
index f5e0381..e528b6c 100644
--- a/tools/db2html.py
+++ b/tools/db2html.py
@@ -224,9 +224,21 @@ def convert_refsect(xml, h_tag, inner_func=convert__inner):
         result += xml.tail
     return result
 
+
 # docbook tags
 
 
+def convert_div(xml):
+    result = '<div class="%s">\n' % xml.tag
+    if xml.text:
+        result += xml.text
+    result += convert__inner(xml)
+    result += '</div>'
+    if xml.tail:
+        result += xml.tail
+    return result
+
+
 def convert_em_class(xml):
     result = '<em class="%s"><code>' % xml.tag
     if xml.text:
@@ -238,6 +250,17 @@ def convert_em_class(xml):
     return result
 
 
+def convert_itemizedlist(xml):
+    result = '<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">'
+    if xml.text:
+        result += xml.text
+    result += convert__inner(xml)
+    result += '</ul></div>'
+    if xml.tail:
+        result += xml.tail
+    return result
+
+
 def convert_link(xml):
     # TODO: inline fixxref functionality
     # TODO: need to build an 'id' map and resolve against internal links too
@@ -251,6 +274,17 @@ def convert_link(xml):
     return result
 
 
+def convert_listitem(xml):
+    result = '<li class="listitem">'
+    if xml.text:
+        result += xml.text
+    result += convert__inner(xml)
+    result += '</li>'
+    if xml.tail:
+        result += xml.tail
+    return result
+
+
 def convert_literal(xml):
     result = '<code class="%s">' % xml.tag
     if xml.text:
@@ -345,7 +379,10 @@ def convert_ulink(xml):
 convert_tags = {
     'function': convert_span,
     'indexterm': convert_ignore,
+    'informalexample': convert_div,
+    'itemizedlist': convert_itemizedlist,
     'link': convert_link,
+    'listitem': convert_listitem,
     'literal': convert_literal,
     'para': convert_para,
     'parameter': convert_em_class,


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