From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/14986 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 15:30:43 -0400 Message-ID: <1463772643.1938448.614055033.793EA897@webmail.messagingengine.com> 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: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1463773397 5856 80.91.229.3 (20 May 2016 19:43:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 May 2016 19:43:17 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJ3XKWUQQDBBZWL7W4QKGQEIOJWKSA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 20 21:43:01 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-qg0-f57.google.com ([209.85.192.57]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b3q8F-0003B2-Vq for gtp-pandoc-discuss@m.gmane.org; Fri, 20 May 2016 21:30:48 +0200 Original-Received: by mail-qg0-f57.google.com with SMTP id b14sf13411576qge.1 for ; Fri, 20 May 2016 12:30:47 -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: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=TC3AMowcsyod/Hx0Ch9frPz1cm+1FKX607044a/pKHo=; b=b6MBBzAKjOTsd1jGDs5K6WXzSXQHr2wNK3q7lXPQK9/2hg28ogEbjCKlDB4EvP9PSH C+z31mGXeGsI2sZU8J7NTonObAryF3u9oE65fNygH8oQ/v1WyOMw2w0xvujhvx9O2rh9 FmVHFFqW+nG1iZW1X8bjynjbgujeGGqSLmGnVDXisukv+LI5P5k9d1r4yxxDh8XxrHeJ Awn0K9Xf/buEf5gzeUeUS1rb1VN9HJ+rljdDvQt10VAJLeRqmCINSagqk91mki8oLOvf 7ovzNsVEd9MCa+WL1tVLvBNLilqeH/pf0v2VvxjrvOhQiL2C2JJM+gxXPeIS+UV0gpoV yP5Q== 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: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=TC3AMowcsyod/Hx0Ch9frPz1cm+1FKX607044a/pKHo=; b=AaO1kEL/AjM+y130/TckyrRxQK2eKm2PfJrQ6PAlglY3A/FnM1WJHJRmfl9aRJTlM3 8VvXHUMPCwH+3kxxsL+NdUK+TvsikG+yptC3L5C9ZD4jdsQeukyCOv38H4AFNX1K6p6F 0+//211wIT7O3nxulPdyk/1rJ3UnYeJQ2r7W85Bc2kn8mXtRJ9+Z7qHjcuikXXHaSrfc M2iqJ/2jrkpzvhUZSLqLNLqGOKIOC/MO0W4jPTWH8f9lwbO25LJgZ/lF/BDwlrBDO7wg k9heVjKRikdzVoksS7GPgi+2TOMghdXiL62BsxgPnGKGDMsmp2snmAAyxCabRYVAB97T I3Jw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOPr4FUxs8Hn7uZ27xOdkYvVuz3AY1oDzeprwPoCi6wPnPYAoxe58Fm3jIxoxWyT5Y6sZg== X-Received: by 10.140.85.138 with SMTP id n10mr164536qgd.16.1463772647217; Fri, 20 May 2016 12:30:47 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.140.83.136 with SMTP id j8ls1972762qgd.41.gmail; Fri, 20 May 2016 12:30:46 -0700 (PDT) X-Received: by 10.159.35.65 with SMTP id 59mr3167487uae.14.1463772646752; Fri, 20 May 2016 12:30:46 -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 vo1si4171659pab.2.2016.05.20.12.30.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 12:30:46 -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 compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A0D712098A for ; Fri, 20 May 2016 15:30:43 -0400 (EDT) Original-Received: from web1 ([10.202.2.211]) by compute3.internal (MEProxy); Fri, 20 May 2016 15:30:43 -0400 Original-Received: by web1.nyi.internal (Postfix, from userid 99) id 72386AEBC5C; Fri, 20 May 2016 15:30:43 -0400 (EDT) X-Sasl-Enc: wkS4zI3IrKU+wAL+0h359+triQFHC4ojdjO0AGRJgvOV 1463772643 X-Mailer: MessagingEngine.com Webmail Interface - ajax-37b57599 In-Reply-To: <20160520183616.GB95956-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@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:14986 Archived-At: 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 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. > > > -- > 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%40protagoras.berkeley.edu. > For more options, visit https://groups.google.com/d/optout.