From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16615 Path: news.gmane.org!.POSTED!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Filter with arguments Date: Fri, 6 Jan 2017 13:58:52 +0100 Message-ID: <20170106125852.GA1662@Administrateurs-iMac-3.local> References: <20170106114647.GG791@Administrateurs-iMac-3.local> <8760ls8jby.fsf@fastmail.fm> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed X-Trace: blaine.gmane.org 1483707583 13030 195.159.176.226 (6 Jan 2017 12:59:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Jan 2017 12:59:43 +0000 (UTC) User-Agent: Mutt/1.7.0 (2016-08-17) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBO5JX3BQKGQEHLZOZDA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 06 13:59:39 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pg0-f63.google.com ([74.125.83.63]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPU7N-0002lP-Gq for gtp-pandoc-discuss@m.gmane.org; Fri, 06 Jan 2017 13:59:37 +0100 Original-Received: by mail-pg0-f63.google.com with SMTP id g1sf154645426pgn.0 for ; Fri, 06 Jan 2017 04:59:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:date:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent: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=q2ZGnspslN166m0GbEEgp/I4ag0zG/FCBN7JU/d2EzA=; b=L6xtDvd5B9n77/1YR7qyVGWU9ak9Tx3eSguV6AQ6KpwPpIpEEnt8Igu7ax1wzWpA9H mOBlwzM8uxWPnGrEw36Tc6PMtheY2W/I1VlbVxdoR34JHHo7/eviOqpuWUlJtBkMmzpB 1RyZJ2smVcodVO9/4W6Hm37NyAsyooBz9TmXrSViPX2tjU4/JLm9AtVQ8JI/UH1LaWGN pKSxSYehhgCQOTWFl7jv76GwGYe1YZezivDSaaURuKUMql28j5CsJJMryBQ6naIvCFia QheUY4UKRdxjzf1jI/Vm5zJeuxY0Hv0ffYkFKLYak1e9zcFNKaXv0TuCbIp8Uo7a0ZLN scvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:date:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent :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=q2ZGnspslN166m0GbEEgp/I4ag0zG/FCBN7JU/d2EzA=; b=Zs5r5A+M+mDTQVEkn3hYERaKx/yeey6RY947AIgOpf1ZD5EkKHaMtRpPoT/khgJNlZ dy7Cm+1AW0C7U8A/S5tQXj/shFpgSV3P2yf+yZCjG8niteyPLWXAGdUTUZBA8KYXnTbD QbdbogXU4ADmrNjMKFzkRIJqqWPT1blR2zyOVYrW2vaS6AnQMIs5nfAPdMDzQXHO2feO lagPYoHfFckTBWRYbi1mAVNGvxA6bjmA1T9EsaRjA7aQBVpBJsNfe/B2ndtLyUnSVwko 6TnvviHIdEKy1ht8fVl1m4lXtZANOKhE0QSdvMXyoxYljm06JFn3KwBnmcWRYmiaodMs Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AIkVDXL169lMBDPHNBT3uY3MCjkMLts2lu2Dvghw7i4jqsB27m9rgiBEc8qZKkSNh2WUwg== X-Received: by 10.36.26.83 with SMTP id 80mr110584iti.0.1483707581611; Fri, 06 Jan 2017 04:59:41 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.36.79.145 with SMTP id c139ls624397itb.8.gmail; Fri, 06 Jan 2017 04:59:39 -0800 (PST) X-Received: by 10.99.108.71 with SMTP id h68mr47456113pgc.23.1483707578965; Fri, 06 Jan 2017 04:59:38 -0800 (PST) Original-Received: from mail-pg0-x231.google.com (mail-pg0-x231.google.com. [2607:f8b0:400e:c05::231]) by gmr-mx.google.com with ESMTPS id z62si19364197pfz.1.2017.01.06.04.59.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2017 04:59:38 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c05::231 as permitted sender) client-ip=2607:f8b0:400e:c05::231; Original-Received: by mail-pg0-x231.google.com with SMTP id 14so7237364pgg.1 for ; Fri, 06 Jan 2017 04:59:38 -0800 (PST) X-Received: by 10.84.217.199 with SMTP id d7mr167478985plj.165.1483707578522; Fri, 06 Jan 2017 04:59:38 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id b66sm1053367pfd.48.2017.01.06.04.59.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2017 04:59:37 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 886E6A0C5; Fri, 6 Jan 2017 07:59:26 -0500 (EST) Content-Disposition: inline In-Reply-To: <8760ls8jby.fsf-97jfqw80gc6171pxa8y+qA@public.gmane.org> X-PGP-Key: http://johnmacfarlane.net/jgm.asc X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c05::231 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:16615 Archived-At: +++ Joost Kremers [Jan 06 17 13:27 ]: > >On Fri, Jan 06 2017, John MacFarlane wrote: >>This is a pretty common request. A couple of complications: >> >>1. Pandoc calls each filter with one argument, the name of >>the output format. (Filters thus have access to this.) >>If we allowed `-F "pantable -t csv"`, how would this work? >>Would pandoc call `pantable latex -t csv`? Would the filter >>be expecting this? > >For a properly written filter that shouldn't be a problem, should it? >You just need to decide on one way of doing it and stick to it. >Filters then need to be updated accordingly. Or are you worried about >backward compatibility? Well, I'm anticipating people getting confused. "I said to run --filter 'myfilter myarg', and for some reason 'myarg' isn't the first argument!" What's wrong with communicating options to filters through environment variables, which you can already do? PANTABLE_OUTPUT="csv" pandoc --filter pantable >pandoc --filter "My Cool Filter.py" --filter-args "-t csv" > >with each --filter-args referring to the immediately preceding >--filters option. Depending on how Pandoc calls filters, it may even >be possible to just pass it the literal string argument of >--filter-args without having to parse it into different options. I think this is too complex, with --filter-args affecting the immediately preceding --filter option. Again, I'd have to be convinced that environment variables don't already provide a perfectly adequate way to do this.