# HG changeset patch # User Simon Heimberg # Date 1392884242 -3600 # Node ID 37f3be9d154190f154770aac5e38080f6a80145e # Parent af9d9b7785506f3e2d775e1a78f5cc5922be4089 doc: gendoc.py creates valid output for option descriptions with newlines gendoc.py did not handle the hanging indentation for descriptions. Work around this by joining all in one single line (same as in minirst since previous patch). This problem occurred when translations of option lines were very long. Do not bother the translators with this detail. On a long option description, the translator continued on a new line as usual. gendoc.py created invalid rst syntax like this: -o, --option Description line 1 description line 2 The new output is: -o, --option Description line 1 description line 2 The lines could theoretically become very long, but line breaking is handled when generating the final documentation. diff -r af9d9b778550 -r 37f3be9d1541 doc/gendoc.py --- a/doc/gendoc.py Wed Feb 19 17:32:21 2014 +0100 +++ b/doc/gendoc.py Thu Feb 20 09:17:22 2014 +0100 @@ -50,6 +50,9 @@ allopts[-1] += " <%s[+]>" % optlabel elif (default is not None) and not isinstance(default, bool): allopts[-1] += " <%s>" % optlabel + if '\n' in desc: + # only remove line breaks and indentation + desc = ' '.join(l.lstrip() for l in desc.split('\n')) desc += default and _(" (default: %s)") % default or "" yield (", ".join(allopts), desc)