Option to render human-friendly tables
When rendering a markdown table, this crate strips all the padding whitespace in table cells and sets the header rule to the same width as the respective header:
|Here is a header|Another header|
|:---------------|:-------------|
|foo|bar|
|quux|baz|
|something really long||
This is valid markdown for representing the table, but it's not very human-friendly. It would be nice if there were an option to have cell whitespace padding and for each column to have a uniform width (i.e., the maximum width of the cells in that column + padding). So we'd get output like this:
| Here is a header | Another header |
| :-------------------- | :------------- |
| foo | bar |
| quux | baz |
| something really long | |
These tables are equivalent, but the latter is much easier to read.
I think this might not be straightforward as the values it sees are already stripped.
However, it does have a way of accessing the original buffer which would allow figuring out the original whitespaces, which then could be re-added.
Is there any need to be faithful to the input, insofar as layout is concerned? My understanding is that the padding whitespace in Markdown tables are semantically inert.
I think this is addressed above, but it's worth highlighting here.
This is valid markdown for representing the table, but it's not very human-friendly.
It's one advantage of markdown to read well and look good in editors with ascii-only display, but this is only true for tables that are indented nicely. While cumbersome to do by hand, when the indentation is available, I think there is a lot of value in keeping it.