From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16009 Path: news.gmane.org!.POSTED!not-for-mail From: Kolen Cheung Newsgroups: gmane.text.pandoc Subject: Re: Markdown, tables and CSV Date: Sun, 13 Nov 2016 23:40:11 -0800 (PST) Message-ID: <14b8fa54-dc04-4874-bf47-fb268fc9f298@googlegroups.com> References: <047d7b86ebe83c062b05332eab9b@google.com> <20BF19CB-A2B0-4B19-A749-D750CDD89736@martinfenner.org> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2561_536525342.1479109211195" X-Trace: blaine.gmane.org 1479109235 17032 195.159.176.226 (14 Nov 2016 07:40:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 14 Nov 2016 07:40:35 +0000 (UTC) Cc: mf-+Z+QprJ1jbpwFuiNLMe2Ig@public.gmane.org To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS252WXTEIBBXGUUXAQKGQEFH3PGRA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Nov 14 08:40:30 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pg0-f60.google.com ([74.125.83.60]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6Bs9-0001F3-IV for gtp-pandoc-discuss@m.gmane.org; Mon, 14 Nov 2016 08:40:10 +0100 Original-Received: by mail-pg0-f60.google.com with SMTP id 3sf27798816pgd.0 for ; Sun, 13 Nov 2016 23:40:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:date:from:to:cc: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=SpOwE0oyKOnP3s34aKA5+tECrG4FbqDUybLq0RO4RtI=; b=Kai8FM+ePKNx4DxGY6YekiBX+1vrGKoxa4ybxnP2tlvljHIdi45SdNgEywE6pfziYQ C6mbRHMz7FoLdjEFgcwDvwPwHYtgYookplv+TzSVChQhfGTNLL8F3HHPECt0R5XXIc6i 9jiXKkS4YS/LDzkyfHb5Yj2X8RLDMpCE/EF8jeQJVJZo/ZFxZR2CQXX0tLQCV0lIlAnD wFTbkN9m2685cWZ2TXDFw6LEWLrnvVabK4nZOxRq6T625EskZnbNb2b92fyG8IFB6zaT WeaP4mUkkDK5hdG2Fo4M9JYVK989OgxASFZ9XDBY8KABITOpG4M1OhlAYrRJsc3PUN+M i2zQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc: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=SpOwE0oyKOnP3s34aKA5+tECrG4FbqDUybLq0RO4RtI=; b=vUhAyP6At413vU9AlutT3upoLaaFBDUnFQNIRehyFTcZOUyI7ChoJOl6JrQrx4VcbB ey+FYZS2YO5aRz8mfgHTKD9ukPz+NxuGYmacMiLsU1yPcT+Q9tlpvnTMD03b1St6xJf9 XompRocsjNu1Ljcd0zFxUK213y+AOdrCTNX2bwUimTrTWoEPQELfdiDmfPyBlNtyMZWD 3ppS2nEbQnLKO8NvlYsERbGXbh91TS3CNZn0YK4vB4arPkl6p3XKAAeNxzr0DtjV1Pjn vGM1sUk4qTQp//9XWhxRSOKKaCkfvNqSDNh9mp99Hc3yShiKFQrHIVfe0JuSonJc3k8l JfhA== 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:cc: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=SpOwE0oyKOnP3s34aKA5+tECrG4FbqDUybLq0RO4RtI=; b=gxSDJ6YpfDMKnZeH0wENrzWe2QPBvpkU52AVv0xi+U6hIStAumLLDUbH3WuAf4iJiy uzyYBxo0S4YtHLZ2NJpwzItV5S0ihbvDweoQHk78S7jdtCKfl34Ie5TZ6VAyBbu9Uhzv xnVr2ZUDlTea788nLRR7h78IRhDQ11evgMOEE2KxoCmJEpGukAbWXhsXcWXIUj5CM+Xz X/JUfT0MJrO4kcRrQ5CyYa982vOoSBBRQ1eFUBTS3xP54hsI/vq4SCuJn0/3+DJJjQVI iNl2hIf52V3wHDfeXJyrqPx9BvIki9mCHHnj1UH3gbJMVNqlrl/jqlxmSYxMvSfQuV92 IN7Q== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ABUngvc8VtO+WnjEteIqrlSaKcPXEYgDNtHR8OUwWsbmsRxlJxwRh15L5Sbj+57g8hropg== X-Received: by 10.157.48.39 with SMTP id d36mr978455otc.1.1479109212467; Sun, 13 Nov 2016 23:40:12 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.1.164 with SMTP id e33ls6161736ote.43.gmail; Sun, 13 Nov 2016 23:40:12 -0800 (PST) X-Received: by 10.157.17.3 with SMTP id g3mr63522ote.8.1479109211957; Sun, 13 Nov 2016 23:40:11 -0800 (PST) In-Reply-To: <20BF19CB-A2B0-4B19-A749-D750CDD89736-+Z+QprJ1jbpwFuiNLMe2Ig@public.gmane.org> X-Original-Sender: christian.kolen-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-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:16009 Archived-At: ------=_Part_2561_536525342.1479109211195 Content-Type: multipart/alternative; boundary="----=_Part_2562_421743474.1479109211196" ------=_Part_2562_421743474.1479109211196 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <#>Yet Another Pandoc Filters on CSV Tables=20 For those who are interested in using CSV tables in pandoc markdown, I=E2= =80=99m=20 writing a filter that build upon one of panflute=E2=80=99s example. And I= =E2=80=99m still=20 thinking about which exact syntax to use. Feel free to give suggestions. <#>Features=20 What separate this to existing filters is the automatic calculation of the= =20 column-width (in contrast with pandoc-placetable) and write to pandoc AST= =20 directly (in contrast with pandoc-csv2table), as well as specifying the=20 table width (a ratio to the line-width). And comparing with the 2 said=20 filters, panflute=E2=80=99s example use YAML to store data, rather than the= =20 attributes of the code-block (which I think is more natural for data). There=E2=80=99s a notebook in ickc/pandoc-table-csv-test/panflute-csv2table= .ipynb=20 =20 and the the filter is at ickc/pandoc-table-csv-test/csv-tables.py=20 . The current syntax is this (borrow much from panflute=E2=80=99s example, an= d the=20 csv is borrowed from pandoc-csv2table): ~~~csv title: "*Great* Title" has-header: False column-width: - 0.1 - 0.2 - 0.3 - 0.4 table-width: 0.8 alignment: LRCmarkdown: True --- 1,2,3,4 ~~~ <#>A Comparison of Metadata Keys Between Pandoc Filters on CSV Tables=20 My biggest questions is which metadata keys to use.=20 Backward-compatibility-wise, since pandoc-csv2table and pandoc-placetable= =20 use attributes to store metadata, while panflute=E2=80=99s example and mine= use=20 YAML to store, the only one I need to consider backward-compatibility is=20 panflute=E2=80=99s. But I actually think pandoc-csv2table/placetable=E2=80= =99s keys make=20 more sense. e.g. header vs has-header, caption vs title. And for alignment, pandoc-csv2table/placetable use aligns. For width,=20 placetable use widths. I=E2=80=99m not sure if I should follow them. A comparison of the keys: (The output is generated by my filter) +--------+----------------------------+-------------------+----------------= ----+--------------------------+ | | pandoc-csv2table | pandoc-placetable | panflute exampl= e | my proposal | +=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D+ | type | type=3Dsimple|multiline|grid | | = | | | | |pipe | | = | | +--------+----------------------------+-------------------+----------------= ----+--------------------------+ | header | header=3Dyes|no | header=3Dyes|no | has-header:= | header: True|False | | | | | True|False = | | +--------+----------------------------+-------------------+----------------= ----+--------------------------+ | captio | caption | caption | title = | caption | | n | | | = | | +--------+----------------------------+-------------------+----------------= ----+--------------------------+ | source | source | file | source = | source | +--------+----------------------------+-------------------+----------------= ----+--------------------------+ | aligns | aligns=3DLRCD | aligns=3DLRCD | = | alignment: LRCD | +--------+----------------------------+-------------------+----------------= ----+--------------------------+ | width | | widths=3D"0.5 0.2 | = | column-width: \[0.5, | | | | 0.3" | = | 0.2, 0.3\] | +--------+----------------------------+-------------------+----------------= ----+--------------------------+ | | | inlinemarkdown | = | markdown: True|False | +--------+----------------------------+-------------------+----------------= ----+--------------------------+ | | | delimiter | = | | +--------+----------------------------+-------------------+----------------= ----+--------------------------+ | | | quotechar | = | | +--------+----------------------------+-------------------+----------------= ----+--------------------------+ | | | id (wrapped by | = | | | | | div) | = | | +--------+----------------------------+-------------------+----------------= ----+--------------------------+ =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/14b8fa54-dc04-4874-bf47-fb268fc9f298%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_2562_421743474.1479109211196 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Yet A= nother Pandoc Filters on CSV Tables

For those who are interested= in using CSV tables in pandoc markdown, I=E2=80=99m writing a filter that = build upon one of panflute=E2=80=99s example. And I=E2=80=99m still thinkin= g about which exact syntax to use. Feel free to give suggestions.

Feature= s

What separate this to existi= ng filters is the automatic calculation of the column-width (in contrast wi= th pandoc-placetable) and write to pandoc AST directly (in contrast with pa= ndoc-csv2table), as well as specifying the table width (a ratio to the line= -width). And comparing with the 2 said filters, panflute=E2=80=99s example = use YAML to store data, rather than the attributes of the code-block (which= I think is more natural for data).

There=E2=80=99s a notebook i= n ickc/pandoc-table-csv-test/panflute-csv2table.i= pynb and the the filter is at ickc/pandoc-table-csv-test/c= sv-tables.py.

The current syntax is this (= borrow much from panflute=E2=80=99s example, and the csv is borrowed from p= andoc-csv2table):

~~~csv
title: "*Great* Title"
has-header: False
column-width:
  - 0.1
  - 0.2
  - 0.3
  - 0.4
table-width: 0.8
alignment: LRC
markdown: Tr=
ue
---
1,2,3,4
~~~

A Comparison of Metadata= Keys Between Pandoc Filters on CSV Tables

My biggest questions is whic= h metadata keys to use. Backward-compatibility-wise, since pandoc-csv2table= and pandoc-placetable use attributes to store metadata, while panflute=E2= =80=99s example and mine use YAML to store, the only one I need to consider= backward-compatibility is panflute=E2=80=99s. But I actually think pandoc-= csv2table/placetable=E2=80=99s keys make more sense. e.g. header<= /code> vs has-header, caption vs title.

And for alignment, pandoc-cs= v2table/placetable use aligns. For width, placetable use widths. I=E2=80=99= m not sure if I should follow them.

A comparison of the keys: (T= he output is generated by my filter)

+--------+-----------------------=
-----+-------------------+--------------------+--------------------------+
|        | pandoc-csv2table           | pandoc-placetable | panflute exampl=
e   | my proposal              |
+=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D+
| type   | type=3Dsimple|multiline|grid |                   |              =
      |                          |
|        | |pipe                      |                   |                =
    |                          |
+--------+----------------------------+-------------------+----------------=
----+--------------------------+
| header | header=3Dyes|no              | header=3Dyes|no     | has-header:=
        | header: True|False       |
|        |                            |                   | True|False     =
    |                          |
+--------+----------------------------+-------------------+----------------=
----+--------------------------+
| captio | caption                    | caption           | title          =
    | caption                  |
| n      |                            |                   |                =
    |                          |
+--------+----------------------------+-------------------+----------------=
----+--------------------------+
| source | source                     | file              | source         =
    | source                   |
+--------+----------------------------+-------------------+----------------=
----+--------------------------+
| aligns | aligns=3DLRCD                | aligns=3DLRCD       |            =
        | alignment: LRCD          |
+--------+----------------------------+-------------------+----------------=
----+--------------------------+
| width  |                            | widths=3D"0.5 0.2   |         =
           | column-width: \[0.5,     |
|        |                            | 0.3"              |           =
         | 0.2, 0.3\]               |
+--------+----------------------------+-------------------+----------------=
----+--------------------------+
|        |                            | inlinemarkdown    |                =
    | markdown: True|False     |
+--------+----------------------------+-------------------+----------------=
----+--------------------------+
|        |                            | delimiter         |                =
    |                          |
+--------+----------------------------+-------------------+----------------=
----+--------------------------+
|        |                            | quotechar         |                =
    |                          |
+--------+----------------------------+-------------------+----------------=
----+--------------------------+
|        |                            | id (wrapped by    |                =
    |                          |
|        |                            | div)              |                =
    |                          |
+--------+----------------------------+-------------------+----------------=
----+--------------------------+
=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/14b8fa54-dc04-4874-bf47-fb268fc9f298%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_2562_421743474.1479109211196-- ------=_Part_2561_536525342.1479109211195--