diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2018-01-14 13:14:23 +0100 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2018-01-14 13:14:23 +0100 |
commit | f9fb66216b80eee39c58b8fc0aa2a5515deb4e77 (patch) | |
tree | fb1085a31b3d7200615f0e94e0c9de1f6cb4a4c7 /tools | |
parent | 2c4a0499d83edc230c5bb1897d918c112a522210 (diff) | |
download | gtk-doc-f9fb66216b80eee39c58b8fc0aa2a5515deb4e77.tar.gz |
db2html: add more tags
Cover lists and informalexample.
Diffstat (limited to 'tools')
-rw-r--r-- | 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, |