From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/20395 Path: news.gmane.org!.POSTED!not-for-mail From: Peter Zagubisalo Newsgroups: gmane.text.pandoc Subject: Re: [Feature Request] Filter with arguments Date: Wed, 20 Jun 2018 07:58:43 -0700 (PDT) Message-ID: <7998338d-31dc-4a97-b938-6a035e2cd702@googlegroups.com> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_24787_947814127.1529506723554" X-Trace: blaine.gmane.org 1529506600 20343 195.159.176.226 (20 Jun 2018 14:56:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 20 Jun 2018 14:56:40 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDC4F7VOW4FBBJGXVHMQKGQEBEJTKVI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 20 16:56:36 2018 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-oi0-f61.google.com ([209.85.218.61]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fVeXB-000591-VV for gtp-pandoc-discuss@m.gmane.org; Wed, 20 Jun 2018 16:56:34 +0200 Original-Received: by mail-oi0-f61.google.com with SMTP id v71-v6sf1979917oie.20 for ; Wed, 20 Jun 2018 07:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=kEXlvjqzl9k4shnYEyFZVFRrt3PmNn/yjlUuluf8h1c=; b=sLATby6g1BqM4BG5W0gY8HnErBUEsj/zAp6/IMzisY1BWagynp9KBraqCCOXIrSrH6 nyTUEQjlLim+tGPrIYZq/wXo+HHXlwr7IYj6fsS9St8g3nhVsGK4p0qqCyTuYsxLBZ1W U0UKaqgP8HeHZ13llOCGeuH8rbCWPpe6yLhY6L75zPri4QVzm28+/isc7R68STSMJvWJ CZUfg26gVF/G+nLwhDe3SvQ3Qg7nX+U5r1w8qYjMzBgdFlmClcmdCZQfix8lYvkUkJH5 zqAKH0mjiOpZbiryM0PgFkB8IttAgT/qnu3R5ygPHglDWh3rN2bK0l6SJYrKI5rWnkj+ 6Yfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=kEXlvjqzl9k4shnYEyFZVFRrt3PmNn/yjlUuluf8h1c=; b=fyckG1OEuTSjVGQDZlE1VFvv8yPw4mjyTSiGzu5KEl6U+wHceMXtNbjmfF8lGdkJK4 xx7YPsCI01bC5envzjIIInTmE0JATSfQbISsk+byZG39TJkGO26Rj6RCXWhMdbsB5s/Y fDwwE6D62q82SkD9/JcEdi++DAIkmQzbwTRFvHJ/4FcLihNF47PVceYFZzgnkwDVz27z kd0OiFxpTySK6YxCt4s7CtwGZqavlYGxhdQGAVVa9WVdHBcjcJCrtXSN5pDykJTZJSKG hub6AtnDrOHT15hiPhbiPjHMFHF9AIs/MErhEz2KUdmJb89DggVRmdxVMyWy2ax89JI/ QBPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=kEXlvjqzl9k4shnYEyFZVFRrt3PmNn/yjlUuluf8h1c=; b=tz31TTe8SHt+AKLmEBmYEGIs6B4Hd29aWZwFM1ruOrajUj1Zz+5WYpXAmqiMCxwTZi 9ZiLsAf2j9lPxKVAgp/UiruCRuZQae6V29q4H2uRQXVuKRpJzPP0SUOqE+aQL6jPmBzs C87x5o0Aya+R8cM6az7/hQbLq+Y2K3+Fx3d45QyFXO2cU/S/uGk31pWk//WOwG845TPW Q451SNV2b6lqMQyoXlN3k+UATvHbYEF0plz4tsoaLB+1Mu3FatU5YUiak13DsV0t6Uu7 Wk85wLZnVvnPUi/iklJMajDQHZkTm9Gxv383bPi9aH57LzNhGdeHRWjVU0JJQL7Dh46E 2zGQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APt69E0UNqAkciawVpvihH9/LZ2u0DtePUs5+omOXFoDth++ZlCuk8Ns k3W1/i7+HZd4tJijc5jNhKk= X-Google-Smtp-Source: ADUXVKJZos3huH38wPf9xwpwByuM4BRUpkNt5zMP+3Bf3mduBkdYcua2numxsG3nOHOhjJ0VukDRRQ== X-Received: by 2002:a9d:190a:: with SMTP id j10-v6mr204774ota.0.1529506725044; Wed, 20 Jun 2018 07:58:45 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:2a57:: with SMTP id t81-v6ls982682ota.1.gmail; Wed, 20 Jun 2018 07:58:44 -0700 (PDT) X-Received: by 2002:a9d:6218:: with SMTP id g24-v6mr200471otj.4.1529506724104; Wed, 20 Jun 2018 07:58:44 -0700 (PDT) In-Reply-To: X-Original-Sender: peter.zagubisalo-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:20395 Archived-At: ------=_Part_24787_947814127.1529506723554 Content-Type: multipart/alternative; boundary="----=_Part_24788_1901417125.1529506723554" ------=_Part_24788_1901417125.1529506723554 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > In order to have Pandoc filters with arguments I wrote pandoctools -=20 > https://github.com/kiwi0fruit/pandoctools - a profile manager of text=20 > processing pipelines that consist of Pandoc filters or any text CLI=20 > filters. Profiles are special bash scripts so they are quite flexible. > > Introduction about workflow that uses pandoctools:=20 > https://github.com/kiwi0fruit/atom-jupyter-pandoc-markdown > In order to have Pandoc filters with arguments I wrote pandoctools -=20 https://github.com/kiwi0fruit/pandoctools - a profile manager of text=20 processing pipelines that consist of Pandoc filters or any text CLI=20 filters. Profiles are special bash scripts so they are quite flexible. Introduction about workflow that uses pandoctools:=20 https://github.com/kiwi0fruit/atom-jupyter-pandoc-markdown Kolen Cheung =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: Currently, if one need to pass arguments to a filter, one need to pipe it= =20 > through. > > It would be convenient in some cases to allow passing argument to filters= .=20 > e.g. > > pandoc -F "pantable -t csv" -s -o example.tex example.md# which is equiv.= to > pandoc -t json -s example.md | pantable -t csv | pandoc -f json -s -o exa= mple.tex > > To elaborate a little bit further: I want to write a filter that at the= =20 > same time do: > > 1. convert code block to table=20 > 2. convert pandoc tables to code block, potentially with different=20 > output code formats (e.g. csv, yaml, json, etc. or even other kinds e.= g.=20 > HTML, Div with CSS table, etc.)=20 > 3. standalone cli. i.e. not a filter=20 > > Right now (1) and (2) are mutually exclusive and has to be split into 2= =20 > filters. (1) and (3) can potentially be written in the same executable, b= ut=20 > it is uglier and pointless to do so without including (2). > =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/7998338d-31dc-4a97-b938-6a035e2cd702%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_24788_1901417125.1529506723554 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In order to have Pandoc filters with arguments I wrote pandoctool= s - https://github.com/kiwi0fruit/pandoctools - a profile manager of text p= rocessing pipelines that consist of Pandoc filters or any text CLI filters.= Profiles are special bash scripts so they are quite flexible.

