diff options
author | David Robillard <d@drobilla.net> | 2021-10-26 15:19:51 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-28 21:57:29 -0500 |
commit | 3f74afa8c0e60a778566db975894044c67a3b386 (patch) | |
tree | 46f49316c9a2a8098f86b301910fa4221b3d85cf | |
parent | f8a59da9c492b7df38f53ba96505313e931d76cc (diff) | |
download | serd-3f74afa8c0e60a778566db975894044c67a3b386.tar.gz serd-3f74afa8c0e60a778566db975894044c67a3b386.tar.bz2 serd-3f74afa8c0e60a778566db975894044c67a3b386.zip |
Update dox_to_sphinx.py
-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): |