From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/14985 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:32:40 +0200 Message-ID: References: <047d7b86ebe83c062b05332eab9b@google.com> <20BF19CB-A2B0-4B19-A749-D750CDD89736@martinfenner.org> <20160520183616.GB95956@protagoras.berkeley.edu> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d672c68cd8e05334b27ca X-Trace: ger.gmane.org 1463773240 3427 80.91.229.3 (20 May 2016 19:40:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 May 2016 19:40:40 +0000 (UTC) To: "pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org" Original-X-From: pandoc-discuss+bncBDIY76M674FRBWGM7W4QKGQEIJDO7II-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 20 21:40:27 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pf0-f188.google.com ([209.85.192.188]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b3qA5-000510-SS for gtp-pandoc-discuss@m.gmane.org; Fri, 20 May 2016 21:32:42 +0200 Original-Received: by mail-pf0-f188.google.com with SMTP id g132sf41527163pfb.0 for ; Fri, 20 May 2016 12:32:41 -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=cSggt2Ivc8FJKE8XKl1VvlCRAwkcynpWIoL71k631w4=; b=i9mZI2AvrNAqMyxs+5apWddtdb/tNbGdmYf324EKkaS+hFjo53K6RB8wNJ5lFRKTq5 AS0fKArrqsEFlrI3gGlIPx+CAnvJSt/KcS6InKPH1y7E6bqPNuOEF17cPmogSUAkhLuM Kk1x2J7IdhDDPhWiew1L8knXzm2mwwVRauIIbNN5UcJtQy+vQhC17cvZ1UnLw0efALcc cbyJt+Buu/NHetTF6VkVBDj4xegKxZ1LmijzTiPqQ/WxPjgJ7/NZ8f401IBv8liHRWrj nAnU0ZrlC4hgyFQguec+fwGC1NgCk2FAALFX8hwO9Ep7RvnkznUZi+5odyeE+kkq24kG sgjg== 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=cSggt2Ivc8FJKE8XKl1VvlCRAwkcynpWIoL71k631w4=; b=mP0mKdJwH088vEV+1pjAa6/tHHNt4byu3tGI1c2fwLOYc5zd/fORaQ1BqnkO86F2U+ B+qDRG7R6htTk/nxlYp8QHS4+Q8rYFn9tgANgtOHWMHraYrnR9uAEkMD2YIhtuXXt73N zfOlg0wCoRUjFI4lqAfeNNO5DscUrN4YJTGQoR2Dtd/Zsu5cAzElMf8iGSmlULkKcjhr w0MhxWGL/0HXHhscEqh/3O2ZUjV6YSYh4ay4yhHNjF12T0ydjlFUhB6S2r1gxVvb61Ez o6YakR/XPBaGVLIiGBIQM8wUEB37aF5z0hs5o5vfwKZXeyt72CKoFSLviouZ3ju4Tbz4 oNQA== 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=cSggt2Ivc8FJKE8XKl1VvlCRAwkcynpWIoL71k631w4=; b=alxePNdwwD4T8n4b2maghruEAJRJeAUbRGAMLbjmJzzVixL6JWwmswWawWYj3+TDF5 WJnzkNN99dODVD6jBlquL3MqjPWjVFNWcjVK2wL41ilS1fG45lMQ0oXYH85Xy6pObXym /ASVVh3xm0bpVGY8T0gwTjJJMHXPKkVGvdc5RMLGmnpvt6Fjeom98D1SO1Gf9xtixvwG A95gXzRAiY+tYGMHc3lBMHYGDggPj47f6E3k+kmqG2wFd1m0OYp8y5BjUYMQnqCgphn5 f+/JTp3tvscLVjCyR9G1KrH0CSDlp/+iKATz6o/gbUgK/UJwboA/Tmt34DbkuiIEUC6+ I2sQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOPr4FVzMvKCqYB0jeXPzaD/ppMpOpVIdCQWovlI/jC/C+BwtpktdlHouiIWxvgnSK06KQ== X-Received: by 10.140.44.9 with SMTP id f9mr164195qga.20.1463772760984; Fri, 20 May 2016 12:32:40 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.140.43.131 with SMTP id e3ls2729506qga.74.gmail; Fri, 20 May 2016 12:32:40 -0700 (PDT) X-Received: by 10.129.71.213 with SMTP id u204mr3188085ywa.51.1463772760537; Fri, 20 May 2016 12:32:40 -0700 (PDT) Original-Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com. [2607:f8b0:4003:c06::22f]) by gmr-mx.google.com with ESMTPS id x12si285667igx.2.2016.05.20.12.32.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 12:32:40 -0700 (PDT) Received-SPF: pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4003:c06::22f as permitted sender) client-ip=2607:f8b0:4003:c06::22f; Original-Received: by mail-oi0-x22f.google.com with SMTP id v145so192523203oie.0 for ; Fri, 20 May 2016 12:32:40 -0700 (PDT) X-Received: by 10.202.64.214 with SMTP id n205mr3120893oia.104.1463772760294; Fri, 20 May 2016 12:32:40 -0700 (PDT) Original-Received: by 10.157.13.136 with HTTP; Fri, 20 May 2016 12:32:40 -0700 (PDT) In-Reply-To: <20160520183616.GB95956-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@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::22f 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:14985 Archived-At: --001a113d672c68cd8e05334b27ca Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I agree that inline CSV probably better be done by overloading code blocks. Another reason for that is that CSV doesn't look like a table at all, and thus is a very un-markdownish syntax. this is a purely aesthetic concern though. If someone would write the code to implement this it would be good if one could customize the delimiter, quote and escape characters through attributes. I wrote a simple filter once which simply passed such options on to the Text::CSV Perl module. It so happens that I deal with tab separated values more often than actual CSV. While TSV is much easier to convert into a pandoc table it would be good if a CSV reader could handle it. /bpj fredag 20 maj 2016 skrev John MACFARLANE : > +++ 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 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 fo= r >> 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 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/20160520183616.GB95956%4= 0protagoras.berkeley.edu > . > 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_yuTbCcn8rWR%2Byug%2B2CYzyFi3k%3DK1q3%2B1-VJnx7ZrKTBxcw%= 40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. --001a113d672c68cd8e05334b27ca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I agree that inline CSV probably better be done by overloading code blocks.= Another reason for that is that CSV doesn't look like a table at all, = and thus is a very un-markdownish syntax. this is a purely aesthetic concer= n though.

