From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/22076 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Colin McLear Newsgroups: gmane.text.pandoc Subject: Re: ignore section & content in output Date: Mon, 11 Feb 2019 09:48:02 -0800 (PST) Message-ID: <717bc9dc-b99a-4472-9965-1c84a737fc01@googlegroups.com> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1403_1710875981.1549907283053" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="185743"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCJPTDWP5AIRBVHKQ3RQKGQEETCOY2I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Feb 11 18:48:06 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ot1-f57.google.com ([209.85.210.57]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1gtFgc-000mCr-7f for gtp-pandoc-discuss@m.gmane.org; Mon, 11 Feb 2019 18:48:06 +0100 Original-Received: by mail-ot1-f57.google.com with SMTP id j23sf11843802otl.6 for ; Mon, 11 Feb 2019 09:48:05 -0800 (PST) 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=UeVq+oC3/KyjsCcA91esvxzPZ5nmyePszbEXe1kO5bc=; b=spWdQGmIdDavLG4ojo6QT82LwEc1mXwFHtgdjtTeg4FQcKa+0e/Uca3VVs40wKmwiA 74IWw4BeSfRhi0Mee9SaxLZ1c72vwYQXfcBYkk5oOkpdmTwP4RWGcO9Y9MhcVLCbI56c ek4gA/+QVN+mgJU7AxeRSEidNJxTCEg/yfGgiW0cjyNYDDv9jfJ5dlcBVvdwpdgVDBSZ tLPZ+FUXU3C1rUPAH+iGGw47uSnZ3X0RK69rTk6Kji+cAERj8nVrAhUv4OS037vamKiA m3SQGC2o2bS1Aq9Oab8e8IyHSiUp2L0E1V2PXgSbWzMPvIRXmEai3Y0coys6/IuJL1Tg cYTA== 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=UeVq+oC3/KyjsCcA91esvxzPZ5nmyePszbEXe1kO5bc=; b=idUQ9JHFVnP83tTn2jhcyFwKG21Nm9Nnr4lLK4Tndf2wQBlY47b4Fyvpwt+gv3APeF aOQI0/lgMUPhFk1ht3JOmRBVkTxPuppUe/yPvT919fFHyT+dMZ/UzPjvz+TDgZaKAp4v Q8COpZViSAwxytynU/QDqKKRoSg/eflfVjmpZowTfrAWucEsBs4L9n6venrbxCNJgS1J PRNxRIBA8j8q6tGhUy/DpjTNITgu/8XB9KldnbeNDir8U3iLtHtD76qa8XgBJ7O+8pLI XpczO4WLp6p+Q07r+HhyIdZHJ2whW/cCF3FL2RvID0bMAQQQNY/WEr7AA2qaCYb2IkiV XY9w== 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=UeVq+oC3/KyjsCcA91esvxzPZ5nmyePszbEXe1kO5bc=; b=MIhLIk/jhmyxKlTiX9kTxQn3HjXCN5QyIUNavzgFEfTDZMLAxdGf3cy3s2Bl6c92pE pVis6tzmYVIXGExpjeEs70fRZ5hCXVhG+n9ezxW30LJRITN0ZYRn5ZaiJEe5ZvriWWIJ +kyj1lSYv+HbBJcOWtzPLOp3cexmT6pUt1FNxEYYyQ2aMtHEX0AL+i7QHcO+GLPJMR5I cKpgKKR+rwKor8ttZ8AUHDXK2doZpV8bFzzk8kl062vTpKYyCxCAK+uhfk/uSReepCYq D522TVeMJ9g6qxMCI+MXDSsczVXZiXl79Fqe3/F+SoL9PO4YjlpeJ4JAiyprg4Fu8cYg gQsw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AHQUAuZ6shaUjK3wmo2qO81ERDb5XBgNPswTdsmbb+opwLfw9tAIwKcj aPoZpkAr30JKJrRp0Huvi68= X-Google-Smtp-Source: AHgI3IaA/VfaNvrrThGMwQUBf73dP6vE/4+N1t2qXdtGnpJrF7XXjngELrWcffPyXaXBFbIne9zVYw== X-Received: by 2002:a9d:654f:: with SMTP id q15mr426785otl.6.1549907284530; Mon, 11 Feb 2019 09:48:04 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:5619:: with SMTP id e25ls8240370oti.9.gmail; Mon, 11 Feb 2019 09:48:03 -0800 (PST) X-Received: by 2002:a9d:2c22:: with SMTP id f31mr498302otb.4.1549907283737; Mon, 11 Feb 2019 09:48:03 -0800 (PST) In-Reply-To: X-Original-Sender: mclearc-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:22076 Archived-At: ------=_Part_1403_1710875981.1549907283053 Content-Type: multipart/alternative; boundary="----=_Part_1404_764235653.1549907283053" ------=_Part_1404_764235653.1549907283053 Content-Type: text/plain; charset="UTF-8" In case anyone is interested in such a filter: -- cutsection.lua - remove tagged sections in Pandoc output -- heavily adapted from https://github.com/pandoc/lua-filters/tree/master/abstract-to-meta local looking_at_section = false local remove = {} function Block (elem) if looking_at_section then remove[#remove + 1] = elem return {} end end function Header (elem) if elem.identifier == 'remove' then looking_at_section = true return {} else looking_at_section = false end end On Saturday, February 9, 2019 at 1:55:15 PM UTC-5, Colin McLear wrote: > > I would like to be able to put an id like {#ignore} next to any section > title of arbitrary depth (i.e. h1, h2, etc) and have a lua filter that just > removes that section for any output. I have a filter that accomplishes this > for particular headings but for some reason (well, probably because I know > very little lua) I can't make this work for heading and content. Any ideas > are appreciated! > > > -- 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/717bc9dc-b99a-4472-9965-1c84a737fc01%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_1404_764235653.1549907283053 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In case anyone is interested in such a filter:


-- cutsection.lua - remove tagged sections in P= andoc output
-- heavily adapted from https://github.com/pandoc/lu= a-filters/tree/master/abstract-to-meta

local looki= ng_at_section =3D false
local remove =3D {}

<= div>function Block (elem)
=C2=A0 if looking_at_section then
=
=C2=A0 =C2=A0 remove[#remove + 1] =3D elem
=C2=A0 =C2=A0 ret= urn {}
=C2=A0 end
end

function= Header (elem)
=C2=A0 if elem.identifier =3D=3D 'remove' = then
=C2=A0 =C2=A0 looking_at_section =3D true
=C2=A0 = =C2=A0 return {}
=C2=A0 else
=C2=A0 =C2=A0 looking_at_s= ection =3D false
=C2=A0 end
end




On Saturday, February 9, 2019 at 1:55:15 PM = UTC-5, Colin McLear wrote:
I would like to be able to put an id like {#ignore} next to an= y section title of arbitrary depth (i.e. h1, h2, etc) and have a lua filter= that just removes that section for any output. I have a filter that accomp= lishes this for particular headings but for some reason (well, probably bec= ause I know very little lua) I can't make this work for heading and con= tent. Any ideas are appreciated!

=C2=A0

--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/717bc9dc-b99a-4472-9965-1c84a737fc01%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_1404_764235653.1549907283053-- ------=_Part_1403_1710875981.1549907283053--