From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/24469 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Lua list traversal (was: ANN: pandoc 2.9.2) Date: Mon, 17 Feb 2020 13:31:18 +0100 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000053a7a059ec4bc96" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="20732"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBI4PVLZAKGQE6Y3KCZA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Feb 17 13:31:36 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-yb1-f189.google.com ([209.85.219.189]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j3fYm-0005DL-67 for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 17 Feb 2020 13:31:36 +0100 Original-Received: by mail-yb1-f189.google.com with SMTP id g11sf14402625ybc.10 for ; Mon, 17 Feb 2020 04:31:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1581942695; cv=pass; d=google.com; s=arc-20160816; b=ECk/kn7bPJo38mt88wdUyQEiWHFWIQgjO8/tKxm9+hbYcc70cBPmeMsehqqTIgLJ7/ k1zwtOZPh+2OJH+6wSmFNY36J3Ad7pPnc+nMS57q/50JZj1Btix8Zfe0145lV9jKmjf/ WwCMlzBL7TvH+yoIaJqJgPHJ9RovXY61u16452RJ9BCAErMLPEaJnSRWjAMssqKzt8qn yM4AZDM7U5awSHGi5hizMvjx5wxfF4PAz85osItijYXUO73b1WPfmZup9ne/KUjFpZ7g yPNphclNi9Lyny+frKmk8106BPVOftSYn8UQk+2mjDiMfZ1/BHUpfSOwmP0eN5bMHQ+y JsGg== 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:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:sender:dkim-signature; bh=qgrS+Movv0eRy8sYlZnW6TG2aoSeIXFrlchaFwnZSi8=; b=hPeQskqwIebw76/Wd0VWol5jaz9hZZ4gFnbYxDf49t4lzLQVXFMCDOTxO2lXH6fb54 13b0gYJOINUAaNo1A3QMhNdrlYDdytlxUZvM3DuzQ1IVj0PysPhePQsEW9bXjTlPmDbe nWs/YE5C6442nDejBQdZ6Zd533WV7j3nAdRbECDH3EUppRlws3N3a6rTnC+00Gxht9w6 PJZPYSFMJpSAjbKd204fCIXi5Xs7ImpdT6ex7OjnQkAZychlTXJZVMBNYxk/3TTQP3jQ 4fnifbIMxPK5+GCdLtiHKTg7hUheRG95ELAQWFWRnsktizUJ6FMB3qPmMi2tUvteLwCL SW9g== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.210.49 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:reply-to:from:date :message-id:subject:to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=qgrS+Movv0eRy8sYlZnW6TG2aoSeIXFrlchaFwnZSi8=; b=tbFfC1roaj2SppXium5d+YJuZzeFJntW1Pa6v/VpLI2cJbvYtK52qhd8/oCtllYIvI WXenAVNIupDFpu3Rws84cPcA440cDrMrONiNwDnXgAd0QLj8DsgzjeNWVIRFKY42greh DWET5QGAxZkQMvdLUxfyWWUgSxiMBGWf411c97FCwk7mqvdXZIkiP/yQBVgLXuM6V60E bylx2oP1xALRfPbYBPIi37n8xlDU+f0wp1K8sIHts8lIHjx5QpPmbB633HlhoUUxYNBM dqgcRLtL3euAffdsNlDZ/fRAgX/d80UFzm+8n4jblHmjt/1cU/eW6WNewrOJF/qdnsAf RqDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to :reply-to:from:date:message-id:subject:to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=qgrS+Movv0eRy8sYlZnW6TG2aoSeIXFrlchaFwnZSi8=; b=WsvIs9XMHnp227/Sn5uQP76usVXa/bchpJJKLpPawCiQjwnL0dNiwwTKzj3ldte4F3 okAnQczlf9NRxxp8vMYi3I8DPOc+dze7QB9j6A97IUcirfw9ZrqZGMkTLUfpi7Qpu32k Fc11OO1RWVMMq9UWTjbatNsqPmNQjGVsbEAD70zSXYV3jV2JdBL+ne3zp9Y1xu4rs6+O V5wLiSndLRu4ED1okS6NHbU2+/cH0sz73TBrnVDx8dq8YxUcAjHv5d9wBRtu1TArFgpG JEYH0QLaSEmdYKjem4TJ2x6mLYzKz4lGa1GFaWSBlaYVLp1unPN9dh6HflBG8A5p9dok V8OA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAXiYKliW7Rnqt67riAV+qiLbFIgRnRU8Szg5JGrOrzWlMgf+Z8W vrS3Tssf5g2lEVDXPW/1CyU= X-Google-Smtp-Source: APXvYqyP1ivy35YMBiFDntrWDqdf49Wl6mcEvSTIMp0UJFE+GjrIf2KLujGiZQUP+gTWaoQThZg5jg== X-Received: by 2002:a25:d912:: with SMTP id q18mr14619173ybg.370.1581942693778; Mon, 17 Feb 2020 04:31:33 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a25:2e43:: with SMTP id b3ls2173962ybn.5.gmail; Mon, 17 Feb 2020 04:31:29 -0800 (PST) X-Received: by 2002:a25:2fd3:: with SMTP id v202mr14718273ybv.251.1581942689456; Mon, 17 Feb 2020 04:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581942689; cv=none; d=google.com; s=arc-20160816; b=cXR0k0csj4zMD0CLfvUp+IvCKDjGoP6lKucsfo+67nyI92L9xTCxWMsZwas1Vah2Qj 2PcH+Q6AWZ3W+REEZozGDiUw8tIWzdP5FLSEfOA0pEYLz+fkZRkS3IfKfMx7oXdprfYG euuUs24UillGgt1NGg/+HOB89CfSNp/kU+GHaq53QC+aIvVdsbvJ/9y2PZKydL3C/T9M mMWOTTRt+Onah1VnmA4V0R6LjoJoGQui6svh7p2XhnO6pk9ngft3Ipw+Kt6aX/hlAC+V UsadinnRyYsNgrS22rCaehmBTj+XPr+HSIFlO0P+qKiDAbiWHd9Ym79JObRwnhewiFJ/ jhog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version; bh=LHLhVC0+qMebmIap/Z60UAlYg3XuM61UHz4sapTVcrs=; b=pc7xlAzno6oR8EyUAXQrE/Ds7VNEb7jLreFeUFmtKRLTzR/tp+m9ZVmf/VzqnLcoR3 RlfzcThQnVMruKxv8GAtSj642bfCOD2tFsFTvxQSb3ZpXFry4zpEnBKpm5Banngl0P/o ZCCvLnfUtno+MuoApTaTHc6KxiPGnFXX52QHo2vMqgE9lR5jkmuGJdxNCtZlemc1+2Qd 4Wn3ZgojtdKJ5p3rDmIsqb3uq/GMeVB4F227u9U8NpHlgCAFrpL+TzZCcklOR8aNMwhW sA1CdXJB4PqBIbn4DnEyBMiutzL9JQ+v2oIPgcrIxeLmnuOcDprk3KmB6/gGmxGMn1PU RoNw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.210.49 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Original-Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com. [209.85.210.49]) by gmr-mx.google.com with ESMTPS id i200si22265ywa.3.2020.02.17.04.31.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Feb 2020 04:31:29 -0800 (PST) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.210.49 as permitted sender) client-ip=209.85.210.49; Original-Received: by mail-ot1-f49.google.com with SMTP id w6so6707189otk.0 for ; Mon, 17 Feb 2020 04:31:29 -0800 (PST) X-Received: by 2002:a9d:5784:: with SMTP id q4mr12346755oth.278.1581942688790; Mon, 17 Feb 2020 04:31:28 -0800 (PST) In-Reply-To: X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.210.49 as permitted sender) smtp.mailfrom=melroch-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:24469 Archived-At: --000000000000053a7a059ec4bc96 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The Lua list traversing feature is very convenient, but it would be even more convenient if filter functions were passed the parent and closest siblings of the current element as extra arguments: ``````lua function Space (elem, parent, prev, next) return 'Cite' =3D=3D next.t and {} or elem end `````` With each of arguments #2=E2=80=934 being nils if the current element doesn= 't have one of those relatives, i.e. Pandoc element, first/last element in a list. I have no idea how hard this would be to implement or how much overhead it would add, but arguably it would make most use cases where you want to know relatives of an element easy to handle. That's not to say that getting the whole list of elements can't be useful, and it would be convenient if that function too were passed the element containing the list and its nearest siblings, and perhaps even its parent. Den s=C3=B6n 16 feb. 2020 16:45John MacFarlane skrev: > > I'm pleased to announce the release of pandoc 2.9.2, > available in the usual places: > > Binary packages & changelog: > https://github.com/jgm/pandoc/releases/tag/2.9.2 > Source & API documentation: > http://hackage.haskell.org/package/pandoc-2.9.2 > > Some highlights: > > * csv is now an input format. You can use pandoc to convert > CSV data into a simple table in any target format pandoc > supports. > > * Instead of a single jats output format, we now have > jats_archiving, jats_publishing, and jats_articleauthoring > for different tag sets. The old jats defaults to > jats_archiving. > > * It is now much easier to create Lua filters that filter element > lists (e.g., removing spaces before citations). > > * 'bibliography' and 'csl' fields may now be used in defaults files. > > * Fixed some regressions from 2.7.x, including duplicate class names > and attributes, spurious dots in markdown_mmd metadata output, > columns in beamer slides, tight lists in docx output, and a change in t= he > behavior of reveal.js when there are more than two levels of nesting. > > * Lots of bug fixes and minor improvements. > > API changes: > > * Added Text.Pandoc.Readers.CSV, exporting readCSV. > > * Added new functions writeJatsArchiving, writeJatsPublishing, > and writeJatsArticleAuthoring in Text.Pandoc.Writers.JATS. > > * Export html5Attributes, html4Attributes, rdfaAttributes from > Text.Pandoc.XML. > > * Add FilterCompleted and RunningFilter constructors to Log > Message in Text.Pandoc.Logging. > > Thanks to everyone who contributed, and especially Albert Krewinkel > and new contributors Joseph C. Sible and Ethan Riley. > > -- > 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/m2mu9ir0yz.fsf%40johnmac= farlane.net > . > --=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/CADAJKhAM_TCUom3Ycutpp%3DMr93rCcnMiSpFUzYr_6B8X-TA--A%40mail= .gmail.com. --000000000000053a7a059ec4bc96 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The Lua list traversing feature is very convenient, but i= t would be even more convenient if filter functions were passed the parent = and closest siblings of the current element as extra arguments:

