From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23682 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Lua filter documentation errors? Date: Thu, 24 Oct 2019 22:18:50 -0700 Message-ID: References: <193ee2fd-7b82-6176-5cfd-353353816019@intielectronics.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="55480"; mail-complaints-to="usenet@blaine.gmane.org" To: ChrisD , pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBR4LZLWQKGQEG7UTHDQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Oct 25 07:19:06 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pg1-f191.google.com ([209.85.215.191]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1iNs0A-000EEx-DM for gtp-pandoc-discuss@m.gmane.org; Fri, 25 Oct 2019 07:19:06 +0200 Original-Received: by mail-pg1-f191.google.com with SMTP id w13sf880253pge.15 for ; Thu, 24 Oct 2019 22:19:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1571980744; cv=pass; d=google.com; s=arc-20160816; b=R9bDbkGHPG83VH4lRdKEbj3FLEM2Lf0E29eDu9KQvBAi5ZgcKJNgPFfJfAiHNJ8TXV 7LV2680N0sxtnGbHaUgI04Ngtn8TMB6M2qI/d5gqiuHABPegpV+F5fdCLzdsorIVg2Vw xBFjgCTJGCConoGZaknoQKOg1nAoiu8tN4Y4awC7zDlYPqok7k/xZJjiSs5o6t/JQDp8 5OnCGTt6xdkYjtw0rM1F441q85n54Yx0q3IgENm0865xPddesgLPlEOzyCoLYd4jjKP2 jXLWpQjvZTq3sgAjYJ32w9d5uk856UVU0Eu8NnkZElp+s+1ag3dYk2jUCsIiruKKs/+r klLg== 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:content-transfer-encoding :mime-version:message-id:date:references:in-reply-to:subject:to:from :sender:dkim-signature; bh=lXFh/pRXJWdnx4GwXS/fNin732AfxQ6y4nnhb3i2zts=; b=GkWwEss+IbmmAvGd1lv7Bo0Bp84xE5oLITHDHr3tBvtiP7aeCZbm3vnVbvOF0QfLDw 9sMhoMPaxAj41IJxLLwnDKmNdSK8HXSmOiow00HWA1kpw8wgtudsKsXs0GI9rHRfYD3y vZPYTMzNJAgIiDKkTTMtOsn/ZThLsKr8Yxk3SAJlihUlRpdHVwbfDN+dEzHK4DzZri6A eDaAhyvopyb7DO5s0jBJj37G+4uggieVIEamvQaI/M18QsbR1NJ4RjXAwN7its1lZr10 XDjdGVEuecVpTGYjiIaqFsFSYPFsifoYgVvbTbs8EHa6kwJs4WaAZifqM4ka5GIn29We B/EA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=XWoMHfNR; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=lXFh/pRXJWdnx4GwXS/fNin732AfxQ6y4nnhb3i2zts=; b=jaStmPa8Vfcpp0cuIyrwxwpbZbcVXZtBdPU9AwCbGhDpq+HV4brZv0UEygE4pG6zc0 Lai6tTejoczeLKiIA6T264OXhMro0n0ZmJbyY2lCIMOaJKD+H1PM21u/JEOeerl2vqd8 NndOvXuEOoPO7d2gzf5xgJ9oVEfpUClYrzHXuPI1WnZY3McuDwlg/Fpda0v6AYBs7j1v 0uSftcvw6uJ2ICLNAnkw9RGmuJhbsjAfBH5b70i3KFX67OrMMwmX9SvdJnGINwmtBULY bwdnSb7qEFMjDihyjNqqMlxsF4XUbATVk0FQjROR7XAqvjKim9yI1Nu7xuBFbDgcG6N6 E+tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:content-transfer-encoding :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=lXFh/pRXJWdnx4GwXS/fNin732AfxQ6y4nnhb3i2zts=; b=ee4cprZl26VF2o/br8UHGcytqBClatNdoZdx+T2enbnnpNqyEGMid1R5IAGhUhQI/i n3/WRGBsrpM4Tgl8nuYiXfoH1AYGWxOMVotq4EdVw8ZGtdkdJxvjqPSsoC64D7CSQORb 0Z3L9X8ulQPLTKsECo7tUGsQfas88BOxD+DfJY+zPRsLCDhlTT1sT2D5giL0+JeWLgeh k99RTrzQGJiijVkTBRBqCqj4AB3B2bZ3pAfGVUWrvP+s5WUSQ0SOP62aKGav9GW0kIUz W+cFt2Lo5MKOfznsjU61fo+vfowgOCSEJSIJjRe3pq5X3RTsTs8oWFuX4Ttj73U5auMW Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAUafAqliXKUH/qNd9bv0/PWlpV8BnIHhl2xpM7iWO6pzKK+lKAx md+a2wvYiLbR87uCZTvitTc= X-Google-Smtp-Source: APXvYqy2viZ2oDLQGbEd/OrkUGSGDDDPZfyuHVjUw5whPMzOk9/SNs7RH2+yiSXlzR+tDowrFIjpdQ== X-Received: by 2002:a17:902:b60f:: with SMTP id b15mr1689928pls.68.1571980744708; Thu, 24 Oct 2019 22:19:04 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:90a:c086:: with SMTP id o6ls2703688pjs.4.canary-gmail; Thu, 24 Oct 2019 22:19:03 -0700 (PDT) X-Received: by 2002:a17:902:8509:: with SMTP id bj9mr1568186plb.328.1571980743503; Thu, 24 Oct 2019 22:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571980743; cv=none; d=google.com; s=arc-20160816; b=03ADt878Z3tgPRpUFL2XFKdTiJZMrJ1gTDeMM0PW4sTfxrzhwGuA2HsTq7mKFFYft5 NrqT2m12lY+wd73bdIq9qZYLgoVqAguCXLvW+lYSE+9uRBSHG5VhV5TocD1DneFKAdSl q0vL5KkegjBHmFGKLrjvIUqTCDOOQctZVR1uQDm5JAuFVfTBW8PJXMZ892EYBXusu0iK Iy+EPnmAUOQbyLI2uVMfJJ42+BtsdIPFwo+TpfsdOQpoX84epSrlGL7j6fQikVddOsic 3MoTngPKK5VKVoHLlbP5P2gN1HhcWbD7usriYs+FrJlh48uE+R5TazGLVVdvRl9BAcO9 bc6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=j8QOqDfRFCxqYvVRWzW5ncaTMhrnW6rL5mwmkWXPBrE=; b=XDOQcLftPbkhu2ebwZaBXSJjeQnqGOpcqDKqtrnw2AiMSdmN57Mymam2pPSHkdO6PY Q+5Okb1SlCw+7mXweItCJeiOkED5gGc/5sPv71OSazm2C24IyuASAALHLh6QTpWCFlFa RXRMX4Sks1Qvq61KfVmKuSGS21I5L6GL8xYw9A+Vg+8qIoguThMR0BeguG/w7qZ7fI2e fXe0T0gX1Z0NRfTcc6IoHf+VzVJDhrtSn+XXdUYY71HpyWs5i2Wfaf9vDxWcBrC+QxPK n4DQR5A3bnN8ZFq28p3zG76hc6ybrEqlKEcUZAF7ohvRibnRxsRMoAEsN3a0VM6H3pqS +yQw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=XWoMHfNR; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com. [2607:f8b0:4864:20::52d]) by gmr-mx.google.com with ESMTPS id b17si42975plz.1.2019.10.24.22.19.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Oct 2019 22:19:03 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) client-ip=2607:f8b0:4864:20::52d; Original-Received: by mail-pg1-x52d.google.com with SMTP id l3so750297pgr.8 for ; Thu, 24 Oct 2019 22:19:03 -0700 (PDT) X-Received: by 2002:a17:90a:f981:: with SMTP id cq1mr1665047pjb.142.1571980742735; Thu, 24 Oct 2019 22:19:02 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id e7sm779849pgr.25.2019.10.24.22.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 22:19:01 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 213B7A234; Fri, 25 Oct 2019 01:18:51 -0400 (EDT) In-Reply-To: <193ee2fd-7b82-6176-5cfd-353353816019-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org> X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=XWoMHfNR; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:23682 Archived-At: Thanks a lot. I've added an issue on the tracker: https://github.com/jgm/pandoc/issues/5851 ChrisD writes: > I have been playing with lua filters, and I have a few corrections to the= lua-filters page in the documentation. Nothing urgent, just figured I woul= d pass these along... > > 1) The example for mediabag.fetch (https://pandoc.org/lua-filters.html#me= diabag-fetch) is incorrect. Fetch returns two values. The second line shoul= d read: > > =C2=A0=C2=A0=C2=A0 local mt, contents =3D pandoc.mediabag.fetch(diagram_= url, ".") > > 2) In the mediabag list example usage (https://pandoc.org/lua-filters.htm= l#mediabag-list), the for statement is incorrect. It needs a "do", and the = colon should be removed. > > 3) The docs on mediabag (https://pandoc.org/lua-filters.html#module-pando= c.mediabag) say that "The media bag is used when pandoc is called with the = --extract-media or --standalone option." > > The media bag appears to be populated only when --extract-media is used, = and not if --standalone is used without --extract-media. > > 4) The example for replacing placeholders with metadata values (https://p= andoc.org/lua-filters.html#replacing-placeholders-with-their-metadata-value= ) fails if the metadata includes boolean values. > > For example, if your YAML includes a line such as: > =C2=A0=C2=A0=C2=A0 toc: true > > The code will fail with the error "attempt to index a boolean value". Tha= t's because boolean values are stored in the metadata table as MetaBools, w= hich are lua booleans, not tables, and the "v.t" will fail. I believe this = code will also fail if the metadata table contained a MetaString, though I = do not know how to get a MetaString into the meta table; strings seem to be= represented as MetaInlines. The code should check for MetaBools and MetaSt= rings, or check that (type(v) =3D=3D "table"). > > > > > > > --=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= email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgi= d/pandoc-discuss/193ee2fd-7b82-6176-5cfd-353353816019%40intielectronics.com= . --=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/m25zkds8qt.fsf%40johnmacfarlane.net.