From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32820 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'William Lupton' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Re: Modifying metadata elements with Lua filter Date: Wed, 14 Jun 2023 17:54:47 +0100 Message-ID: References: <19962c60-238b-4ef4-bad6-a8200ca9a3cen@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e3034b05fe19cf5e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34249"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBZHBU6SAMGQERDFS3WQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 14 18:55:05 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f63.google.com ([209.85.128.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1q9Tlw-0008fg-Vp for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 14 Jun 2023 18:55:04 +0200 Original-Received: by mail-wm1-f63.google.com with SMTP id 5b1f17b1804b1-3f8d0308a0csf5566195e9.1 for ; Wed, 14 Jun 2023 09:55:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686761704; cv=pass; d=google.com; s=arc-20160816; b=w3nQ0apShCSB3RyiV3RktI7Ad8XUpAFvHGcq8dHzgK+lxh2AgOulGYrXuk4INKAweB LYeW1ZqqQV+bNf4yhKxcEW2LwxdIyWMCZy3uOAnHTpqQiQqwWhZCBoh0S9x+XY42gKWX 0PxCgAGoWzKska/7hWW/w/sj/Lxwe16bw7El9Pzyg06Uk8vF2ofqbxXXQcsgBT6Dd2K8 TSAAIvVs+z1kMrpjI43G7tOI6hsHvJIwdrcJqlorN0qhPfDG6dURs2M/Lukyu9VAkJXC J9MJ25Si7u4691C0xflXt8hVBMeJY8b+KgS1unpcmmzZ2tN/cUK3+U+9dLxeNMKAAb8A +nHg== 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:in-reply-to:references:mime-version:dkim-signature; bh=e2DBc+3/L9j3XYKwgT9qBa2iJTzKKt4y8sBzKXj8Dsg=; b=J5r3d7RBwOCjaTVq3AvVlLcNfo4Yl8JNUlTVEdb5KSkbbojqLtcxM6lbahvpd/u/o0 Iv7DDQsyrIxidEpm0bId58rdXUC858JndQvNEQK/dismb2Bj/lAwLnXQf59EC/yzEyS2 MRWaeWjE1cuPmIQgntX9D9gAvgmOFQX8j3nRYkxcHpHlv7dKeF5/+hgrw4qCDZv2RzSH 70vwMntiAfSPpdH4XYLCTTHiR7GpNGhsoIZbEpWjuTAhqvcRjO3u35hHMb1IGqYmkqo+ jqCFV7VdAaia0vzliW4k8OEmuHG36OeOY3Ozd7NZ5Ic2QEC0czsN9xc6QRMxH7CnCeS7 PDHA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=WPwxPJMq; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62e as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1686761704; x=1689353704; 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:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=e2DBc+3/L9j3XYKwgT9qBa2iJTzKKt4y8sBzKXj8Dsg=; b=X18HpwF1Y+52ClDmVXdD1z/d3UNNBBHnQBRa4rC+6T3BRX1lx8sb1bGOXderGEvbwB H/e1syhAZQ5GFMWAysp1wtcs2/TnMccdd+uFpthiqTgdXCruVpCfiTMvVeAHSJLYGYrW sQEVYeolNflV6hFEtJ2O5GwSVsjv4UWtFOgzsh3RR7534mt/e/IIui6sk6xnAG80eSOj xRbsHQMfcXJA9FZpjbXibyk3ee5vXO+tG6wpdVJsFDy04wxnfA7iuSaLBg/87T/uvj3p ojRFgqT4+gF+P0DqVMZons1YRuvVCpn2BTu2hEIll2yO0l7AjlNnMM7RpGEiQBaUJhyg U6 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686761704; x=1689353704; 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:in-reply-to:references:mime-version :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e2DBc+3/L9j3XYKwgT9qBa2iJTzKKt4y8sBzKXj8Dsg=; b=Ypm+g4o556A2ko6GPecp+S/l7XTr6NyrclEp2ev9Lvz61+sn58cu+oudbftuQaU+t6 zvVBMLvlR00s4Tf7Dx0GXepas5iegLgl2eRWL/D1So5zrb6XzfPml8W8dMkhEPeqZhx5 sZhYJjU7+qE8X97TtZHY93RN2RzJlfc9Dn64gCiEgoY9pey4dyxqJAwzC5eK24KSQKOG ofDfRGVrksk6LbpCKr2tooH9rdFkOsMokVtTY4S6LL+KsAVItSGbH+tEDZyIQDJP6Brx s4rGMNwWegJW9 X-Gm-Message-State: AC+VfDwnvFoXfNS1mNpHts4oqHnvoJ3P7kBdQtzI9895vnetljBlPlIK t0+EgEd7sHr0oM80Mgv1yi8= X-Google-Smtp-Source: ACHHUZ6+cBC0mE+ndSHWmGc1tDuRQbqArPsv0czhmk+z8arYPvZHUo22bBFcmswWpH0EvwHZaGC+xw== X-Received: by 2002:a05:600c:228d:b0:3f7:8fbf:a21d with SMTP id 13-20020a05600c228d00b003f78fbfa21dmr11365363wmf.32.1686761704324; Wed, 14 Jun 2023 09:55:04 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:600c:5110:b0:3f3:15ce:e16c with SMTP id o16-20020a05600c511000b003f315cee16cls85937wms.0.-pod-prod-01-eu; Wed, 14 Jun 2023 09:54:59 -0700 (PDT) X-Received: by 2002:a05:600c:21d0:b0:3f6:f152:1183 with SMTP id x16-20020a05600c21d000b003f6f1521183mr12005251wmj.37.1686761699780; Wed, 14 Jun 2023 09:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686761699; cv=none; d=google.com; s=arc-20160816; b=0PPPtKV8YV8ZNLeKPDa00q0vQFhOtP1UbIkTi7uG18HdczD3rLvtkJlQyfDzLSnHAI O7b9xtBjHfeGuvzFhAoKrZLsoBH/9z2+T2eDNR8qGiCWyM4NGw/sPl5pqCzv9bs2HOc3 Ye9KOMdlxP/dul+yLf5nREOUWAOVKuxhXWWQuMAB/jNC2iN/fBlymnUjPHw+tdocrN6C eDO1W09Uq7e+lHA1aHvYJL2MQiHZV/kWI8JTnhxncn8eqKvFphe4iABYnw9aXCpUftJK 5IcD3w0WpXkhwvMDZcuaEP9+j9y+Br5VXo6wGN9cqK8an/K6zd8n9ag98fjzjHcr2s3j /ubQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=R4IIdEIqwu/ozCrtFF2/9PRvjP9PUWJuoqBX+1nckt0=; b=mAQZfC7t0mC/i6UInjHjx2v+AaPkqB15dC3p6R3/oG4NB43qeI64tGJGWd8sBW/eRs QEGB5rIMb1lU6/vpBGIoTXqFRY4OAF9N2T2FWNq/S0C3ZzV1JCYAkoCl/PI1I3ctgxcC rVi9Pz36ZYFx4Nh7Yv0+I530l1ARy30rhgc1c5Y49yaLfj/6BfzADPS8Jpzxlx1zcI1H fJD4rRKQh9MRKQtcJ1S/KyN4wqp/7+yZvrDuyq3IBoKSsWA3UJXY9PZg/jaGroYzm8CI Rpdte2015LpTO/nqnp1nxALfvTUkpJJ8G9IUa6AQ1G2PJONmC1/QJO8YVlykRpYiETJk B4eg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=WPwxPJMq; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62e as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org Original-Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com. [2a00:1450:4864:20::62e]) by gmr-mx.google.com with ESMTPS id az19-20020a05600c601300b003f733c1f39esi1134532wmb.0.2023.06.14.09.54.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jun 2023 09:54:59 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62e as permitted sender) client-ip=2a00:1450:4864:20::62e; Original-Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9823de726c3so151708966b.0 for ; Wed, 14 Jun 2023 09:54:59 -0700 (PDT) X-Received: by 2002:a17:906:fe0a:b0:94f:29f0:edc0 with SMTP id wy10-20020a170906fe0a00b0094f29f0edc0mr17142905ejb.44.1686761698945; Wed, 14 Jun 2023 09:54:58 -0700 (PDT) In-Reply-To: <19962c60-238b-4ef4-bad6-a8200ca9a3cen-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=WPwxPJMq; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62e as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org X-Original-From: William Lupton 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:32820 Archived-At: --000000000000e3034b05fe19cf5e Content-Type: text/plain; charset="UTF-8" Your metadata has this structure (hmm... perhaps some of the Inlines are really MetaInlines, in which case that's a problem with my logging module): (#) meta Meta { author: List[2] { [1] Inlines[3] { [1] Str "Author" [2] Space [3] Str "A" } [2] Inlines[3] { [1] Str "Author" [2] Space [3] Str "B" } } title: Inlines[1] { [1] Str "Test" } } ... so I think you want this filter (MetaInlines isn't an attribute name, and you have to count the space): function Meta (m) print(pandoc.utils.stringify(m.author[1][3])) end On Wed, 14 Jun 2023 at 17:47, Stephan Boltzmann wrote: > Hello everybody out there using Pandoc, > > For the following short document, > --- > title: Test > author: > - Author A > - Author B > --- > # Introduction > > I would expect the Lua filter > > function Meta (m) > print(pandoc.utils.stringify(m.author[1].MetaInlines[2])) > end > > to print out "A", but it prints nothing at all. > > What is the conceptual misunderstanding I have here? > > -- > 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/19962c60-238b-4ef4-bad6-a8200ca9a3cen%40googlegroups.com > > . > -- 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/CAEe_xxgBZqBv5xT85kirY0WoBS3VJZy8R36f7hQxp5sZo38nSA%40mail.gmail.com. --000000000000e3034b05fe19cf5e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Your metadata has this structure (hmm... perhaps some of t= he Inlines are really MetaInlines, in which case that's a problem with = my logging module):