``````lua
function= Space (elem, parent, prev, next)
=C2=A0 return '= ;Cite' =3D=3D next.t and {} or elem
end
``````

Wi= th each of arguments #2=E2=80=934 being nils if the current element doesn&#= 39;t have one of those relatives, i.e. Pandoc element, first/last element i= n a list.

I have no idea= how hard this would be to implement or how much overhead it would add, but= arguably it would make most use cases where you want to know relatives of = an element easy to handle. That's not to say that getting the whole lis= t of elements can't be useful, and it would be convenient if that funct= ion too were passed the element containing the list and its nearest sibling= s, and perhaps even its parent.






Den s=C3=B6n 16 feb. 2020 16:45John MacFarlan= e <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> skrev:

I'm pleased to announce the release of pandoc 2.9.2,
available in the usual places:

Binary packages & changelog:
=C2=A0 https://github.com/jgm/pandoc/rele= ases/tag/2.9.2
Source & API documentation:
=C2=A0 http://hackage.haskell.org/package/= pandoc-2.9.2

Some highlights:

* csv is now an input format. You can use pandoc to convert
=C2=A0 CSV data into a simple table in any target format pandoc
=C2=A0 supports.

* Instead of a single jats output format, we now have
=C2=A0 jats_archiving, jats_publishing, and jats_articleauthoring
=C2=A0 for different tag sets.=C2=A0 The old jats defaults to
=C2=A0 jats_archiving.

