From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/14980 Path: news.gmane.org!not-for-mail From: John Gabriele Newsgroups: gmane.text.pandoc Subject: Re: Markdown, tables and CSV Date: Fri, 20 May 2016 13:55:05 -0400 Message-ID: <1463766905.1918988.613990665.6CD67781@webmail.messagingengine.com> References: <047d7b86ebe83c062b05332eab9b@google.com> <20BF19CB-A2B0-4B19-A749-D750CDD89736@martinfenner.org> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_----------=_146376690519189880"; charset="utf-8" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1463766918 29801 80.91.229.3 (20 May 2016 17:55:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 May 2016 17:55:18 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJ3XKWUQQDBB7M67W4QKGQEDPVWEDY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 20 19:55:13 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-vk0-f64.google.com ([209.85.213.64]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b3odi-0003l8-GP for gtp-pandoc-discuss@m.gmane.org; Fri, 20 May 2016 19:55:10 +0200 Original-Received: by mail-vk0-f64.google.com with SMTP id z184sf36082908vkg.1 for ; Fri, 20 May 2016 10:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:message-id:from:to:mime-version:content-transfer-encoding :subject:date:in-reply-to:references:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=S3QGXObRMBCKR5b1wfTBc/FNX9PVbqUZ+ZeTXx8DPXE=; b=pmzzM+a29ILHMrHP5S5AQGNZDnJh3ru1JnwQml2joAD4TprsvRBIB+iBhw7Gt1WyqL ZpuXpOMFCEkxpS+i8vpInwRtBe5uIrpTBCSvhxAiFZHMp58IBgsP4OSSYgDlOFZ0th29 2rQkoonb2yLfV0/49K/XmaVnT68HTBK6JELP1L64xyyfVsZzAqv1zurM4JblbwJAxkgu hy3eS7kzFenN6fUGzGm7O+w+97yNm+pztSDnkhJ51hYf8QfzLKrffH4jJcg+4VeJcRBF gAKUvQ5M1de8NEBcF9CzpqUvMQ3Oa+a7SuhBnJfyWPIfqm7PFs7RRrn6fx7dMU7Q+350 iytA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:message-id:from:to:mime-version :content-transfer-encoding:subject:date:in-reply-to:references :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=S3QGXObRMBCKR5b1wfTBc/FNX9PVbqUZ+ZeTXx8DPXE=; b=irREXsUsDGqOF/FGklPIM3VVvqWpW+XYonUe+keRH0VQcQufrD7mOndAw+De0JketV I//HXoWJT63+ImTbmAkine9C1oxoaI0KhokYdvUIu41bzsKCh8WvEvqSK4iOlko/OMdr QRbRGuFEM9CfcZKm10QH9VLbVNsfGZjxI+2poUx7cd11byQJviI25cM6857NNwseUNoV 9b9Y9UcPLe1TYJMaHSZrJvA+tD2GC24oKc7OFyNG3C5VqbUARVmo4vJVyr3W+1qqYN8L 95DUCF6fqUS/1cSMAV3m3Vn66Z4TXiEZvpP+BOR1EeTlPBVxbRve3H+ZanoDewphl2pi Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOPr4FXXifZjYTfGlk6XucJcUj9dRvG1U4YK2CBpI2tL5Mx0S5cutWmz9hS2p+RGN+rZ2Q== X-Received: by 10.140.33.138 with SMTP id j10mr144464qgj.2.1463766909751; Fri, 20 May 2016 10:55:09 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.140.39.177 with SMTP id v46ls2872127qgv.32.gmail; Fri, 20 May 2016 10:55:09 -0700 (PDT) X-Received: by 10.129.25.212 with SMTP id 203mr2835394ywz.35.1463766909182; Fri, 20 May 2016 10:55:09 -0700 (PDT) Original-Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com. [66.111.4.26]) by gmr-mx.google.com with ESMTPS id vo1si4114649pab.2.2016.05.20.10.55.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 10:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of jgabriele-97jfqw80gc6171pxa8y+qA@public.gmane.org designates 66.111.4.26 as permitted sender) client-ip=66.111.4.26; Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1401020DB9 for ; Fri, 20 May 2016 13:55:06 -0400 (EDT) Original-Received: from web1 ([10.202.2.211]) by compute4.internal (MEProxy); Fri, 20 May 2016 13:55:06 -0400 Original-Received: by web1.nyi.internal (Postfix, from userid 99) id D2893AEB7B1; Fri, 20 May 2016 13:55:05 -0400 (EDT) X-Sasl-Enc: aF5BbtZn9WYmWV8W1fUAsKUCjNoovA9RW7VHksUAyDfW 1463766905 X-Mailer: MessagingEngine.com Webmail Interface - ajax-37b57599 In-Reply-To: <20BF19CB-A2B0-4B19-A749-D750CDD89736-+Z+QprJ1jbpwFuiNLMe2Ig@public.gmane.org> X-Original-Sender: jgabriele-97jfqw80gc6171pxa8y+qA@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@fastmail.fm; dkim=pass header.i=@messagingengine.com; spf=pass (google.com: domain of jgabriele-97jfqw80gc6171pxa8y+qA@public.gmane.org designates 66.111.4.26 as permitted sender) smtp.mailfrom=jgabriele-97jfqw80gc6171pxa8y+qA@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:14980 Archived-At: This is a multi-part message in MIME format. --_----------=_146376690519189880 Content-Type: text/plain; charset=UTF-8 Hi Martin, There's also [issue 553](https://github.com/jgm/pandoc/issues/553). Personally, I think I like (from that issue thread) anton-k's original idea: ![an image](foo.jpg) ![an include](foo.txt) ![a csv to be rendered as a table](foo.csv) (that is, based on filename extension) Those seem sensible, symmetrical, easy to remember, and I think fit well with what pandoc already does (`![]()` is already like an include). As for a syntax to allow writing your csv data right into your md file, ... Pandoc already supports a generous number of table formats that are pretty easy to type. And for larger tables that you might be tempted to copy/paste in, might be better easier to bang-include them (as in, `![]()`), rather than muck up your pretty markdown file with a giant bunch of csv data. :) -- John On Fri, May 20, 2016, at 05:38 AM, Martin Fenner wrote: > Dear group, > > The topic of CSV support in Pandoc has come up several times on this > list, includes this thread from 2014: > https://groups.google.com/forum/#!topic/pandoc-discuss/kBdJU_JktzI > > Since last year I work for an organisation that frequently deals with > tabular data (and helped organize CSVconf earlier this month), and I > have done some thinking on how CSV could fit into Pandoc. I see two > important use cases: > > * CSV reader that converts to tables in HTML, docx, latex, etc. > * CSV has a format to describe tables in markdown > > For the first use case I wrote a hack for the Jekyll blogging > platform this week that turns CSV files into markdown grid tables > format that is then processed by Pandoc > (https://github.com/datacite/jekyll-csvy). I would rather use Pandoc > with a CSV reader, but my Haskell isn't good enough to write one. But > for now I can generate blog posts directly from CSV files. Other > people have done similar things with Pandoc and CSV. > > For the second use case I see a clear advantage of CSV over the > various attempts to format tables in markdown (simple_tables, > multiline_tables, grid_tables, pipe_tables). Everyone (and many tools) > understands the CSV format, and you can do most of the things with CSV > that the other table formats allow (multi-column formats and column > alignment are a bit trickier). This has been done before using Pandoc > filters, but I think a Pandoc "csv_tables" Pandoc extension would make > this easier for the casual user. Using the grid_tables example from > the Pandoc documentation, this could look like this: > > : Sample csv table. > > ,,, > Fruit,Price,Advantages > Bananas,$1.34,- built-in wrapper\n- bright color > Oranges,$2.10, - cures scurvy\n- tasty > ,,, > > I like three commas on a new line to indicate the start and end of > a table, but that is of course open for discussion. The format is > much easier to read and edit for humans compared to grid tables, > the only tricky bit is maybe the \n for multiline columns. I would > think we could add metadata to the fenced table blog similar to > code blocks, e.g. > > ,,,{ #mytable .numberRows } > > One challenge with CSV is that it is an ill-defined format somewhat > similar to markdown before CommonMark. It may make things easier to > only support a specific CSV variant (e.g. comma as separator, header > required, comment lines not allowed). > > Thoughts? > > Best, > > Martin > > > > > -- > You received this message because you are subscribed to the Google > Groups "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/20BF19CB-A2B0-4B19-A749-D750CDD89736%40martinfenner.org[1]. > For more options, visit https://groups.google.com/d/optout. Links: 1. https://groups.google.com/d/msgid/pandoc-discuss/20BF19CB-A2B0-4B19-A749-D750CDD89736%40martinfenner.org?utm_medium=email&utm_source=footer -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1463766905.1918988.613990665.6CD67781%40webmail.messagingengine.com. For more options, visit https://groups.google.com/d/optout. --_----------=_146376690519189880 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8
Hi Martin,
 
 
Personally, I think I like (from that iss= ue thread) anton-k's original idea:
 
    ![an image](foo.jpg)
 
    ![an include](foo.txt)=
 
    ![a csv to be rendered= as a table](foo.csv)
 