(#) meta Me= ta {
=C2=A0 author: List[2] {
=C2=A0 =C2=A0 [1] Inlines[3] {
=C2= =A0 =C2=A0 =C2=A0 [1] Str "Author"
=C2=A0 =C2=A0 =C2=A0 [2] Sp= ace
=C2=A0 =C2=A0 =C2=A0 [3] Str "A"
=C2=A0 =C2=A0 }
=C2= =A0 =C2=A0 [2] Inlines[3] {
=C2=A0 =C2=A0 =C2=A0 [1] Str "Author&qu= ot;
=C2=A0 =C2=A0 =C2=A0 [2] Space
=C2=A0 =C2=A0 =C2=A0 [3] Str "= ;B"
=C2=A0 =C2=A0 }
=C2=A0 }
=C2=A0 title: Inlines[1] {
= =C2=A0 =C2=A0 [1] Str "Test"
=C2=A0 }
}

... so I think you want this filter (MetaInlines isn't= an attribute name, and you have to count the space):

<= div>function Meta (m)
=C2=A0 =C2=A0 print(pando= c.utils.stringify(m.author[1][3]))
end

On Wed, 14 Jun 2023 = at 17:47, Stephan Boltzmann <stephan2boltzmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hello everybody out there using Pando= c,

For the following short document,
---
title: Test
author:
=C2=A0 - Author A
=C2=A0 -= Author B
---
<= br>
fu= nction Meta (m)
=C2=A0=C2=A0=C2=A0 print(pandoc.utils.stringify(m.author= [1].MetaInlines[2]))
end

to print out &q= uot;A", but it prints nothing at all.

What is= the conceptual misunderstanding I have here?

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https= ://groups.google.com/d/msgid/pandoc-discuss/19962c60-238b-4ef4-bad6-a8200ca= 9a3cen%40googlegroups.com.

--
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/CAEe_xxgBZqBv5xT85kirY0WoBS3VJZy8R36f7hQx= p5sZo38nSA%40mail.gmail.com.
--000000000000e3034b05fe19cf5e--