From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16225 Path: news.gmane.org!.POSTED!not-for-mail From: Sergio Correia Newsgroups: gmane.text.pandoc Subject: Re: Markdown, tables and CSV Date: Tue, 29 Nov 2016 14:30:32 -0800 (PST) Message-ID: <7e398825-a285-4e73-ad3d-908f1f141589@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_12483_1923258058.1480458632232" X-Trace: blaine.gmane.org 1480458634 573 195.159.176.226 (29 Nov 2016 22:30:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2016 22:30:34 +0000 (UTC) Cc: mf-+Z+QprJ1jbpwFuiNLMe2Ig@public.gmane.org To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCOYT6WP5QGRBCMD7DAQKGQEH4474CI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Nov 29 23:30:30 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pg0-f59.google.com ([74.125.83.59]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBquz-0007Tv-PQ for gtp-pandoc-discuss@m.gmane.org; Tue, 29 Nov 2016 23:30:29 +0100 Original-Received: by mail-pg0-f59.google.com with SMTP id x23sf21140559pgx.1 for ; Tue, 29 Nov 2016 14:30:34 -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=Jp2WNpA/k8i0rwU1fogrvE1DYGaXa5NWfNRNu/dRSG0=; b=MGEHP5znssrazE33woofuiZ0hHPjN8ogfpeNaYQ98ntPtCA5GFpb1fLmzoKQ5WPIKq T8WzKlm23OQZbmHnc2VZht2IMU221HjHszf5Wg5WT7XKN17DtyGDyHP+MOh0+No4HBJS F7KTA+9Rpcg98bR3SfWP2rgSTq9OG+eUQvgAgdrr37hukzzymlGHgZMjWEliCys09S3+ xjDTB3O4tYiXvZdxJ97wOfeQWr17P17UzGqfW9IxOU8Ng4418yav7Wrm+PFSJ5WFh3Tp uns5QuCWvN174vzyIlT6Bg8fRpxcmhAszo7NOGq9lThLLLIXU0xbBV0d5NyEiudHELZP KAVg== 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=Jp2WNpA/k8i0rwU1fogrvE1DYGaXa5NWfNRNu/dRSG0=; b=r4RQZ2T1ypqruSn4EftBY3/YzihI6oJg8G7jDYq9bYerDy0LGT8NPqUf3QNldb88wO 0wgtEw4y0P83Ez+j6krf53Mvl83+DTRQtZv5Zt6q70VSPhxla8HTtTbcwCXcBcAPn0y9 uMxl8WNRVUF46fJ/J4GO57fuXOGPSwto81ysaky+gNZv9BKSzAQCBK+wjc69ay7blNGH 4hJLIJ/JlryXA2sXqs3OU4uRAtfa4iOVQayJpOk6nO4mq5wwtN3ib/zfArdaGGzBvsw8 4iAGzj7l66pYboeICBQmxFX5vnxXDz37igxKFSBG5xxyeKWB2fQJDxuqAR7qsnOUbgEX K+jw== 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=Jp2WNpA/k8i0rwU1fogrvE1DYGaXa5NWfNRNu/dRSG0=; b=nLZiowuxe4R2bq1XLNL7ydkKTLPuHkWzr1cTG6UnjcYmPeMUw+cPlKNzVboMkqYwON DfDc0oVP1cAQZI/aMqwD9QyGwbL21YJxgzmbT/ISuADatXKkixOnkh/yIH1UFgr1ND0e f2wvErgczeIqxlaiKcVPpVCxdCRnO2kWnvqg9YfyZzaJ5PCiow6TWPJ3G9EazQTmF0xg sMN8s7MZk6tOgxvDXyZF5Wqy93eCKq/VnJFbgYr9Pze/U51u5CupldoG6Ayxs8V7Du4G 7lwlbYRNovMtouDEKbz+zZv+79MoABUPGBbb5Bmj7ZDJQQxP697HNUZTKPcJD/XwSISy 3AZg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AKaTC0244FsjTu1uaVC113U9vdoKc1N/RPB8EOrUFmt6mxtFfiwXQaRLKj6emi0grrWE7A== X-Received: by 10.157.8.134 with SMTP id 6mr1412471otf.17.1480458633393; Tue, 29 Nov 2016 14:30:33 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.63.218 with SMTP id i26ls13167733ote.48.gmail; Tue, 29 Nov 2016 14:30:32 -0800 (PST) X-Received: by 10.157.11.248 with SMTP id 111mr1418973oth.4.1480458632923; Tue, 29 Nov 2016 14:30:32 -0800 (PST) In-Reply-To: X-Original-Sender: sergio.correia-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:16225 Archived-At: ------=_Part_12483_1923258058.1480458632232 Content-Type: multipart/alternative; boundary="----=_Part_12484_15438937.1480458632232" ------=_Part_12484_15438937.1480458632232 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cool trick! I can see now why were you testing the convert_text() code. One question though, if you first do pandoc example.md --output=3Dexample2.md Then applying the filters to example2.md would be an idempotent operation? On Tuesday, November 29, 2016 at 5:13:18 PM UTC-5, Kolen Cheung wrote: > > Hi, > > I wrote another =E2=80=9Cinteresting=E2=80=9D filter base on the same ide= a, but in=20 > reverse: pantable/pantable2csv.py at master =C2=B7 ickc/pantable=20 > .= =20 > It converts all tables in pandoc to a YAML-CodeBlock-styled CSV table=20 > defined in pantable. > > Effectively, it adds a =E2=80=9CCSV Writer=E2=80=9D, where pantable is ki= nd of =E2=80=9CCSV=20 > Reader=E2=80=9D. > > I can kind of achieve idempotence here, but only at [image: P^3 =3D P^2],= =20 > not [image: P^2 =3D P] (it=E2=80=99s from pandoc though). Basically it ca= ptures all=20 > info from pandoc=E2=80=99s AST, so the conversion pantable2csv did should= be=20 > =E2=80=9Clossless=E2=80=9D. > > These are at least important to me because I can safely jump between the = 2=20 > formats (native pandoc table and csv table in code-block) without worryin= g=20 > too much. I could jump to csv for edit (more low-level, e.g. width contro= l)=20 > and jump back to pandoc tables for better readability. > =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/7e398825-a285-4e73-ad3d-908f1f141589%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_12484_15438937.1480458632232 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Cool trick!

