From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31825 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Claudio Di Vita Newsgroups: gmane.text.pandoc Subject: curly-switch: a filter for variable substitution Date: Thu, 1 Dec 2022 09:02:33 +0100 Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006ad2a305eebfa52f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27395"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDOYFIOXRYHRBJN7UGOAMGQEABU2I4I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Dec 01 09:02:50 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oi1-f187.google.com ([209.85.167.187]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p0eWv-0006vy-GU for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 01 Dec 2022 09:02:49 +0100 Original-Received: by mail-oi1-f187.google.com with SMTP id s18-20020a056808209200b0035be56b3f8dsf274690oiw.21 for ; Thu, 01 Dec 2022 00:02:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669881768; cv=pass; d=google.com; s=arc-20160816; b=x2loWIcbSDTFQBQJxTXMQyLY6DzM6zok9nK03puWIT13iP8GJDg37zx1eKvUrZpKEX d9K+AdfMseQcmw4l8tYmKsTsTh9Vl7f8fuVygEpejuJygwUyaFbs2A+NXjeGzlD1489K WJpKcYLrLY8/XPcdumx0Tr091SHTFFhaIDz3Gd4HncyHqNe8PwTFoSL91qsG7S9cGWX2 1wayQQDhHCuK62ZqZwZhOSngTl7Hw1qWS12IcKUrlPr6F1QQzNz1fCCS5C3mllyqE4gv tHrHAw49xd0MmFN4oGOmqWlg0idbNA5cCkaJVRyJ2U4TG40CeGdN5vY+GStNu0BCfN5P UgAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:mime-version:sender:dkim-signature:dkim-signature; bh=wByP6CSDsffap2gL/HpgHI/H68qJ2KIl/br9fL1zb1Q=; b=LE/UwvRKQQsQJwsdkT6D9uZ9vEKVdb+LY+CGq+V3piyxfraS8Xmx3iNaUkPq+lxHZi 2MOlvYgbDJPtHYS/cTuntvuQrOL42P3Oc1Fu3yf6v5SJNzjGkuTcrh/5HRk/XyzPZjnx HmzmSbmZFxKCHW1YgztqXhm/k68wtizcM6JvmInUKxTdJ3Cxsug6kSa3IZj6kJ3AkJBz KV6s0k1c/Pxsu2td+4OErzEiaJYpXL/dy8ZQCYtVK1Hj+6HVYIxAV1/B9wx2zvUNYaG8 k4LXxpeoHO2xpTmelabCTjgaUYpbVJO6Y60lk/q7/0OgGs/YmttlNHYr9sHmb0mx55Gv /NMA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NtuHfTUo; spf=pass (google.com: domain of claudio.divita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::32d as permitted sender) smtp.mailfrom=claudio.divita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:mime-version:sender:from:to:cc:subject:date :message-id:reply-to; bh=wByP6CSDsffap2gL/HpgHI/H68qJ2KIl/br9fL1zb1Q=; b=HQjqWN+EH221b6g9FIFNrb74T7TTLGlB47bTUEW9C9TfjUfgtFuJGQLKadwcw5BLT6 3FWa9bB0ASC8zAOQkz4H4Ltg4FQeBqBjMwfEvThBOcpz3o+lUFKLZ8bB0ndlVnR/WWRI W9Gh4gtanjcYVUP67PoN15Ff3QzEUm5e2d5/HZAnOZPZQMfPNu6OUjlBxjCBoqfV0HDM RdDX7IuQRtLr3Kwvv3WYrQJi2MlOHbHhbdOiWnbD1pvladMyc+Ab6lM1UxpkSw1G9TtZ XKBWbcmVT9jodJjm1HpnFUOz8lDBnqrFRSzUsiyzpx5nNIOG0ofnJHXNk/PWUog4SLO8 2Ieg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wByP6CSDsffap2gL/HpgHI/H68qJ2KIl/br9fL1zb1Q=; b=LRV9eCRG6v/K1vli8pVOrAi5PcEwta1Qz7aNbu70TQp8n6RbiV+GNpYwwpF9bkVPze kj0C9x7StuQbg2W9HYb4POQm8p4zW/kBgZbO6RjVzD68v27kQJ/XMCgGfyg3AYLJdHb1 ujvRSxjS4Pe25Y1wf4hG0TlC+co3XDNB8C0D+urIVf9Ko2jgmZAKVmJpYV/MaIxhgKB7 8H2WckQWiMb64NE0/SR1rG2hzSrH+Qw3D4mEFUjq1b1pTJPvHNsIaZfFv5t5R2mWowAf 6jK0Uh/kyYE9JZTCr4M+RkVbWOMAOnMtBrJR6z6jMz/FNVXehhJpPgDjNvHVwlgMlN3y f++A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:mime-version:x-gm-message-state:sender:from:to :cc:subject:date:message-id:reply-to; bh=wByP6CSDsffap2gL/HpgHI/H68qJ2KIl/br9fL1zb1Q=; b=1n8oAhqVFc8CAzFo9YPXEqGNjBfRvuX2F/0dr+OwvfkAX6FSdrP+9SaqJL1Ta2+c64 q7LLXWebi02hCPibFw8xxJvNVn3F9dRF66e1gLYXPpy1Nb5VaNigdV/sN98oGH7ZBic7 oxGNoSd3rMkf01UtKNcndt2S+J8JWF5K7itgl76UjSDwciqXO2RaYxa0Zj3KExInKxQ5 700RWMWhYifhKvZH7KNKvdvpBB0aX6az7/O3sCe11juKNQSw6fn9IyC2l4jJEJHdYm+D zPQlOE+oy3EnvnhVZeCNm5z3UD+9qRWBL7VH8M4PK4TchyZ81OmRZwYsOsnLhunfsrKY P Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pmchOIv+LDdxGR6IyvOTv307Ymn0XqZWOnIziw3lwjyo32wSPnZ X4UlR5QJm9w6CEVk5uFX2Eo= X-Google-Smtp-Source: AA0mqf6xrK0Tt5MWrv0+P6QrTCW9/MAc6Y/vLyR5YNQPIDupvqKSB2gLpJrMVYZWFlIaeijzZBvWTw== X-Received: by 2002:a05:6808:309f:b0:359:adcf:b941 with SMTP id bl31-20020a056808309f00b00359adcfb941mr34240205oib.83.1669881768231; Thu, 01 Dec 2022 00:02:48 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:605:0:b0:35a:8a2b:e9f1 with SMTP id 5-20020aca0605000000b0035a8a2be9f1ls364526oig.8.-pod-prod-gmail; Thu, 01 Dec 2022 00:02:45 -0800 (PST) X-Received: by 2002:a05:6808:2087:b0:35b:88d0:67c7 with SMTP id s7-20020a056808208700b0035b88d067c7mr15861222oiw.29.1669881765506; Thu, 01 Dec 2022 00:02:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669881765; cv=none; d=google.com; s=arc-20160816; b=wc6xGqMX71c3EBsZ6ZbAnAzQmI7s7jcKaQ43dx+zkok69aPY+yRX19rJu6oQypAS9Z ujHc672m2fVOB04G5XmnXBc8UzLvJA1CZbKw+J/GMvlGnrZ00ukpQkxVNWakiz033U7j OdUa12YMAdvgXg5vOOnQ4uEe1qultdVPWYoAKwJb8VePzGGdan3wrk2w13jlqcRA9cY9 08ucQmfT1vFgMV6TFyYUGBvYpYi3zOzGSNpi9hlRegNNTV8UWwRHFEHz+D/js3la6WVH ZTfqoHGGjNZ2UU32c/be2oCbPHcR9hvUNGsmGjL7nrIOty+jOe8EzNYX6EdJ0a0sunNS qFpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=mWFTcDNX7LemgLOh2Ss4neOn3Qu4K7Y+P7OaU4PcFyA=; b=FDBdMmVQvaw1v22nQnA8KsbkcCLGWhUQDneN4qR1EC9O9GpzySk8VH+iaohNECyP3+ gtMgdbANtx9l4m89PVIcR67uNJWXUPxm6QoUENrvoAi4mkAD4sV+dLJTYudFKp/XNzpi 1lsrb7A/+VC9MNb+gGoAJJ5QwfGaoQc7J8lXzN8kNtdmUf3PPHR83p7EZDIxMohnuzL3 bAmY4Pv3R34TShN4agoeF1eQEyDzt2Nq+O8rBl0VDM3BXTfHFrAPjH4TozODp1kItxvX tsMZkYFEKFi45Wa4IYJJ1420MdS3cwrQ+QuNDgl1fQzmOMdMDksEfwtLZ899bfEsBjoJ 8DNg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NtuHfTUo; spf=pass (google.com: domain of claudio.divita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::32d as permitted sender) smtp.mailfrom=claudio.divita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com. [2607:f8b0:4864:20::32d]) by gmr-mx.google.com with ESMTPS id j62-20020aca3c41000000b00359c478fb51si182748oia.0.2022.12.01.00.02.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Dec 2022 00:02:45 -0800 (PST) Received-SPF: pass (google.com: domain of claudio.divita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::32d as permitted sender) client-ip=2607:f8b0:4864:20::32d; Original-Received: by mail-ot1-x32d.google.com with SMTP id r9-20020a05683001c900b0066e6e7a751eso495390ota.0 for ; Thu, 01 Dec 2022 00:02:45 -0800 (PST) X-Received: by 2002:a9d:5887:0:b0:66c:68e5:84c5 with SMTP id x7-20020a9d5887000000b0066c68e584c5mr22513312otg.321.1669881764957; Thu, 01 Dec 2022 00:02:44 -0800 (PST) X-Original-Sender: claudio.divita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NtuHfTUo; spf=pass (google.com: domain of claudio.divita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::32d as permitted sender) smtp.mailfrom=claudio.divita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE 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.io gmane.text.pandoc:31825 Archived-At: --0000000000006ad2a305eebfa52f Content-Type: text/plain; charset="UTF-8" Hi folks, I just released a Lua filter for referencing metadata values within a document, thus applying variable substitution. The code is available on GitHub: https://github.com/cdivita/pandoc-curly-switch. Using this filter any document metadata can be referenced as variable within the document itself. During the conversion, the variable placeholders are replaced with their effective values. The following syntax is supported for defining variable placeholders: - ${...}, the curly brackets syntax - !...!, the exclamation marks syntax Variables can be referenced using an object-like notation, using any of the supported syntax. Any feedback would be appreciated, I hope that pandoc users will find it useful....maybe it could be mentioned among Lua filters examples in the future :D Cheers, Claudio -- 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/CAMBF16s6tUypzdBZrBT2-7OfQS95bWCpaM1j3Ag5Z7fPxiocPg%40mail.gmail.com. --0000000000006ad2a305eebfa52f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi folks,

I just rele= ased a Lua filter for referencing metadata values within a document, thus a= pplying variable substitution.

The code is availab= le on GitHub: https://github.com/cdivita/pandoc-curly-= switch.

Using this filter any document me= tadata can be referenced as variable within the document itself. During the= conversion, the variable=C2=A0placeholders are replaced with their effecti= ve values.

The following syntax is supported for defining variable= =C2=A0placeholders:
- ${...}, the curly brackets syntax
- !...!, the = exclamation marks syntax

Variables can be referenced using an object= -like notation, using any of the supported syntax.

Any feedback would be appreciated, I hope that pandoc users will find it u= seful....maybe it could be mentioned among Lua filters examples in the futu= re :D

Cheers,

Claudio

--
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/CAMBF16s6tUypzdBZrBT2-7OfQS95bWCpaM1j3Ag5= Z7fPxiocPg%40mail.gmail.com.
--0000000000006ad2a305eebfa52f--