From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/14987 Path: news.gmane.org!not-for-mail From: BP Jonsson Newsgroups: gmane.text.pandoc Subject: Re: Markdown, tables and CSV Date: Fri, 20 May 2016 21:37:12 +0200 Message-ID: References: <047d7b86ebe83c062b05332eab9b@google.com> <20BF19CB-A2B0-4B19-A749-D750CDD89736@martinfenner.org> <20160520183616.GB95956@protagoras.berkeley.edu> <1463772643.1938448.614055033.793EA897@webmail.messagingengine.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113724cca5106605334b379b X-Trace: ger.gmane.org 1463773900 14601 80.91.229.3 (20 May 2016 19:51:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 May 2016 19:51:40 +0000 (UTC) To: "pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org" Original-X-From: pandoc-discuss+bncBDIY76M674FRB2WO7W4QKGQEYITUZKY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 20 21:51:26 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-vk0-f59.google.com ([209.85.213.59]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b3qEW-000175-7w for gtp-pandoc-discuss@m.gmane.org; Fri, 20 May 2016 21:37:16 +0200 Original-Received: by mail-vk0-f59.google.com with SMTP id v68sf16774270vka.0 for ; Fri, 20 May 2016 12:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:mime-version:in-reply-to:references:date:message-id:subject :from:to: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=P35WotFd6wEvaocU/WAgapF07GOEJwxqlTuezquqc5c=; b=zYU7OJGkViI4qujl9OblunY2O+N4p3drNqZZtUqCwIxtSNXIm3xA+gtQOf+MVeGZYs OlSA5TzxxayZwFUB+LT9bHgb91DLqWRFTA7Ttm+d64z00moL5gJ08DoanEHxWjNLGLIA J7AXD2NxikRE1deC+TS+E05x7xBmLw3w2pzZoa1ckAs7KOlGw/bDa7vyyReyeUbKzXgS zFS8sweRUTY6H20TigpF6IKgUECRUN3b/HnfVq0Hcf/XBCV7UOLtCuiFZfy4NgX+LxwO y9xIc8QQPQ307ViMymLyzy6b+Y1VgjBshMg52EVn8H6z9UZL4/h3s5P9I6pjDwjkxGiN iKSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :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=P35WotFd6wEvaocU/WAgapF07GOEJwxqlTuezquqc5c=; b=Y+V0htNeB6sHnaHmXLX+8SdA+tnyPL2zzNopZ7pnyYgOe93RBvfacZZJm4OBZkXJ7b B6yS0reR85Qybqaczk1k7zfi7NsvYtHZv649obLU89YVdwZjUCbK/kiStVtzM06I520+ irIiiaarKCsWJip6tkJBzo9iU9v8tDqH4t4zE7NYdm7o8kAyZfuQsrJsYQmBhWELNatW KTCm4OE+6c//tKdQYHiWPBFQ0ZIUoBz6yppZqsPZ12udsbOfDQbyWTJAO3WFZi0Z9BAz V8ZDqJCKXh/9nEiUqX7zIG2OHHTZE0fncEFbZVOfF8GRlv+jP+nuOgKt+iNgluY6E3I2 30lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to: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=P35WotFd6wEvaocU/WAgapF07GOEJwxqlTuezquqc5c=; b=EKrZCut0Yyze1TIHcBLxJ/0mxeOIg91u1F8vcZtsHdl92FlNbx0d3kkaODcLQMrBiw WkH/TuiuzQHOXkcYBxCJmMdrZhhP6dj4Hv6kMovKQuiNlZenOxJ0IUjeglyZmp7Z9mNV kElOX+GcFdiPT0dWiyGVdhtKyFISHXrEx12FrKWaJPKlBViicTk6Fl7JMJB2aXkuj5ug eqF4YTmfASGGADoZ1fXAdw87zOt6PU/4x5kATvuY4PZp/HEfvUPMlKP5Nc7s/Aw/QpFl 8r4wmZP5DMlSF0VbvuEldwZdRJA1xwOUQLuAY6NkpYaCwEZLGhcL818tpdTAdcLSxtD2 KdSw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOPr4FVj11XeEbCt1IFshOoWKJMaWbWsxFd+ksbNPtXrN6qBH2QhiJIU/tQIXIXF6n17IQ== X-Received: by 10.36.36.211 with SMTP id f202mr82620ita.8.1463773035188; Fri, 20 May 2016 12:37:15 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.50.105.68 with SMTP id gk4ls298201igb.30.canary; Fri, 20 May 2016 12:37:13 -0700 (PDT) X-Received: by 10.66.233.5 with SMTP id ts5mr3307282pac.9.1463773032929; Fri, 20 May 2016 12:37:12 -0700 (PDT) Original-Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com. [2607:f8b0:4003:c06::232]) by gmr-mx.google.com with ESMTPS id u4si271906itc.3.2016.05.20.12.37.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 12:37:12 -0700 (PDT) Received-SPF: pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4003:c06::232 as permitted sender) client-ip=2607:f8b0:4003:c06::232; Original-Received: by mail-oi0-x232.google.com with SMTP id b65so48529187oia.1 for ; Fri, 20 May 2016 12:37:12 -0700 (PDT) X-Received: by 10.157.4.37 with SMTP id 34mr2830291otc.171.1463773032678; Fri, 20 May 2016 12:37:12 -0700 (PDT) Original-Received: by 10.157.13.136 with HTTP; Fri, 20 May 2016 12:37:12 -0700 (PDT) In-Reply-To: <1463772643.1938448.614055033.793EA897-2RFepEojUI2N1INw9kWLP6GC3tUn3ZHUQQ4Iyu8u01E@public.gmane.org> X-Original-Sender: bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com; spf=pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4003:c06::232 as permitted sender) smtp.mailfrom=bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com 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:14987 Archived-At: --001a113724cca5106605334b379b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable $thusly would probably be a class .csv and recognition of a class .code for when you want the code block to be left as an actual code block. /bpj fredag 20 maj 2016 skrev John Gabriele : > John, this may be something that could stand to be in the faq: > > ---------------------- > Q. Can I write csv content in my input file and have Pandoc render it as > a table? > > A. Pandoc doesn't support this directly, but you *can* put your csv data > into a delimited code block, mark the block $thusly, then use then use a > filter to process these specially-marked blocks. For example, {snip}. > > A nice benefit of this is that it will degrade gracefully if the > document is then processed without using the filter. > > There may be other options available on the [Pandoc Extras page], > including ... {snip preprocessors, scripts, ...?} > ---------------------- > > Not sure about what "$thusly" would be though. Also have not used Pandoc > filters before. > > -- John > > > > On Fri, May 20, 2016, at 02:36 PM, John MACFARLANE wrote: > > +++ Martin Fenner [May 20 16 12:38 ]: > > > I would rather use Pandoc with a CSV reader, but my Haskell isn't > good > > > enough to write one. > > > > This would be a pretty easy project for someone trying to > > learn Haskell; maybe someone on the list wants to try it? > > The cassava library works well for csv parsing. > > > > > 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 th= e > > > CSV format, and you can do most of the things with CSV that the oth= er > > > 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 think that using a filter that processes specially marked > > code blocks is a better way to go than introducing yet > > another delimited block type. > > > > For one thing, this will degrade much more gracefully when > > you render it with a standard markdown renderer. > > (The CSV will show up as code rather than garbage.) > > > > One could think about integrating the filter into pandoc > > itself, as an option, but the code and syntax would not > > have to be different, I think. > > > > > > -- > > You received this message because you are subscribed to the Google Grou= ps > > "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 . > > To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/pandoc-discuss/20160520183616.GB95956%4= 0protagoras.berkeley.edu > . > > For more options, visit https://groups.google.com/d/optout. > > -- > 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-/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.google.com/d/msgid/pandoc-discuss/1463772643.1938448.61405= 5033.793EA897%40webmail.messagingengine.com > . > For more options, visit https://groups.google.com/d/optout. > --=20 ------------------------------ SavedURI :Show URLShow URLSavedURI : SavedURI :Hide URLHide URLSavedURI : https://mail.google.com/_/scs/mail-static/_/js/k=3Dgmail.main.sv.G3GZFwvcni= Q.O/m=3Dm_i,t,it/am=3DfUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD= 8qOMw/rt=3Dh/d=3D1/rs=3DAItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvwhttps://mail.goog= le.com/_/scs/mail-static/_/js/k=3Dgmail.main.sv.G3GZFwvcniQ.O/m=3Dm_i,t,it/= am=3DfUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD8qOMw/rt=3Dh/d=3D= 1/rs=3DAItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvw ------------------------------ --=20 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 e= mail 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/CAFC_yuSYnaun%2Bdg7-6asBvgXbmbh6BAw2HQEbg-nY3Qe-EwBzA%40mail= .gmail.com. For more options, visit https://groups.google.com/d/optout. --001a113724cca5106605334b379b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable $thusly would probably be a class .csv and recognition of a class .code for= when you want the code block to be left as an actual code block.

<= /div>
/bpj

fredag 20 maj 2016 skrev John Gabriele &= lt;jgabriele-97jfqw80gc6171pxa8y+qA@public.gmane.org>:<= br>
John, this may be something that could st= and to be in the faq:

----------------------
Q. Can I write csv content in my input file and have Pandoc render it as a table?

A. Pandoc doesn't support this directly, but you *can* put your csv dat= a
into a delimited code block, mark the block $thusly, then use then use a filter to process these specially-marked blocks. For example, {snip}.

A nice benefit of this is that it will degrade gracefully if the
document is then processed without using the filter.

There may be other options available on the [Pandoc Extras page],
including ... {snip preprocessors, scripts, ...?}
----------------------

Not sure about what "$thusly" would be though. Also have not used= Pandoc
filters before.

-- John



On Fri, May 20, 2016, at 02:36 PM, John MACFARLANE wrote:
> +++ Martin Fenner [May 20 16 12:38 ]:
> >=C2=A0 =C2=A0I would rather use Pandoc with a CSV reader, but my H= askell isn't good
> >=C2=A0 =C2=A0enough to write one.
>
> This would be a pretty easy project for someone trying to
> learn Haskell; maybe someone on the list wants to try it?
> The cassava library works well for csv parsing.
>
> >=C2=A0 =C2=A0For the second use case I see a clear advantage of CS= V over the various
> >=C2=A0 =C2=A0attempts to format tables in markdown (simple_tables,= multiline_tables,
> >=C2=A0 =C2=A0grid_tables, pipe_tables). Everyone (and many tools) = understands the
> >=C2=A0 =C2=A0CSV format, and you can do most of the things with CS= V that the other
> >=C2=A0 =C2=A0table formats allow (multi-column formats and column = alignment are a
> >=C2=A0 =C2=A0bit trickier). This has been done before using Pandoc= filters, but I
> >=C2=A0 =C2=A0think a Pandoc "csv_tables" Pandoc extensio= n would make this easier for
> >=C2=A0 =C2=A0the casual user. Using the grid_tables example from t= he Pandoc
> >=C2=A0 =C2=A0documentation, this could look like this:
> >
> >=C2=A0 =C2=A0: Sample csv table.
> >=C2=A0 =C2=A0,,,
> >=C2=A0 =C2=A0Fruit,Price,Advantages
> >=C2=A0 =C2=A0Bananas,$1.34,- built-in wrapper\n- bright color
> >=C2=A0 =C2=A0Oranges,$2.10, - cures scurvy\n- tasty
> >=C2=A0 =C2=A0,,,
>
> I think that using a filter that processes specially marked
> code blocks is a better way to go than introducing yet
> another delimited block type.
>
> For one thing, this will degrade much more gracefully when
> you render it with a standard markdown renderer.
> (The CSV will show up as code rather than garbage.)
>
> One could think about integrating the filter into pandoc
> itself, as an option, but the code and syntax would not
> have to be different, I think.
>
>
> --
> You received this message because you are subscribed to the Google Gro= ups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an
> email to pandoc-discuss+uns= ubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To post to this group, send email to p= andoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit
> https://groups.go= ogle.com/d/msgid/pandoc-discuss/20160520183616.GB95956%40protagoras.berkele= y.edu.
> For more options, visit https://groups.google.com/d/optout.

--
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 pandoc-discuss+unsubscri= be-/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.google.com/d/msgid/pan= doc-discuss/1463772643.1938448.614055033.793EA897%40webmail.messagingengine= .com.
For more options, visit https://groups.google.com/d/optout.


--

--
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://group= s.google.com/d/msgid/pandoc-discuss/CAFC_yuSYnaun%2Bdg7-6asBvgXbmbh6BAw2HQE= bg-nY3Qe-EwBzA%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--001a113724cca5106605334b379b--