* It is now much easier to create Lua filters that filter element
=C2=A0 lists (e.g., removing spaces before citations).

* 'bibliography' and 'csl' fields may now be used in defaul= ts files.

* Fixed some regressions from 2.7.x, including duplicate class names
=C2=A0 and attributes, spurious dots in markdown_mmd metadata output,
=C2=A0 columns in beamer slides, tight lists in docx output, and a change i= n the
=C2=A0 behavior of reveal.js when there are more than two levels of nesting= .

* Lots of bug fixes and minor improvements.

API changes:

* Added Text.Pandoc.Readers.CSV, exporting readCSV.

* Added new functions writeJatsArchiving, writeJatsPublishing,
=C2=A0 and writeJatsArticleAuthoring in Text.Pandoc.Writers.JATS.

* Export html5Attributes, html4Attributes, rdfaAttributes from
=C2=A0 Text.Pandoc.XML.

* Add FilterCompleted and RunningFilter constructors to Log
=C2=A0 Message in Text.Pandoc.Logging.

Thanks to everyone who contributed, and especially Albert Krewinkel
and new contributors Joseph C. Sible and Ethan Riley.

--
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@googlegroups.= com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pando= c-discuss/m2mu9ir0yz.fsf%40johnmacfarlane.net.

--
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://group= s.google.com/d/msgid/pandoc-discuss/CADAJKhAM_TCUom3Ycutpp%3DMr93rCcnMiSpFU= zYr_6B8X-TA--A%40mail.gmail.com.
--000000000000053a7a059ec4bc96--