From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/14981 Path: news.gmane.org!not-for-mail From: John MACFARLANE Newsgroups: gmane.text.pandoc Subject: Re: Markdown, tables and CSV Date: Fri, 20 May 2016 11:36:16 -0700 Message-ID: <20160520183616.GB95956@protagoras.berkeley.edu> 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: text/plain; charset=UTF-8; format=flowed X-Trace: ger.gmane.org 1463769395 6073 80.91.229.3 (20 May 2016 18:36:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 May 2016 18:36:35 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBLNS7W4QKGQEBENCJCI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 20 20:36:31 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pf0-f184.google.com ([209.85.192.184]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b3pHi-0004UM-N1 for gtp-pandoc-discuss@m.gmane.org; Fri, 20 May 2016 20:36:30 +0200 Original-Received: by mail-pf0-f184.google.com with SMTP id g132sf41045537pfb.0 for ; Fri, 20 May 2016 11:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:from:date:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent: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=lcq7hi50+1LOdVfM1o1yhyspzfdqQY1SHnZFA9jsBwQ=; b=mZDfLB/Pm6E7GB6eieAVKiYaY4nNWTowPwfk855wn+6bPXebbcuNSaf2kUbNOBxSa3 46CQK85zjaHUhtsmK/j2oPOskuUSCKNRFTgbV4tKDub/zDK83z0lBuzUunUvH2UZpNSu Z7Ua0EL04zrLyG/xxLguDA6ACo2ZdKZGv+rv3EBsX2gERfWDwyb4ooRBOM/a7uU3hGaF ajrq6YHZUYWJyKHBpj+F3H9qSFMt/U8NrDvV2qrfzlGTs2uiMZwmy3mZqK44qbqUaW0/ WqicFHzc5MDSp8SJKRU+jUXHPJvL93odnLy+8Tdd7l8Ug8DvnlOzH28TAlHv4GKdCZXm lkyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:from:date:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent :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=lcq7hi50+1LOdVfM1o1yhyspzfdqQY1SHnZFA9jsBwQ=; b=QBej5yElLBy5WEv3LIndNwOKDPmFvJZM0sH8tb76Ialjmiiln+o8i6PYpRfpA6OMqL fL414jT3vy35dqxy16fAihB6StoRcy9sOVv9Ufxu2ZCM52f3PXc+QiCdSUD9jJllyEBt 7U7sAwt2+iiwo1RJ+LW+QWfDFLUkr+TVbgLeT6i3YbMPJAH7U1bISWhtP8RqL71Rz/Wi 8ite0b3zTCps4+GJd8LRTIIAnr1Sf7AO23Niwc5a7xDeK7ob9Uep9GrbQ00OBA6G/HgE 4Etp+iD74yAyhLGmu7b1FxsbSFzH1EWHari0GP7iorOLeo901Ry75x3F0eqv7yj4rRV5 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOPr4FWRPkQ7XlLuDF6b0arfllDV+5piG9jIOGk5GlAk4vTVWx9+rknAViz2RArGNtcH2g== X-Received: by 10.140.93.45 with SMTP id c42mr152186qge.5.1463769389811; Fri, 20 May 2016 11:36:29 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.140.99.80 with SMTP id p74ls2718421qge.86.gmail; Fri, 20 May 2016 11:36:29 -0700 (PDT) X-Received: by 10.140.146.134 with SMTP id 128mr3043422qhs.14.1463769389269; Fri, 20 May 2016 11:36:29 -0700 (PDT) Original-Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com. [2607:f8b0:400e:c03::229]) by gmr-mx.google.com with ESMTPS id d141si4079309pfd.1.2016.05.20.11.36.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 11:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c03::229 as permitted sender) client-ip=2607:f8b0:400e:c03::229; Original-Received: by mail-pa0-x229.google.com with SMTP id xk12so41932568pac.0 for ; Fri, 20 May 2016 11:36:29 -0700 (PDT) X-Received: by 10.66.65.133 with SMTP id x5mr7204350pas.108.1463769388927; Fri, 20 May 2016 11:36:28 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id y5sm9130701pai.40.2016.05.20.11.36.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 11:36:27 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id C9A45A315; Fri, 20 May 2016 14:36:16 -0400 (EDT) Content-Disposition: inline In-Reply-To: <20BF19CB-A2B0-4B19-A749-D750CDD89736-+Z+QprJ1jbpwFuiNLMe2Ig@public.gmane.org> X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.24 (2015-08-30) X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c03::229 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:14981 Archived-At: +++ 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 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.