Open colemanw opened 1 year ago
Markdown compat is a neat idea
FWIW, the table is rendered using Symfony's Table
helper:
My guess is that either (a) there's some kind of existing "style"/renderer for Markdown or (b) you could tune options like setDefaultCrossingChar('|')
to make a Markdown-friendly layout. The main thing to look out for is line-wrapping data -- iirc, Markdown's text doesn't really allow wrapping. This would be a colorful demonstration where I think they diverge:
cv api4 MessageTemplate.get -T +s id,msg_html +l 2
There are a few alternate possibilities:
table
output to use that.*.md
.--out=md
) optimized for Markdown. (This might allow for other adaptations, like backtick escaping?)
What would it take for the table output to be compatible with markdown? That seems like a more useful format?
Currently the table output looks like this:
Which is nice-looking ascii art, but when you paste it into GitLab, GitHub or any other type of markdown document, it looks like this:
+-------+----------------+----------------+ | value | name | label | +-------+----------------+----------------+ | 1 | Completed | Completed | | 2 | Pending | Pending | | 3 | Cancelled | Cancelled | | 4 | Failed | Failed | | 7 | Refunded | Refunded | | 8 | Partially paid | Partially paid | | 9 | Pending refund | Pending refund | | 10 | Chargeback | Chargeback | | 11 | Template | Template | +-------+----------------+----------------+