generate docs of the mappings

This commit is contained in:
Tristan Rowley
2020-01-10 19:16:52 +00:00
parent 794a794847
commit 2e441a82b8
3 changed files with 286 additions and 1 deletions

22
utils/docs.py Normal file
View File

@@ -0,0 +1,22 @@
def generate_mappings_doc(title, mappings, column_one_header="Note/CC"):
#print(mappings)
output = ""
output += "# %s\n" % title
output += "\n| %s | Mode | Action (default) | Action (with FN) | \n" % column_one_header
for message, maps in sorted(mappings.items()):
#output += "| %s | " % message
for mode, actions in maps.items():
output += "| "
output += "%s\t| " % message
output += "%s\t| " % mode
output += "%s | " % actions[0]
if len(actions)>1:
output += "%s | " % actions[1]
output += "|\n"
output += "\n----\n"
print(output)