Layout fixes for wiki parameter documentation.

- Replace newlines in names and comments with a space.
- Right align min/max/default values.
This commit is contained in:
Stefan Rado 2014-02-14 02:21:24 +01:00
parent 7441efde47
commit ed3ffc26d6
1 changed files with 26 additions and 20 deletions

View File

@ -19,34 +19,40 @@ class DokuWikiOutput(output.Output):
for group in groups:
result += "==== %s ====\n\n" % group.GetName()
result += "|< 100% 20% 20% 10% 10% 10% 30%>|\n"
result += "^ Name ^ Description ^ Min ^ Max ^ Default ^ Comment ^\n"
result += "^ Name ^ Description ^ Min ^ Max ^ Default ^ Comment ^\n"
for param in group.GetParams():
code = param.GetFieldValue("code")
name = param.GetFieldValue("short_desc")
name = name.replace("\n", "")
result += "| %s | %s " % (code, name)
min_val = param.GetFieldValue("min")
if min_val is not None:
result += " | %s " % min_val
else:
result += " | "
max_val = param.GetFieldValue("max")
if max_val is not None:
result += " | %s " % max_val
else:
result += " | "
def_val = param.GetFieldValue("default")
if def_val is not None:
result += "| %s " % def_val
else:
result += " | "
long_desc = param.GetFieldValue("long_desc")
if long_desc is not None:
long_desc = long_desc.replace("\n", "")
result += "| %s " % long_desc
name = name.replace("\n", " ")
result += "| %s | %s |" % (code, name)
if min_val is not None:
result += " %s |" % min_val
else:
result += " | "
result += " |\n"
result += " |"
if max_val is not None:
result += " %s |" % max_val
else:
result += " |"
if def_val is not None:
result += " %s |" % def_val
else:
result += " |"
if long_desc is not None:
long_desc = long_desc.replace("\n", " ")
result += " %s |" % long_desc
else:
result += " |"
result += "\n"
result += "\n"
post_text = """</string>
</value>