mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-06 00:10:07 +01:00
21 lines
717 B
Python
21 lines
717 B
Python
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
|
|
output += ("| --- " * 4) + " |\n"
|
|
for message, maps in sorted(mappings.items()):
|
|
# output += "| %s | " % message
|
|
for mode, actions in sorted(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)
|