Introduction about wor= kflow that uses pandoctools: https://github.com/kiwi0fruit/atom-jupyter-pan= doc-markdown

In order to have Pandoc filters with arguments I wrote pandoctools - htt= ps://github.com/kiwi0fruit/pandoctools - a profile manager of text processi= ng pipelines that consist of Pandoc filters or any text CLI filters. Profil= es are special bash scripts so they are quite flexible.

Introduction about workflow that u= ses pandoctools: https://github.com/kiwi0fruit/atom-jupyter-pandoc-markdown=

Kolen Cheung =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0= =BB:


Currentl= y, if one need to pass arguments to a filter, one need to pipe it through.<= /p>

It would be convenient in some = cases to allow passing argument to filters. e.g.

pandoc -F "pantable -t csv" -s -o exa=
mple.tex example.md
# which is equiv. to
pandoc -t json -s example.md | pantable -t csv | pandoc =
-f json -s -o example.tex

To elaborate a little bit furth= er: I want to write a filter that at the same time do:

  1. convert code block to table
  2. convert pandoc tables to code block, potenti= ally with different output code formats (e.g. csv, yaml, json, etc. or even= other kinds e.g. HTML, Div with CSS table, etc.)
  3. standalone cli. i.e. not a filter

Right now (1) and (2) are mutua= lly exclusive and has to be split into 2 filters. (1) and (3) can potential= ly be written in the same executable, but it is uglier and pointless to do = so without including (2).

=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/7998338d-31dc-4a97-b938-6a035e2cd702%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_24788_1901417125.1529506723554-- ------=_Part_24787_947814127.1529506723554--