[gtk-doc] mkhtml2: add more tag converters
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] mkhtml2: add more tag converters
- Date: Fri, 30 Mar 2018 20:59:32 +0000 (UTC)
commit 690951f9546761577e814441ab127cecf6c3cd64
Author: Stefan Sauer <ensonic users sf net>
Date: Fri Mar 30 22:52:26 2018 +0200
mkhtml2: add more tag converters
Handle: code, command, filename, option, quote, symbol, synopsis and term.
gtkdoc/mkhtml2.py | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/gtkdoc/mkhtml2.py b/gtkdoc/mkhtml2.py
index 66c40c9..43553dc 100644
--- a/gtkdoc/mkhtml2.py
+++ b/gtkdoc/mkhtml2.py
@@ -346,6 +346,17 @@ def convert_blockquote(ctx, xml):
return result
+def convert_code(ctx, xml):
+ result = ['<code class="%s">' % xml.tag]
+ if xml.text:
+ result.append(xml.text)
+ convert_inner(ctx, xml, result)
+ result.append('</code>')
+ if xml.tail:
+ result.append(xml.tail)
+ return result
+
+
def convert_colspec(ctx, xml):
result = ['<col']
a = xml.attrib
@@ -358,6 +369,17 @@ def convert_colspec(ctx, xml):
return result
+def convert_command(ctx, xml):
+ result = ['<span class="command"><strong>']
+ if xml.text:
+ result.append(xml.text)
+ convert_inner(ctx, xml, result)
+ result.append('</strong></span>')
+ if xml.tail:
+ result.append(xml.tail)
+ return result
+
+
def convert_corpauthor(ctx, xml):
result = ['<div><h3 class="corpauthor">\n']
if xml.text:
@@ -667,6 +689,17 @@ def convert_programlisting(ctx, xml):
return result
+def convert_quote(ctx, xml):
+ result = ['<span class="quote">"<span class="quote">']
+ if xml.text:
+ result.append(xml.text)
+ convert_inner(ctx, xml, result)
+ result.append('</span>"</span>')
+ if xml.tail:
+ result.append(xml.tail)
+ return result
+
+
def convert_refsect1(ctx, xml):
# Add a divider between two consequitive refsect2
def convert_inner(ctx, xml, result):
@@ -752,11 +785,14 @@ convert_tags = {
'bookinfo': convert_bookinfo,
'blockquote': convert_blockquote,
'caption': convert_div,
+ 'code': convert_code,
'colspec': convert_colspec,
+ 'command': convert_command,
'corpauthor': convert_corpauthor,
'emphasis': convert_span,
'entry': convert_entry,
'footnote': convert_footnote,
+ 'filename': convert_literal,
'function': convert_span,
'glossdef': convert_glossdef,
'glossdiv': convert_glossdiv,
@@ -776,12 +812,14 @@ convert_tags = {
'literal': convert_literal,
'mediaobject': convert_div,
'note': convert_div,
+ 'option': convert_literal,
'orderedlist': convert_orderedlist,
'para': convert_para,
'parameter': convert_em_class,
'phrase': convert_phrase,
'primaryie': convert_primaryie,
'programlisting': convert_programlisting,
+ 'quote': convert_quote,
'releaseinfo': convert_para_like,
'refsect1': convert_refsect1,
'refsect2': convert_refsect2,
@@ -792,8 +830,11 @@ convert_tags = {
'screen': convert_pre,
'simpara': convert_simpara,
'structfield': convert_em_class,
+ 'synopsis': convert_pre,
+ 'symbol': convert_span,
'tbody': convert_tbody,
'tgroup': convert_tgroup,
+ 'term': convert_span,
'type': convert_span,
'ulink': convert_ulink,
'warning': convert_div,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]