From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30670 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix SOEDJEDE Newsgroups: gmane.text.pandoc Subject: Re: Pandoc 2.18 - Custom writer working example Date: Fri, 3 Jun 2022 00:31:18 -0700 (PDT) Message-ID: <35a61b60-d763-4d60-a545-cd5329f65883n@googlegroups.com> References: <8528d41a-d6dd-4ca7-b38a-13955a9d1eabn@googlegroups.com> <87fskn6345.fsf@zeitkraut.de> <87bkvb5tay.fsf@zeitkraut.de> <56920de7-922c-4491-86ee-c981beb37b78n@googlegroups.com> <87tu933tb0.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1548_41681522.1654241478772" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25515"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBC4JXJU7UYGRBR7R42KAMGQEU4BB5PA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jun 03 09:31:23 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f57.google.com ([209.85.160.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nx1mF-0006VI-B9 for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 03 Jun 2022 09:31:23 +0200 Original-Received: by mail-oa1-f57.google.com with SMTP id 586e51a60fabf-ec4e7a087esf4299373fac.15 for ; Fri, 03 Jun 2022 00:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; 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=lMkMGk1Ef+wRZ4ycUbx694te3yXEdX3Qh7/V+PASWEI=; b=cl6LlNqA/oNCAusrHrN6jFLMc3DtC7yJAEeRMujHaoJvOURC/+ceZgkCsLkTJoLFzl my4JBTODOPG4GkvPOBsDiu41+B1u3NXFgBcPCEPQru2si1eVZ1s8v9SpbHm6r4cwUUW1 Z0wDrcav3+oTDKsuSl6NX5QaslJ43BSPNskjt+aRT4i2mCv4yyNq/tohZya/v8JxtDI5 DMzGXLjGCkXGRR193WyYSEzK4V3UH/pSetHTBb0/cyeBsHhTL/yrzUACQqeqCYi9r5XW kXeGc/ZLptt/rDTv7Ar2pG4tpbdm7nmqe6zAUdnVdkLkpSzuzSKI5kga0laxDGVK0uC2 o1mA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=lMkMGk1Ef+wRZ4ycUbx694te3yXEdX3Qh7/V+PASWEI=; b=Ccdqpknv2E8Shk+UUCRJjC9mxxSi957vR34sqKmozFUQTe44hTGIaRTbSy3lnPlpc3 Wd0i+nQJB86J9LV2K1nE9g3XuHZ2nLHDnGTEnP14fh4sgXoyXEiw9ctilZgJNNgfXzrL kNfZtKoxp6DR9mGvx65BbO8c5oEPNlNpoNVHsqLNZiUJ0ls7QYIjGdQL6go4ZMp7a6GI dNzJLtX6RcSjmy7fEIjNWwUaNfK/mk4TJZIr5KkVTWjZNPp/pFK8V7KblU1CeB1N68yL rTdmgaeqaYyTRaJiXue5UJGXAdyI6cuLAANoEUXcbr8sJvlPP8N2EO5Em3cTmKwy+wfp Nmzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=lMkMGk1Ef+wRZ4ycUbx694te3yXEdX3Qh7/V+PASWEI=; b=CW+rOwUTOEI3hLWN877VMTLTXeEpMvl+eqBcMkKSeqKTE9t2ud8fjEpC/f+gwFglWO noQTwaFzmOLrKqQfCnvWttzwMHd/VreL+4V0lDVa6Jfgu7EhNEIr1SKOxVnPKdAAhtqM htZrMOkmF7cteffNw/vxUWsUSRDPLcbNjaTl5N4XZMIggltCvj9DwDo3KtdeAco8KPjn kbNv0YOLSrPbcxVEmBj9kOQVXB+Gq9CVGvyVzFMzssRsgP3V3V6GWpmTSD1hyFp2TUzE nwPnkWs07YFz0s9UF6p7xFfsPMhXviksbioa/ELq+o3uO0ksWMA9tA5XYw8CJAcnRxVE +Vag== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531kYyItcZI7TicgpwxI/2YhRrHXF5yNyEKOH/CRN5ntkXWlnBea R3rdc7PL0UUXaBC/Ji9L4Hw= X-Google-Smtp-Source: ABdhPJz/6GXXcZb9gU9FKDrWQuFQXZhzme+2S7qLKTFxnyaOzQxdQ1CKxK4K+num73sE3fDPifTxXg== X-Received: by 2002:a05:6830:10c4:b0:60b:1137:df59 with SMTP id z4-20020a05683010c400b0060b1137df59mr3553236oto.172.1654241482216; Fri, 03 Jun 2022 00:31:22 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6830:1299:b0:60a:c4d4:f038 with SMTP id z25-20020a056830129900b0060ac4d4f038ls313688otp.2.gmail; Fri, 03 Jun 2022 00:31:19 -0700 (PDT) X-Received: by 2002:a9d:189:0:b0:60b:d5c8:57ae with SMTP id e9-20020a9d0189000000b0060bd5c857aemr227112ote.175.1654241479461; Fri, 03 Jun 2022 00:31:19 -0700 (PDT) In-Reply-To: <87tu933tb0.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> X-Original-Sender: soefelix-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.io gmane.text.pandoc:30670 Archived-At: ------=_Part_1548_41681522.1654241478772 Content-Type: multipart/alternative; boundary="----=_Part_1549_1735526942.1654241478772" ------=_Part_1549_1735526942.1654241478772 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Well that was easier than I thought. I did not try that. My bad =F0=9F=A4=A6=F0=9F=8F=BD=E2=80=8D=E2=99=82=EF=B8= =8F. It's all good now Have a nice day Le jeudi 2 juin 2022 =C3=A0 18:48:43 UTC+2, Albert Krewinkel a =C3=A9crit : > > Felix SOEDJEDE writes: > > > My real need is that I want to be able to access variables in my lua > > filters. > > In that case there might be a simpler solution: The global > PANDOC_WRITER_OPTIONS became available in pandoc 2.17. With that you can > access variables in writers by indexing > `PANDOC_WRITER_OPTIONS.variables`. > > To give a short example: if you call pandoc with > > pandoc --lua-filter=3Dvar-test.lua --variable foo=3Dhello <<< '' > > where `var-test.lua` contains > > print(PANDOC_WRITER_OPTIONS.variables.foo) > > then you'll get `hello` printed to the terminal. > > HTH, > Albert > > > --=20 > Albert Krewinkel > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > --=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 view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/35a61b60-d763-4d60-a545-cd5329f65883n%40googlegroups.com. ------=_Part_1549_1735526942.1654241478772 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Well that was easier than I thought.

I did no= t try that. My bad =F0=9F=A4=A6=F0=9F=8F=BD=E2=80=8D=E2=99=82=EF=B8=8F.
It's all good now

Have a nice day

Le jeudi 2 juin 2022 =C3=A0 18:48:43 UTC+2, Albert Krewinkel a = =C3=A9crit=C2=A0:

Felix SOEDJEDE <soef...@g= mail.com> writes:

> My real need is that I want to be able to access variables in my l= ua
> filters.

In that case there might be a simpler solution: The global
PANDOC_WRITER_OPTIONS became available in pandoc 2.17. With that you ca= n
access variables in writers by indexing
`PANDOC_WRITER_OPTIONS.variables`.

To give a short example: if you call pandoc with

pandoc --lua-filter=3Dvar-test.lua --variable foo=3Dhello <<&= lt; ''

where `var-test.lua` contains

print(PANDOC_WRITER_OPTIONS.variables.foo)

then you'll get `hello` printed to the terminal.

HTH,
Albert


--=20
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124

--
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/35a61b60-d763-4d60-a545-cd5329f65883n%40googlegroups.= com.
------=_Part_1549_1735526942.1654241478772-- ------=_Part_1548_41681522.1654241478772--