diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/dox_to_sphinx.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/dox_to_sphinx.py b/scripts/dox_to_sphinx.py index 6058d0dd..e94a79a2 100755 --- a/scripts/dox_to_sphinx.py +++ b/scripts/dox_to_sphinx.py @@ -263,6 +263,9 @@ def dox_to_rst(index, lang, node): if node.tag == "emphasis": return "*%s*" % plain_text(node) + if node.tag == "linebreak": + return "\n\n" + if node.tag == "lsquo": return "‘" @@ -294,7 +297,7 @@ def dox_to_rst(index, lang, node): name = item.find("parameternamelist/parametername") description = item.find("parameterdescription") assert len(description) == 1 - markup += "\n\n:param %s:%s" % ( + markup += "\n\n:param %s: %s" % ( name.text, field_value(dox_to_rst(index, lang, description[0])), ) @@ -321,7 +324,7 @@ def dox_to_rst(index, lang, node): assert len(node) == 1 if node.get("kind") == "return": - return "\n:returns:" + field_value( + return "\n:returns: " + field_value( dox_to_rst(index, lang, node[0]) ) @@ -333,6 +336,9 @@ def dox_to_rst(index, lang, node): if node.tag == "ulink": return "`%s <%s>`_" % (node.text, node.get("url")) + if node.tag == "verbatim": + return "``%s``" % plain_text(node) + raise RuntimeError("Unknown documentation command: %s" % node.tag) @@ -603,9 +609,8 @@ def emit_groups(index, lang, output_dir, force): # Emit symbols in sorted order for name, symbol in child_symbols.items(): - rst.write("\n") + rst.write("\n\n") rst.write(document_markup(index, lang, symbol)) - rst.write("\n") def run(index_xml_path, output_dir, language, force): |