INNER CODE UNIT · Python
render_table
toyota-connected/ivi-homescreen · scripts/gen_config_reference.py:319
def render_table(rows):
# Escape '|' so it doesn't split the markdown table cell, and wrap the
# type/values cells in backticks so '<...>' isn't read as HTML.
def cell(s):
return "`" + s.replace("|", "\\|") + "`"
out = [
"| table | key | type | default | values | applies to |",
"|---|---|---|---|---|---|",
]
for table in TABLE_ORDER:
for name, typ, default, values, applies, desc, _ in rows[table]:
out.append(f"| `{table}` | `{name}` | {cell(typ)} | {cell(default)} "
f"| {cell(values)} | {applies} |")
return "\n".join(out)
def render_reftoml(rows):