From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23428 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: EBkysko Newsgroups: gmane.text.pandoc Subject: Re: Thoughts trying to write a Lua filter Date: Tue, 17 Sep 2019 09:08:44 -0700 (PDT) Message-ID: <222ed82f-906e-441c-942c-7fa4a39be736@googlegroups.com> References: <6e09bd71-ee77-4de7-a002-953a62325234@googlegroups.com> <9da35dc5-3eec-446b-8464-889ec1eb26f4@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2119_1968503898.1568736524374" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="7880"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDW4B3GJ2UFBBDMKQTWAKGQES775MNY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Sep 17 18:08:47 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-oi1-f184.google.com ([209.85.167.184]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1iAG23-0001ww-Da for gtp-pandoc-discuss@m.gmane.org; Tue, 17 Sep 2019 18:08:47 +0200 Original-Received: by mail-oi1-f184.google.com with SMTP id u69sf1974580oia.13 for ; Tue, 17 Sep 2019 09:08:47 -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=G9MUnt5ekA0GqziozJDrmQi76JL4VHR3cgRzL2hJZhM=; b=F6RDaGAqFINvTYX6vjsMLdPvq4iYI7ocMPj5gT7TgdD1MDRgzxzVwi9pUvAMn7aT1C 0aQ0zChrUsDtgUDfx+1hwX+zY+RRC8xTOtcqP0iFsqen9NLuxhzkRklu4OU6/Lzzggam Z/MbaEsuQOA5qc8Klm0VKIRSzLsZrZeFrUs7mMGQ+fL23C1VUb2drGBSAE2Q9qecow4i uMxdcYTnq3ldOFoegFXF+gn2UaU0qQ9aKd3oMAw3zTTRQ9pH4Es4WfbG38FsuPCVeugM QBvIi0I6B0kHG9LZkNu6SOQOlhc7yRMy5MQ8VmhYreF1sMtOdxJs3PFWriB7HK5N7wOO JcoQ== 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=G9MUnt5ekA0GqziozJDrmQi76JL4VHR3cgRzL2hJZhM=; b=ip+xFFSjMd53ep1aoH9nFiVUJEksCRf9aHitIMVg6gg7d9xyPxXtwgeYbBci5lOXHt cWjvCtd7JWQioriCDddyL48wIw1ogJJZJ9qd2NSGFqdhsrW+Hmyfdw+GHX5wYy/aWAMd RW29ngkdOSWfhYRtlFGwTn5gYRxQ8Vdab0tMiY8HfhQBjOBocPhej8LywLg74Ile7pCX nMdUhqtE6ZFVJZcxQum7f3KaMpwa3uBLZ8NGhVxcIVuCZ6BlEhd3PMjnIjhz6alUhxsO 0KTzM0RsGzaUnGmDO+0AwkAi9da+6xfhDMoTTxrsrOolj+HY0L29oryD1i6W4BqgGG8+ Zd5A== 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=G9MUnt5ekA0GqziozJDrmQi76JL4VHR3cgRzL2hJZhM=; b=GVCzNRQSEcG9Vs7ZBrXRarydWK1XDuVOjw8O0E7lOeykv7T5lTATN5U9u1ou2Db+0d 8eEkLXz6yRnwoR57rTqTdPDKcD8OTnCcWNDf4T1FYQWN7pEkihzRxm9UMik8NXPDtJOG veFK/J2WuXSrKOi9BWVHXyp7BH7j36oqTj7LvjS6gWX/CZg2kZbg+cOb8NB09hLfEAKo 5hNFkY2A3SP9+JKFjN4cB3LC510dj4uABkxeKDhUFSo0clh3OnfjMreT8JSMqlFRZZfU 9vY+pPNivl2a8DbqCiEtvmLTRG7se3gGBBTyqMMuVWeKbOh+M223ZL6DmB5wRWV6fSRZ doSw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAWn++K2+z/EyKunW6Z1lJZybetP6/kTBmVjs6t6ABYHcUxGi73/ WBNL+hVl6HvS3qQI5S3uNbk= X-Google-Smtp-Source: APXvYqwu3y0piuIwvYFIjOKGePM1ChNCsj1BMDFC7J7s7UU+GqaKVP0HuBzlntD9yGP/8zbmrL1JzQ== X-Received: by 2002:aca:5510:: with SMTP id j16mr4457037oib.121.1568736525949; Tue, 17 Sep 2019 09:08:45 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:6c86:: with SMTP id c6ls823737otr.15.gmail; Tue, 17 Sep 2019 09:08:45 -0700 (PDT) X-Received: by 2002:a9d:470a:: with SMTP id a10mr3500664otf.166.1568736525135; Tue, 17 Sep 2019 09:08:45 -0700 (PDT) In-Reply-To: <9da35dc5-3eec-446b-8464-889ec1eb26f4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: ebkysko-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:23428 Archived-At: ------=_Part_2119_1968503898.1568736524374 Content-Type: multipart/alternative; boundary="----=_Part_2120_33412358.1568736524374" ------=_Part_2120_33412358.1568736524374 Content-Type: text/plain; charset="UTF-8" I know this is borderline necroposting, but I was just faced with this problem, dpi doesn't seem accessible in lua filters (not in `PANDOC_READER_OPTIONS` anyway, which are reader options). So in case anyone wants a hint, here goes... Since I usually invoke pandoc from a script (a windows batch in my case), I just create (set) the dpi to a variable (say 'dpi'), and then pass it to both `--dpi` and `-M` on the pandoc command line. So in a win batch that would be, for example: ``` ... set dpi=300 ... pandoc %1 %otheroptions% -M dpi=%dpi% --dpi=%dpi% -o %output% ``` Then in the lua file, the first filter in the return list would be a `Meta(meta)` filter that would retrieve the dpi through meta["dpi"] and put in a lua variable to be used. Yes, it's redundant, but I don't see how else (apart from setting an environment variable, but it's the same principle). -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/222ed82f-906e-441c-942c-7fa4a39be736%40googlegroups.com. ------=_Part_2120_33412358.1568736524374 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I know this is borderline necroposting= , but I was just faced with this problem, dpi doesn't seem accessible i= n lua filters (not in `PANDOC_READER_OPTIONS` anyway, which are reader opti= ons). So in case anyone wants a hint, here goes...

Since I usually invoke pandoc from a script (a windows batch in my case), = I just create (set) the dpi to a variable (say 'dpi'), and then pas= s it to both `--dpi` and `-M` on the pandoc command line.

So in a win batch that would be, for example:

<= div>```
...
set dpi=3D300
...
p= andoc %1 %otheroptions% -M dpi=3D%dpi% --dpi=3D%dpi% -o %output%
= ```

Then in the lua file, the first filter in the = return list would be a `Meta(meta)` filter that would retrieve the dpi thro= ugh meta["dpi"] and put in a lua variable to be used.
<= br>
Yes, it's redundant, but I don't see how else (apart = from setting an environment variable, but it's the same principle).

--
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 view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/222ed82f-906e-441c-942c-7fa4a39be736%40googlegroups.co= m.
------=_Part_2120_33412358.1568736524374-- ------=_Part_2119_1968503898.1568736524374--