I can see now why were you = testing the convert_text() code.

One question thou= gh, if you first do

pandoc example.md --output=3De= xample2.md

Then applying the filters to example2.m= d would be an idempotent operation?


On Tuesday, November = 29, 2016 at 5:13:18 PM UTC-5, Kolen Cheung wrote:

Hi,

I wrote another =E2=80=9Cintere= sting=E2=80=9D filter base on the same idea, but in reverse: pantable/pantable2cs= v.py at master =C2=B7 ickc/pantable. It converts all tables in pandoc t= o a YAML-CodeBlock-styled CSV table defined in pantable.

Effectively, it adds a =E2=80= =9CCSV Writer=E2=80=9D, where pantable is kind of =E2=80=9CCSV Reader=E2=80= =9D.

I can kind of achieve idempoten= ce here, but only at 3D"P^3, not 3D"P^2 (it=E2=80=99s from pandoc though). Basically it cap= tures all info from pandoc=E2=80=99s AST, so the conversion pantable2csv di= d should be =E2=80=9Clossless=E2=80=9D.

These are at least important to= me because I can safely jump between the 2 formats (native pandoc table an= d csv table in code-block) without worrying too much. I could jump to csv f= or edit (more low-level, e.g. width control) and jump back to pandoc tables= for better readability.

=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/7e398825-a285-4e73-ad3d-908f1f141589%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_12484_15438937.1480458632232-- ------=_Part_12483_1923258058.1480458632232--