(that is, based on filename extension)
 
Those seem sensible, symmetrical, easy to= remember, and I think fit well with what pandoc already does (`![]()` is a= lready like an include).
 
As for a syntax to allow writing your csv= data right into your md file, ... Pandoc already supports a generous numbe= r of table formats that are pretty easy to type. And for larger tables that= you might be tempted to copy/paste in, might be better easier to bang-incl= ude them (as in, `![]()`), rather than muck up your pretty markdown file wi= th a giant bunch of csv data. :)
 
-- John
 
 
 
 
On Fri, May 20, 2016, at 05:38 AM, Martin Fenner wrote:
Dear group,
=
 
The topic of CSV support in Pandoc has come up several times on this l= ist, includes this thread from 2014:
 
Since last year I work for an organisation that frequently deals with = tabular data (and helped organize CSVconf earlier this month), and I have d= one some thinking on how CSV could fit into Pandoc. I see two important use= cases:
 
* CSV reader that converts to tables in HTML, docx, latex, etc.
* CSV has a format to describe tables in markdown
 
For the first use case I wrote a hack for the Jekyll blogging platform= this week that turns CSV files into markdown grid tables format that is th= en processed by Pandoc (https://github.com/datacite/jekyll-csvy). I would rather use Pandoc wi= th a CSV reader, but my Haskell isn't good enough to write one. But for now= I can generate blog posts directly from CSV files. Other people have done = similar things with Pandoc and CSV.
 
For the second use case I see a clear advantage of CSV over the variou= s attempts to format tables in markdown (simple_tables, multiline_tables, g= rid_tables, pipe_tables). Everyone (and many tools) understands the CSV for= mat, and you can do most of the things with CSV that the other table format= s allow (multi-column formats and column alignment are a bit trickier). Thi= s has been done before using Pandoc filters, but I think a Pandoc "csv_tabl= es" Pandoc extension would make this easier for the casual user. Using the = grid_tables example from the Pandoc documentation, this could look like thi= s:
 
: Sample csv table.
 
,,,
Fruit,Price,Advantages
Bananas,$1.34,- built-in wrapper\n- bright color
Oranges,$2.10, - cures scurvy\n- tasty
,,,
 
I like three commas on a new line to indicate the start and end of a t= able, but that is of course open for discussion. The format is much easier = to read and edit for humans compared to grid tables, the only tricky bit is= maybe the \n for multiline columns. I would think we could add metadata to= the fenced table blog similar to code blocks, e.g.
 
,,,{ #mytable .numberRows }
 
One challenge with CSV is that it is an ill-defined format somewhat si= milar to markdown before CommonMark. It may make things easier to only supp= ort a specific CSV variant (e.g. comma as separator, header required, comme= nt lines not allowed).
 
Thoughts?
 
Best,
 
Martin
 
 
 


--
You received this message because you ar= e subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop = receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<= /a>.
For more options, visit https://groups.google.com/d/optout.
<= /div>
 

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.g= oogle.com/d/msgid/pandoc-discuss/1463766905.1918988.613990665.6CD67781%40we= bmail.messagingengine.com.
For more options, visit http= s://groups.google.com/d/optout.
--_----------=_146376690519189880--