If someone would write the code to implement t= his it would be good if one could customize the delimiter, quote and escape= characters through attributes. I wrote a simple filter once which simply p= assed such options on to the Text::CSV Perl module. It so happens that I de= al with tab separated values more often than actual CSV. While TSV is much = easier to convert into a pandoc table it would be good if a CSV reader coul= d handle it.

/bpj

fredag 20 ma= j 2016 skrev John MACFARLANE <jgm@be= rkeley.edu>:
+++ Martin Fenner [Ma= y 20 16 12:38 ]:
=C2=A0 I would rather use Pandoc with a CSV reader, but my Haskell isn'= t good
=C2=A0 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.

=C2=A0 For the second use case I see a clear advantage of CSV over the vari= ous
=C2=A0 attempts to format tables in markdown (simple_tables, multiline_tabl= es,
=C2=A0 grid_tables, pipe_tables). Everyone (and many tools) understands the=
=C2=A0 CSV format, and you can do most of the things with CSV that the othe= r
=C2=A0 table formats allow (multi-column formats and column alignment are a=
=C2=A0 bit trickier). This has been done before using Pandoc filters, but I=
=C2=A0 think a Pandoc "csv_tables" Pandoc extension would make th= is easier for
=C2=A0 the casual user. Using the grid_tables example from the Pandoc
=C2=A0 documentation, this could look like this:

=C2=A0 : Sample csv table.
=C2=A0 ,,,
=C2=A0 Fruit,Price,Advantages
=C2=A0 Bananas,$1.34,- built-in wrapper\n- bright color
=C2=A0 Oranges,$2.10, - cures scurvy\n- tasty
=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 Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail 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/2016052= 0183616.GB95956%40protagoras.berkeley.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 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.google.com/d/msgid/pandoc-discuss/CAFC_yuTbCcn8rWR%2Byug%2B2CYzyFi3= k%3DK1q3%2B1-VJnx7ZrKTBxcw%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--001a113d672c68cd8e05334b27ca--