mofo syne
2014-Sep-05 09:28 UTC
On simplifying table syntax in any future markdown extension. (Use CSV)
Tables are used very often to help explain information that would requires multiple paragraphs into a clear concise 2d layout. The issue with making this feature optional means it won't be fully widespread. And stuff like tables and anchors are common enough to be a core standard. A common complaint I understand about tables in markdown variants that attempts to implement this, is that it is hard to maintain. So here is some ways I think it can be simplified from "Markdown Extra" syntax for this effort. This is Markdown Extra Syntax for tables: | Item | Value | | --------- | -----:| | Computer | $1600 | | Phone | $12 | First example (Compress the pipe headers): To indicate a field is a header you use |-, -| . For header alignment: |:- left aligned -|, |- right aligned -:| |:- Centre aligned -:| . |:- Header -:|:- Header -:| | Row | Row | | Row | Row | Second Example ( CSV Input): The second issue, is that people find it hard to have to deal with formatting the pipes. If alignment of cell data is of no concern to the user, then we should use CSV data as the inspiration. I'm a big fan of CSV data, due to how easy it is to type. The ease of use comes from sticking to csv which most people use already, and combining it with a simplified table header. If you still need alignment control for each cell, then you can just use the previous (but simplified) pipe tables shown above using |:, :| |:- Year -|:- Make -|:- Model -:| 1997, Ford, E350 1999, Chevy, "Venture ""Extended Edition""" 1999, Chevy, "Venture ""Extended Edition""" 1996, Jeep, Grand Cherokee This is some other text, since the end of a table is implied by a new paragraph. example data from: http://en.wikipedia.org/wiki/Comma-separated_values Essentially, just treat pipes as 'optional' for the actual cell data (which is the field that gets modified most often anyway (compared to the header). This way, we can avoid too much formatting, and heck if you are lazy, you could just remove whitespaces and it shall still be very maintainable like so: |:- Year -|:- Make -|:- Model -:| 1997, Ford, E350 1999, Chevy, "Venture ""Extended Edition"" " 1999, Chevy, "Venture ""Extended Edition"" " 1996, Jeep, Grand Cherokee The second approach is my preference. Since I believe markdown is about getting formatting out of the way of your writing.
Waylan Limberg
2014-Sep-05 12:24 UTC
On simplifying table syntax in any future markdown extension. (Use CSV)
> On Sep 5, 2014, at 5:28 AM, mofo syne <mofosyne at gmail.com> wrote: > > The second issue, is that people find it hard to have to deal with > formatting the pipes. If alignment of cell data is of no concern to > the user, then we should use CSV data as the inspiration.I've long been (openly) of the opinion that tables are not prose, and therefore do not belong in markdown - except to fall back to raw HTML (see the philosophy section of the syntax rules). On the other hand, I recognize that sometimes a simple, unstyled table of simple tabular data has it's place and having to revert to raw HTML is a little much. So, CSV -- I like it. Plain, raw cvs gets converted to a table. That is something I might be able to get behind. Not sure I like your headers though. Why can't they be comma separated as well? Perhaps one character (at the beginning of the first line) could identify that line as a header. Without that character, then you get no header. Yes, that means you loose any ability to style, but I'm okay with that -- use raw HTML if you want more control. Waylan Limberg
Michel Fortin
2014-Sep-05 12:57 UTC
On simplifying table syntax in any future markdown extension. (Use CSV)
Le 5-sept.-2014 ? 5:28, mofo syne <mofosyne at gmail.com> a ?crit :> |:- Year -|:- Make -|:- Model -:| > 1997, Ford, E350 > 1999, Chevy, "Venture ""Extended Edition"" " > 1999, Chevy, "Venture ""Extended Edition"" " > 1996, Jeep, Grand CherokeeDoesn't make much sense to me. I mean, it doesn't look too bad until you get to the quoted text part and have to escape quotes using a CSV-style double-quote escape instead of the Markdown-style backslash. Also, quoting the whole value is required in CSV anytime you have a comma in one of your cell which isn't a rare occurrence. I think PSV (pipe-separated-value) is better because you're much less likely to have pipes in your text. And also it's better to reuse our current escape mechanism in the unlikely event you have pipes in your cells. And that brings us back to what everyone is already using for tables in Markdown, which aren't harder to maintain if you don't care about making the text form pretty. This is also a perfectly valid Markdown Extra table: Year|Make|Model ----|----|----- 1997|Ford|E350 1999|Chevy|Venture "Extended Edition" 1999|Chevy|Venture "Extended Edition" 1996|Jeep|Grand Cherokee -- Michel Fortin michel.fortin at michelf.ca http://michelf.ca