From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16609 Path: news.gmane.org!.POSTED!not-for-mail From: Kolen Cheung Newsgroups: gmane.text.pandoc Subject: [Feature Request] Filter with arguments Date: Thu, 5 Jan 2017 20:32:33 -0800 (PST) Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_431_98645186.1483677153674" X-Trace: blaine.gmane.org 1483677162 24240 195.159.176.226 (6 Jan 2017 04:32:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Jan 2017 04:32:42 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS252WXTEIBBYV3XTBQKGQE2ZE3CAQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 06 05:32:38 2017 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 1cPMCc-0004aj-Am for gtp-pandoc-discuss@m.gmane.org; Fri, 06 Jan 2017 05:32:30 +0100 Original-Received: by mail-pg0-f59.google.com with SMTP id l5sf149971798pgh.1 for ; Thu, 05 Jan 2017 20:32:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id: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=2fp/B2wDRN5yNpfCpGb6lr7BAjQHC1H4CdKyPLi5R38=; b=LIUQucSrohCgdBbsHKKGv5lmQV1XWl5FR4mBpvhIkN6lFrieWWocImB2F9scGCRXkR 1FB3MQgyaI0X7d9CJs23scMPpfBUlfqRtz0nbnrpeyQaId6ncVbwcWzB4lJFjy6JQ9gK a8jdoQRglm5+pyV0wOuf6Nl7o71DBhQJ/KmrpBvZQ1PD/zchd6tvsN4HizU/D4hbqL2l 1S1GDJnDDA8UoyUQfesuhYbfNs5gftj9F4xhPduvfaU05nCPCSXv85+vhYZ9owakh7CV yYYWxUHxbQu8zW1xSXwMpLq2OALDPwqMV9MKMjBprhLWJoaCnpir8BhEL0e2ujCzIRKw 2dQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id: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=2fp/B2wDRN5yNpfCpGb6lr7BAjQHC1H4CdKyPLi5R38=; b=f4ZCwd2awF9bFXUagblcw/nVN+cZWekJERk0mnLtFrKww0hfDK/asrGRTb1CcxwdzH 2z3O75L9w1zcAqn6byQ61VS76NEIXJuqE6qecVrnUTKXm+ygGY9bT2tTkmbLKc1Wdz+g 3L8b26DJzMMdtNJFbhKEz7vCltZAEF3eaemZ695ZXJPCvMpcvB/oGVm/3jOT4t1Bg8yj qEaRjUQ9bxUhYKCXVzSVOEUTIJm0kg5g0/g9cdFyN0tJBvAq0lLsiMne37DBceo6PVqY /txjVkIloXGTmqTo2jYo1kpdgLNd0OX6jx1PbVBUEaznPhQnmpbi0KoZTt5U91iGEoUR TInQ== 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: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=2fp/B2wDRN5yNpfCpGb6lr7BAjQHC1H4CdKyPLi5R38=; b=mnPBKJ/iLmJesCbdncq38hHlav4aQjmht2Hq+11aUwlmUsk/caGpEQtbygU8G0PLh+ QpCGNMN2WKo9M+umTQA8IHvEU40lDbuQ3mUEzU7PLBKNlLrLBffPER/NkI5YeZ84sGcW /iZe4UoguRtBO6GrJ90CLEQfwhaSTGwH9V48Mr8emX7ieRGduv1dvH+bIG2B7WH0jlrl +/THR4jKWjnjIlzpXcyw67l2Euyd2UXAJz0LAY9MvwN49jhoZBnuSufTDT5YBarMm6cR +8tg0fkphVUy8uDZrX1KyHPqEJuWSQF97gVTfOf+gIaKy/Uy710R6YI9H4cgXSBGkqtO xzKA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AIkVDXKAtw64h//g8Og0bEV6ygCA+Y99S8G4NFqoLLFZDpf/NHK68n/sLUj0XzQ5pQZE1Q== X-Received: by 10.157.12.165 with SMTP id b34mr48011otb.2.1483677154409; Thu, 05 Jan 2017 20:32:34 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.4.76 with SMTP id 70ls314620otc.32.gmail; Thu, 05 Jan 2017 20:32:34 -0800 (PST) X-Received: by 10.157.61.131 with SMTP id l3mr45068otc.18.1483677154074; Thu, 05 Jan 2017 20:32:34 -0800 (PST) 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:16609 Archived-At: ------=_Part_431_98645186.1483677153674 Content-Type: multipart/alternative; boundary="----=_Part_432_1033182823.1483677153674" ------=_Part_432_1033182823.1483677153674 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. t= o pandoc -t json -s example.md | pantable -t csv | pandoc -f json -s -o examp= le.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, but= =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/e8cf9c92-7aa7-4841-85d0-7464c771cf6e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_432_1033182823.1483677153674 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= Currently, if one need to pass arguments to a filter, one need to pipe it t= hrough.

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

pandoc -F "pantable -t csv" -s -o example.tex example.md
# which i=
s equiv. to
pandoc -t json -s example.md | pantabl=
e -t csv | pandoc -f json -s -o example.tex

To elaborate a little bit fu= rther: 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, poten= tially with different output code formats (e.g. csv, yaml, json, etc. or ev= en other kinds e.g. HTML, Div with CSS table, etc.)
  3. standalone cli. i.e. not a filter

Right now (1) and (2) are mu= tually exclusive and has to be split into 2 filters. (1) and (3) can potent= ially 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/e8cf9c92-7aa7-4841-85d0-7464c771cf6e%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_432_1033182823.1483677153674-- ------=_Part_431_98645186.1483677153674--