From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16637 Path: news.gmane.org!.POSTED!not-for-mail From: Melroch Newsgroups: gmane.text.pandoc Subject: Re: Filter with arguments Date: Sun, 8 Jan 2017 12:21:57 +0100 Message-ID: References: <20170106114647.GG791@Administrateurs-iMac-3.local> <1239e0f1-2538-4781-8a75-90c59f86aabc@googlegroups.com> <20170108090942.GA41105@Johns-MBP.home> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f403045fb968987ebf05459375b7 X-Trace: blaine.gmane.org 1483874524 25618 195.159.176.226 (8 Jan 2017 11:22:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 8 Jan 2017 11:22:04 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBWGBZDBQKGQEO2GAKQQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Jan 08 12:21:58 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-wm0-f64.google.com ([74.125.82.64]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQBXw-0005hp-0T for gtp-pandoc-discuss@m.gmane.org; Sun, 08 Jan 2017 12:21:56 +0100 Original-Received: by mail-wm0-f64.google.com with SMTP id k184sf16521825wme.1 for ; Sun, 08 Jan 2017 03:22:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:in-reply-to:references:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=r1Wg0DTNdNuM2ugiAZuhsfN3FC7lp4K5jUh+DRX6hVo=; b=VLtmKV6jl4o2M2Qv2tb/F7oZwdGUNRmjJI4mdjN/+MpWzC0v3gLk9u+Sgsca+Buk7o 7essUZW/SgujIijcO+b00N2I5KXIcZ5ufpWzesujkqPI5K98F4/s2fhIzJI87k+/m+vt PaqYhLX7e+503QnbzuPsyV1zvFOwbV0FCxBxX0souwBJ+1UMxDWXBsNYIsact17zIDSd xLxpykapnuud+vTjgne1gC9xA7lnL6u332HFXoVZYQao3eZY0jOgW20ujhuuyGl7qZ2Z U676GhP+ll5NfXcPg4UQLtXgQwp6jqCps9Xr6/ioJBK0LXIh6wemI2MMNRtiPbU0A1pr Z3GQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=r1Wg0DTNdNuM2ugiAZuhsfN3FC7lp4K5jUh+DRX6hVo=; b=Vt8w/JMCG2f21S5pX3r2bA3birvkXMYckBZvUuVFwG3DzFr7zbFqABfKPRvSCyYMeX ZgvupH/L4t3j9L9lHl/JWuaE8eU5Uuxcczf1RiIZ06EP8/2TPOXdkht2CD0+Y2LKmdeX SdjTVOlHrPlTl30uYsuj60FJ2gZB2eV4vibBaLcB5ljjB5UkSsAWGe6owoz2wTQdJyH5 hYyyWyD0+xcEMY/GSa8sVNDau7OcMJu6eQosXtdxwTQVJvGFQqLWhN6B1JjPRaH1NhXA RYg1uk4bytVFKLukxAIL0nGrh85DxzK8HB0fwSpmCYMmIDcDdZUy2m1JumVy23hdIbUD j5GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:in-reply-to:references:from :date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=r1Wg0DTNdNuM2ugiAZuhsfN3FC7lp4K5jUh+DRX6hVo=; b=t//EReo3lJqGWkI6PSTg4YyTTrblaIFLLy5uRVtqV5Ny3rOI0Z3XE8vxBROL70XNru LLGZAMB5oDWd+iLapZJiR+k51EszVLE1qtSK7zbvJG8RypZLWL8N+LbHESP5M3Zsg5J/ Z/9QlUF/nAfT5/+SSpChl7u7VIQYQYewwhWF4CKJAwFUwcrGqvJIeo42lhm942VXENJR Dvm2RXW0/UZyDB+WTq4/yUnKOEgp9HSX4nGJShTBJdrjWN1NNP+19oxVuNWc69vUUoVW O+fPDsVshGByEC0/wEmEqqdYptzIY7qOAU1iNrhoENa5PfY+UYq8Qom2NlyvYHbtBWXZ CpQw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AIkVDXJovMZabmuVfj5/tYWCVSmU1J4h+6KfhSpPJwgswuNK13sdla37VRL6Z8raxgNZcA== X-Received: by 10.25.25.134 with SMTP id 128mr160136lfz.3.1483874520472; Sun, 08 Jan 2017 03:22:00 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.46.1.132 with SMTP id f4ls124375lji.41.gmail; Sun, 08 Jan 2017 03:21:59 -0800 (PST) X-Received: by 10.46.6.17 with SMTP id 17mr431571ljg.2.1483874519842; Sun, 08 Jan 2017 03:21:59 -0800 (PST) Original-Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com. [2a00:1450:4010:c07::243]) by gmr-mx.google.com with ESMTPS id e134si514029wmd.3.2017.01.08.03.21.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jan 2017 03:21:59 -0800 (PST) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c07::243 as permitted sender) client-ip=2a00:1450:4010:c07::243; Original-Received: by mail-lf0-x243.google.com with SMTP id q89so3317813lfi.1 for ; Sun, 08 Jan 2017 03:21:59 -0800 (PST) X-Received: by 10.46.20.25 with SMTP id u25mr5515538ljd.61.1483874518988; Sun, 08 Jan 2017 03:21:58 -0800 (PST) Original-Received: by 10.114.224.39 with HTTP; Sun, 8 Jan 2017 03:21:57 -0800 (PST) Original-Received: by 10.114.224.39 with HTTP; Sun, 8 Jan 2017 03:21:57 -0800 (PST) In-Reply-To: X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c07::243 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com 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:16637 Archived-At: --f403045fb968987ebf05459375b7 Content-Type: text/plain; charset=UTF-8 What I propose is not to alter the current AST JSON document but to add a second JSON document after it containing the filter options, each terminated by its own newline. As for specifying the filter which the option(s) belong to explicitly I think that is pretty much necessary to avoid confusion. Alternatively the `-F` option might be altered to take an optional 'value' which would be the options to the filter specified as 'key': `-F FILTERNAME[=FILTEROPTIONS]`. Another question is whether the filter options should be parsed by pandoc or that should be left to the filter. At least perl and python already have libraries which can parse options from a string. Other filters may wish to receive their options e.g. as a JSON object string, since any filter has to be able to decode JSON. Den 8 jan 2017 10:10 skrev "John MacFarlane" : +++ BP Jonsson [Jan 07 17 23:53 ]: That said if a separate filter option option is implemented it would > probably be wiser to implement it analogously to the -M option, > something like `--filter-option myfilter:option[=value]` and pass those > I like the idea of specifying the filter name explicitly. options to the filter as a second 'line' of JSON, thereby not breaking > backwards compatibility. > Changing the JSON will affect backwards compatibility. Better just to add these as arguments to the filter (after the initial 'format' argument). But I'm still not *entirely* convinced that this is needed. -- 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 email 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/ms gid/pandoc-discuss/20170108090942.GA41105%40Johns-MBP.home. For more options, visit https://groups.google.com/d/optout. -- 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 email 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/CADAJKhBvu9uTL3SgXPdUEeMJDziRi-eWNf6MuZjS6MacRgwA7Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. --f403045fb968987ebf05459375b7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
What I propose is not to alter the current AST JSON docum= ent but to add a second JSON document after it containing the filter option= s, each terminated by its own newline.

As for specifying the filter which the option(s) belong to explic= itly I think that is pretty much necessary to avoid confusion. Alternativel= y the `-F` option might be altered to take an optional 'value' whic= h would be the options to the filter specified as 'key': `-F FILTER= NAME[=3DFILTEROPTIONS]`.
Another question is whether= the filter options should be parsed by pandoc or that should be left to th= e filter. At least perl and python already have libraries which can parse o= ptions from a string. Other filters may wish to receive their options e.g. = as a JSON object string, since any filter has to be able to decode JSON.

Den 8 ja= n 2017 10:10 skrev "John MacFarlane" <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:
+++ BP Jonsson [Jan 07 17 23:53 ]:
=C2=A0 That said if a separate filter option option is implemented it would=
=C2=A0 probably be wiser to implement it analogously to the -M option,
=C2=A0 something like `--filter-option myfilter:option[=3Dvalue]` and pass = those

I like the idea of specifying the filter name explicitly.


=C2=A0 options to the filter as a second 'line' of JSON, thereby no= t breaking
=C2=A0 backwards compatibility.

Changing the JSON will affect backwards compatibility.
Better just to add these as arguments to the filter (after
the initial 'format' argument).

But I'm still not *entirely* convinced that this is needed.


--
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 pandoc-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-= discuss/20170108090942.GA41105%40Johns-MBP.home.

For more options, visit https://groups.google.com/d/optout.

--
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/CADAJKhBvu9uTL3SgXPdUEeMJDziRi-eWNf6MuZjS= 6MacRgwA7Q%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--f403045fb968987ebf05459375b7--