From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16022 Path: news.gmane.org!.POSTED!not-for-mail From: BP Jonsson Newsgroups: gmane.text.pandoc Subject: Re: Markdown, tables and CSV Date: Tue, 15 Nov 2016 10:07:52 +0100 Message-ID: References: <047d7b86ebe83c062b05332eab9b@google.com> <20BF19CB-A2B0-4B19-A749-D750CDD89736@martinfenner.org> <14b8fa54-dc04-4874-bf47-fb268fc9f298@googlegroups.com> <12c01cfd-f9de-4dd9-bb80-fcac75c808be@googlegroups.com> <38bfec67-90f0-4d71-b054-1eedfd853d96@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c1476a9cf64d0541534a6d X-Trace: blaine.gmane.org 1479200924 3050 195.159.176.226 (15 Nov 2016 09:08:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 Nov 2016 09:08:44 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDIY76M674FRB2VAVPAQKGQE4X52XZQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Nov 15 10:08:39 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-qk0-f184.google.com ([209.85.220.184]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6ZiZ-0002tm-HR for gtp-pandoc-discuss@m.gmane.org; Tue, 15 Nov 2016 10:07:51 +0100 Original-Received: by mail-qk0-f184.google.com with SMTP id y205sf24399055qkb.0 for ; Tue, 15 Nov 2016 01:07:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:mime-version:in-reply-to:references:from:date:message-id :subject: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=lnhZSpfgLAKfodT5pma8rufDAsBqdHhD1n8OPVNRL2A=; b=cW+qrmgVrIhOGPfgLd0IpljXeF7vlN8bphAEmyQeDMskdKm7Aj8bNRnurAJ7ZxYSAa X4/KzVYIL6ebdi9XZQplaG86CX0y+atJRaio0eoQ9tH6LOjnPlSndlCP4h8Lzrx25On2 PQ6+EAVcCtkW8VKup5b5Fe3vAzGIqjccovk/TfHPKNzN5/s4OfBP8RQerE78BvkEqDyl mgi94gP6Np6zIBdkhM3pE35r8lN5HabxXGHSNvcYt69g/V6wJQnK5huvHIeIXJ1nKE11 vVtrhZtDqx24TZKfOeMIbp3bVUxLbD60oYEDOgZMrNF0TUC8xyb949DkpIByC4fEdzYs Nb3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject: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=lnhZSpfgLAKfodT5pma8rufDAsBqdHhD1n8OPVNRL2A=; b=dJ/xjso3BnUrJ0CHCHNe7Xs4kxvF3QyyrBTuxf6Woygn9rxXqUKX346DuhgvqoEr1/ mFUXcpaQpIH7eUFNY5UB9Jmmg52s2u3ky60QW+d02kjMwhd/XbLCJFIJnys8nMIuL1tI ztC/oZbG5FhLwbXcxAC9Qra33VM6zKdXHJLcgL/0KgU9QnYFcSzcgfqUCfp+w/21hB/O 0erjLFcvOgcwUkWpWsl65Gz67a+CCjblUXCknDALw+n2hn+UMc1JlDOe2gO37eUpncAg 5oMVS3ipjb8yCUkW/SbWtpJepkYU08vs50tVNnMBAycUFgzP5ByxqPBItAX1kMXDqdfo 84RQ== 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:from :date:message-id:subject: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=lnhZSpfgLAKfodT5pma8rufDAsBqdHhD1n8OPVNRL2A=; b=hydb9unQB83qMkkiZCneq8alukmuUjjMo0dVuOHW2NJDyldUdeUrNsumpyJvw3RXbm 4FVOhrvT4zOok2mZG5Kf4IpY90XawqV29J+5IO6+3f/5g0XruXLGgAQ/laaUvzo8L5aQ VcfKOGGdNeWOPZpHGp8iWSsHa9p+zdFTQWScYvCwBrhdbpgt19JIjbb67o64cRUGseKE KpvzyeAj3Nkjq0wiTE56suwE8/zOXUeJ+zdj2XV8iCzNT+Ihaj2l9og4q0uHN79LZwO2 TcXcXqgsfH5kfshrKgEnV7RknGTMZCiZ4OB+sEq3ChPSuzvHYNlC0evxlg3Kq7U8tSj8 LqGA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ABUngveQTT/vc9H/RVP/DaiAUQsJf0k6dq1tp8X2mHLW/pfZwduBRXS3h5Gh4GzmgBcPSA== X-Received: by 10.157.45.170 with SMTP id g39mr1329542otb.16.1479200874673; Tue, 15 Nov 2016 01:07:54 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.3.145 with SMTP id f17ls9676869otf.27.gmail; Tue, 15 Nov 2016 01:07:54 -0800 (PST) X-Received: by 10.31.21.129 with SMTP id 123mr5189875vkv.14.1479200874146; Tue, 15 Nov 2016 01:07:54 -0800 (PST) Original-Received: from mail-it0-x241.google.com (mail-it0-x241.google.com. [2607:f8b0:4001:c0b::241]) by gmr-mx.google.com with ESMTPS id 13si123093itg.2.2016.11.15.01.07.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Nov 2016 01:07:54 -0800 (PST) Received-SPF: pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4001:c0b::241 as permitted sender) client-ip=2607:f8b0:4001:c0b::241; Original-Received: by mail-it0-x241.google.com with SMTP id n68so20912739itn.3 for ; Tue, 15 Nov 2016 01:07:54 -0800 (PST) X-Received: by 10.36.73.11 with SMTP id z11mr1846208ita.21.1479200873443; Tue, 15 Nov 2016 01:07:53 -0800 (PST) Original-Received: by 10.107.36.17 with HTTP; Tue, 15 Nov 2016 01:07:52 -0800 (PST) Original-Received: by 10.107.36.17 with HTTP; Tue, 15 Nov 2016 01:07:52 -0800 (PST) In-Reply-To: <38bfec67-90f0-4d71-b054-1eedfd853d96-/JYPxA39Uh5TLH3MbocFFw@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:4001:c0b::241 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-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:16022 Archived-At: --001a11c1476a9cf64d0541534a6d Content-Type: text/plain; charset=UTF-8 Yes my main point was that the 'code' should be CSV only, since I actually have had to modify the CSV programmatically before converting it to AST. I don't really see the argument about including a caption containing Markdown in the YAML. A caption in the attributes may also contain Markdown. You will have to shell out to pandoc in both cases. Even the CSV might contain markup. I actually edited the data for a whole dictionary as spreadsheet/CSV once! It was before I discovered pandoc so the embedded markup was LaTeX and didn't get parsed as part of the CSV processing, but I would probably do it more or less the same way now. /bpj Den 15 nov 2016 07:03 skrev "Kolen Cheung" : > I think he means the content of the codeblock should be CSV only and let > the attributes to encode all the necessary metadata. > > I also agree that YAML metadata is more natural for data (so the value > wouldn't always be a string and requires additional parsing, and can have > markdown, which is important for caption). I don't entirely understand the > workflow he describe, probably he means another filter that process the > attribute and inject a CSV there. (That's the primary reason on the feature > request in panflute that allow truly empty YAML. And thanks for considering > that.) > > I'm thinking a more natural way to specify the code block is a CSV is not > by class but by a special key-value pair, say, `filter=csv2table`. This way > seems to fit better in the picture that "panflute auto-install the filter > for the user". The "filter" YAML key in the main document specify which > filter pan flute will execute, and the attribute in any element > `filter=...` determines where would the filter be acting upon. (at least > for those elements that support attributes). > > For my filter, I am thinking may be I should turn it into a cli that's > like pandoc but for tables. Unimaginatively, let's call that panxls for the > meanwhile. Suppose it can do `panxls -f csv -t json`, and also HTML, LaTeX, > xlsx, etc. Then provide a thin wrapper that's a pandoc filter and define a > general syntax to apply the cli in a pandoc markdown document. > > -- > 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/38bfec67-90f0-4d71-b054-1eedfd853d96% > 40googlegroups.com. > 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-/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_yuQU3BRFaJW7QQof_bvU7muAUZGKg7DRc4gEp%3D4ZibAjHw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. --001a11c1476a9cf64d0541534a6d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Yes my main point was that the 'code' should be CSV = only,=C2=A0=C2=A0 since I actually have had to modify the CSV programmatica= lly before converting it to AST. I don't really see the argument about = including a caption containing Markdown in the YAML. A caption in the attri= butes may also contain Markdown. You will have to shell out to pandoc in bo= th cases. Even the CSV might contain markup. I actually edited the data for= a whole dictionary as spreadsheet/CSV once! It was before I discovered pan= doc so the embedded markup was LaTeX and didn't get parsed as part of t= he CSV processing, but I would probably do it more or less the same way now= .

/bpj


Den 15 nov 2016 0= 7:03 skrev "Kolen Cheung" <christian.kolen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
I think he means the content of the codeblock shou= ld be CSV only and let the attributes to encode all the necessary metadata.=

I also agree that YAML metadata is more natural for data (so the value woul= dn't always be a string and requires additional parsing, and can have m= arkdown, which is important for caption). I don't entirely understand t= he workflow he describe, probably he means another filter that process the = attribute and inject a CSV there. (That's the primary reason on the fea= ture request in panflute that allow truly empty YAML. And thanks for consid= ering that.)

I'm thinking a more natural way to specify the code block is a CSV is n= ot by class but by a special key-value pair, say, `filter=3Dcsv2table`. Thi= s way seems to fit better in the picture that "panflute auto-install t= he filter for the user". The "filter" YAML key in the main d= ocument specify which filter pan flute will execute, and the attribute in a= ny element `filter=3D...` determines where would the filter be acting upon.= (at least for those elements that support attributes).

For my filter, I am thinking may be I should turn it into a cli that's = like pandoc but for tables. Unimaginatively, let's call that panxls for= the meanwhile. Suppose it can do `panxls -f csv -t json`, and also HTML, L= aTeX, xlsx, etc. Then provide a thin wrapper that's a pandoc filter and= define a general syntax to apply the cli in a pandoc markdown document.
--
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 pa= ndoc-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pandoc-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/38bfec67-90f0-4d71-b054-1eedfd853d96%40go= oglegroups.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_yuQU3BRFaJW7QQof_bvU7muAUZGKg7DRc4= gEp%3D4ZibAjHw%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--001a11c1476a9cf64d0541534a6d--