From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/15020 Path: news.gmane.org!not-for-mail From: mb21 Newsgroups: gmane.text.pandoc Subject: Re: Markdown, tables and CSV Date: Mon, 30 May 2016 00:47:50 -0700 (PDT) Message-ID: <27f2fe62-8115-4513-b13a-c995f625f60d@googlegroups.com> References: <047d7b86ebe83c062b05332eab9b@google.com> <20BF19CB-A2B0-4B19-A749-D750CDD89736@martinfenner.org> <001833c9-e40d-4079-ba79-c88c852780a5@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2812_469779821.1464594470363" X-Trace: ger.gmane.org 1464594476 18027 80.91.229.3 (30 May 2016 07:47:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 May 2016 07:47:56 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDCMBBVJ5EFBBJ7AV65AKGQEKT7OTQI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon May 30 09:47:55 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-qg0-f64.google.com ([209.85.192.64]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b7HvU-0006xa-HG for gtp-pandoc-discuss@m.gmane.org; Mon, 30 May 2016 09:47:52 +0200 Original-Received: by mail-qg0-f64.google.com with SMTP id p34sf1646059qgp.0 for ; Mon, 30 May 2016 00:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=Y7TGFoly3rDCJxIln9Ub+zxdQ16alupshMkEOaWafXE=; b=i0UzX1krBpQJvYcdsZPB8upp1QGtGqJlqTxQUlqwp17KBqUwhyFIG6r+hA79tYLq3B cgdRLydXuOPewpK9/phTt+Hd5LD/vjCtbDMARowlEVxu5svEWnkDh3fLa5Wd4IWHId79 uJcvGwhH59ZkP/P7OL4LC1IfYFBryo2z4KYT+tCacrl1NdOMJAdieYsylgtfXesIukw2 am6+tc4Miap8mSOv0wl2qjMk3jS19uqZZ2WJQXUBnBVkKXpx1yXOe8gWb0F63d89llff WqdX0pQmqF58Fymx9IGCZN2KE/N6NduDLosPEO8cmkMXK2Q6xDT4pZBLOCZeDQ1KXV4q 2bxQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=Y7TGFoly3rDCJxIln9Ub+zxdQ16alupshMkEOaWafXE=; b=Rik+kwrFw0t0ElT3OKgpLAHnQcs6w0W4e0dMDc8jTgtS8/KA3KduhjTqZwMt3ot3Ly W2rE1mMqvjcv4B5ugYIm1I4a/3eA05dh78NNB4Kitrbf2fEKlUaZEiLTnaloN4hToQfn U89lJ1WFWqdO8OkuxAT+VPc5JjUC2Xbjwae1B+yzxkFEbftPnCrs/9ibYb2y+H2VNSXO WG3jUbO2OEzJfv1KBxk8ke9IDl31B+iMr/uzI2y3cXpu906vkAvobHRE+EestUoFI5eC U283xQGKlryQs/o23Qxpt8rTUivHWQjueWPyRO5H/XgRmJxiSG0wdHATp03VZ/XBvW9k XAtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=Y7TGFoly3rDCJxIln9Ub+zxdQ16alupshMkEOaWafXE=; b=SgQ3f2U+naKlnKkwgMT+29wagjakCyGarihlRxAdsYq0bnxcffgZWAMna7DIohXZdz RV+VMlTaoqgjFXcA8N7Mi0B7KZ9EklMXrkAjozRleiYu8/9gTOIj5wcLC9DddEU3vmcY jpa5GqHFUyf3dSlwNQiTIAuRNDl4vutlxT+DgPLFppCY2ytsV1S0jD0B0c3dczmVP7by 3W1oBf0xuemYkNIErCl0cb7SBnmf9uRjRtue1igo9UsMl2J+AVor01l9VNVUt+DTM4X+ pJnYrGMfCQkXAL8x1mEVoxOayeuOmEHedDeNtTd+VR6gc86eY38uNAiC18chQ5s6CW5l 6hoQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ALyK8tILmdxLKdWvAhg/r4LmJi3tn7/UIAxHkyaVdPBNubdpBb3LwqmdOsp2s1Yn6gDD1A== X-Received: by 10.157.5.183 with SMTP id 52mr322696otd.2.1464594471732; Mon, 30 May 2016 00:47:51 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.61.199 with SMTP id l65ls276333otc.57.gmail; Mon, 30 May 2016 00:47:51 -0700 (PDT) X-Received: by 10.157.10.23 with SMTP id 23mr319533otg.12.1464594470972; Mon, 30 May 2016 00:47:50 -0700 (PDT) In-Reply-To: <001833c9-e40d-4079-ba79-c88c852780a5-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: mauro.bieg-Re5JQEeQqe8AvxtiuMwx3w@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:15020 Archived-At: ------=_Part_2812_469779821.1464594470363 Content-Type: multipart/alternative; boundary="----=_Part_2813_1842318762.1464594470364" ------=_Part_2813_1842318762.1464594470364 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Well, in the end it is the pandoc markdown writes that is used to generate= =20 the tables, so you're on the right track with -t markdown+multiline_tables.= =20 However, unfortunately the logic is a bit more complicated, see=20 https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Writers/Markdown.= hs#L444.=20 Since all table-options are enabled by default, you have to turn OFF the=20 kind of tables you don't want, e.g. to get pipe-tables: pandoc --filter=20 pandoc-placetable -t markdown-simple_tables I agree that this is not optimal, but this behaviour should be changed in= =20 the markdown writer, not the filter... On Sunday, May 29, 2016 at 5:59:49 PM UTC+2, kurt.p...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org wrote= : > > Am Sonntag, 29. Mai 2016 14:45:35 UTC+2 schrieb mb21: > > @Kurt, pandoc-placetable works perfectly to convert csv to markdown table= =20 >> syntax (and any other output format where pandoc supports generating=20 >> tables):=20 >> pandoc --filter pandoc-placetable -t markdown >> >> Sorry, I did not intend to mis-represent what pandoc-placetable=20 > currently can do and what it cannot. > > I know it can convert to Markdown tables. But (AFAIU) it can generate onl= y=20 > one type of table: simple_table. > However, with pandoc-csv2table I can generate simple_table,=20 > multiline_table, pipe_table and grid_table types =E2=80=94 simply by addi= ng it=20 > into the code block metadata: {.table header=3D"yes" type=3D"grid" ....}. > > I tried to get the same thing with pandoc --filter pandoc-placetable -t= =20 > markdown+multiline_tables, but it didn=E2=80=99t work. > > (Maybe I=E2=80=99m missing something =E2=80=94 then please tell me.) > > Cheers, Kurt > > On Saturday, May 21, 2016 at 7:03:57 PM UTC+2, kurt.p...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org= =20 >> wrote: >>> >>> Am Freitag, 20. Mai 2016 11:39:02 UTC+2 schrieb Martin Fenner: >>> >>> Dear group, >>>> >>>> The topic of CSV support in Pandoc has come up several times on this= =20 >>>> list, includes this thread from 2014: >>>> https://groups.google.com/forum/#!topic/pandoc-discuss/kBdJU_JktzI >>>> >>>> Since last year I work for an organisation that frequently deals with= =20 >>>> tabular data (and helped organize CSVconf earlier this month), and I h= ave=20 >>>> done some thinking on how CSV could fit into Pandoc. >>>> >>> Are you aware of these two Pandoc filters? >>> >>> - *pandoc-csv2table * ( >>> https://github.com/baig/pandoc-csv2table)=20 >>> - pandoc-placetable ( >>> https://github.com/mb21/pandoc-placetable)=20 >>> >>> Both =E2=80=9Cabuse=E2=80=9D the fenced code block syntax, assign the c= lass .table to=20 >>> the block and allow inline CSV data as well as referencing an external = CSV=20 >>> file. >>> >>> Personally, I still prefer to use *csv2table* (over the newer=20 >>> *placetable*) because I can also use it to convert CSV to Markdown=20 >>> tables (grid, simple and multiline) =E2=80=94 which *placetable=E2=80= =9D currently doesn=E2=80=99t=20 >>> do because it works differently (AFAIU): >>> >>> - placetable converts CSV to Pandoc=E2=80=99s native format directly= =20 >>> - csv2table converts CSV to Markdown first.=20 >>> >>> =E2=80=8B >>> >> =E2=80=8B > --=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/27f2fe62-8115-4513-b13a-c995f625f60d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_2813_1842318762.1464594470364 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Well, in the end it is the pandoc markdown writes that is = used to generate the tables, so you're on the right track with -t markd= own+multiline_tables. However, unfortunately the logic is a bit more compli= cated, see=C2=A0https://github.com/jgm/pandoc/blob/mast= er/src/Text/Pandoc/Writers/Markdown.hs#L444. Since all table-options ar= e enabled by default, you have to turn OFF the kind of tables you don't= want, e.g. to get pipe-tables: pandoc --filter pandoc-placetable -t markdo= wn-simple_tables
I agree that this is not optimal, but this behaviour s= hould be changed in the markdown writer, not the filter...

On S= unday, May 29, 2016 at 5:59:49 PM UTC+2, kurt.p...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org wrote:

Am Sonntag, 29. Mai 2016 14:45:35 UTC+2 schrie= b mb21:

@Kurt, pandoc-placetable works perf= ectly to convert csv to markdown table syntax (and any other output format = where pandoc supports generating tables):=C2=A0
pandoc --filter pandoc-placetable -t markdown

Sorry, I did not intend to mis-repr= esent what pandoc-placetable currently can do and w= hat it cannot.

I know it can convert to Markdown t= ables. But (AFAIU) it can generate only one type of table: simple_table.
However, with pandoc-csv2table I can generate simple_table, = multiline_table, pipe_table and grid_table types =E2=80=94 simply by adding it into the code b= lock metadata: {.table header=3D"yes" type=3D&qu= ot;grid" ....}.

I tried to get the same thing with = pandoc --filter pandoc-placetable -t markdown+multiline_ta= bles, but it didn=E2=80=99t work.

(Maybe I=E2=80=99m missing somethin= g =E2=80=94 then please tell me.)

Cheers, Kurt

On Saturday, May 21, 2016 at 7:03:5= 7 PM UTC+2, kurt.p...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org wrote:

Dear group,
=
The topic of CSV support in Pandoc has come up several times= on this list, includes this thread from 2014:

Since last year = I work for an organisation that frequently deals with tabular data (and hel= ped organize CSVconf earlier this month), and I have done some thinking on = how CSV could fit into Pandoc.

Are you aware of these two Pandoc f= ilters?

Both =E2=80=9Cabuse=E2=80=9D the fe= nced code block syntax, assign the class .table to = the block and allow inline CSV data as well as referencing an external CSV = file.

Personally, I still prefer to use <= em>csv2table (over the newer placetable) because I can also u= se it to convert CSV to Markdown tables (grid, simple and multiline) =E2=80= =94 which *placetable=E2=80=9D currently doesn=E2=80=99t do because it work= s differently (AFAIU):

  • placetable converts CSV to Pandoc=E2=80=99s = native format directly
  • csv2table converts CSV to Markdown first.
=E2=80=8B
=

=E2=80=8B

--
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/27f2fe62-8115-4513-b13a-c995f625f60d%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_2813_1842318762.1464594470364-- ------=_Part_2812_469779821.1464594470363--