From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23678 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: ChrisD Newsgroups: gmane.text.pandoc Subject: Lua filter documentation errors? Date: Thu, 24 Oct 2019 12:35:17 -0700 Message-ID: <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"; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="155962"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDHMHIETYAGRB6PZY7WQKGQETIUYI5Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Oct 24 21:35:24 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-oi1-f192.google.com ([209.85.167.192]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1iNitH-000eOc-Fa for gtp-pandoc-discuss@m.gmane.org; Thu, 24 Oct 2019 21:35:23 +0200 Original-Received: by mail-oi1-f192.google.com with SMTP id 19sf14980533oii.2 for ; Thu, 24 Oct 2019 12:35:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1571945722; cv=pass; d=google.com; s=arc-20160816; b=ivPmPTP4mRcAEs8RTtaIA4EPTq7g+dtFJYXicDl+B1uI+/Yfc2M46AL0RxdAv2OePe IWB2WIdXvF65wiXYUkHwZZ0PLD5EUECSKXvRFRRKy7k6PTgsUahkNB1vhCIhITQFYLkv is1qnb5ObYnenNyNBkJZPoXzl2HTO1ap0le9g7M8nUpj1Ao7d+2RuQDKue75jIJTSNK+ EmAhRusXQ+6+PQyvwVCSQCuq3XklAwmuDVJswwg68nApC++JCYOgVt6quYrO4xqp844J 365ae4Pg9NH37F2qiYDyG9X+dt39AT6RTKXqpoTssCit0DYwbSn0AiwXm/UVwtZsJiPs 0juQ== 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-language :content-transfer-encoding:mime-version:user-agent:date:message-id :subject:from:to:sender:dkim-signature; bh=958Kn3sAb76gIZrT81ARX/Xlhs0S2Yxe/bb1HltDN3E=; b=GqxRPr8vHmk9oPf7rLIm9gxOAE2Kf1XENScAVYkx37heH33KLysEBdBCvL22qQt9US 4wlS9oD1XTxoRTIcQXgz5v7nxLSkbLWJOFikpRkkrmwJxbsmLeh8suUb96kTGZGMWOSd oGBjAVUt5GoOClJir71QxdA07Zx9UVcfEP+hOdJ5AqPuH7Hue3ahq0juEmN/GuoF8Z3+ nrZBLWuNWXlmC8DWgXSnaQ26UBN4uwwPDwPqigFVpWB1llocmPC4P3EjpGD3+8IYIQ1l hXPBf3N56Y6CPwGM0GkKwYlv0fQ6CwS1lrI8Ma/OqdvIV0VzI6y2rcF9e2zjBOSlzc45 R9gA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org designates 209.68.5.143 as permitted sender) smtp.mailfrom=cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language: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=958Kn3sAb76gIZrT81ARX/Xlhs0S2Yxe/bb1HltDN3E=; b=sidUbjyyZjREbQVEbAABxP325+KXQdzPbHZfWgPY+FAVVeK2iFY52tG0sQMavm2ofS fsNOGzWHpwMIh2DDuiEZjSquGYbDou2vvqq0v57bYSw7877uVqV4dUSJ/4fABbZv+iXp L/trEgssJ3snVNFr8YRcvq674BE9EWyBhnS8gR4PKB1UPszw591kZPu7k6sMKJT/M0G9 hpBUk8GPDB+te/A9rPV7tFH/+e9Gy2wxThsfRBN5Xk/+yblvJf6azQHTCH/Ceq11kJUf C+G7/vfLzLlxAt14KZTSyw9T+ye4R+PqKpTu2vQ3rj4MK7685MwOM53x0TvO8N8UN735 2GOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:to:from:subject:message-id:date :user-agent:mime-version:content-transfer-encoding:content-language :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=958Kn3sAb76gIZrT81ARX/Xlhs0S2Yxe/bb1HltDN3E=; b=LGdqJI2hZWKoWlgim0ONsK9igaGYjXdk0nJ0j2spw4CgCmMl8+vGh0Ax+k3+jcHD1e TbK1FDfjSw1zHhgcRuDOcrVN29pkxot+77tKWiFzmgpyw8cOaTYGB/BsTLFhvQMAIVdz QKs5AccOGzU8wURduX2RvEea/DEi+k/ucnY6/Vm+LCZYDYS42AFHOM++JUrp5LsXp6tL qEBY0t0yE8lFtJFVBZNOqPsrq2aHebI3iXfGvSI1P5Ez6EKM41uQIuxJ+Rvo/e10NRkY p1pfAyLIOVPTKSFNQeReHam0dYeX6rt9nN0dz0ljJHeOaOQaCj+D417+fKojCA5SzX9i Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAVws5ZGnppyquVzz1zZpttIwJ5GdCjW4jtDLUZ42SzGjmuh20QV g0/Dt6XVUOoMchKyc5ZtDIM= X-Google-Smtp-Source: APXvYqyhlioxdsJYtDpwEmgHDa+x+27UPWSw2LvwXlpddpI6ooLXrrF9/vF9nIjb/SS6LivK8lOGSg== X-Received: by 2002:aca:4fd8:: with SMTP id d207mr6413180oib.33.1571945722148; Thu, 24 Oct 2019 12:35:22 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a54:438a:: with SMTP id u10ls2181024oiv.3.gmail; Thu, 24 Oct 2019 12:35:21 -0700 (PDT) X-Received: by 2002:aca:5c06:: with SMTP id q6mr6266366oib.175.1571945721009; Thu, 24 Oct 2019 12:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571945721; cv=none; d=google.com; s=arc-20160816; b=JcvsU8F5aUR9/+DG03UH1Nn775lApWBbfuOacpAj0atMGF59DB2xpR2PW6cLEd0RDl FPiwCXYERVji+YG4qqGT5NzKC+WIR9XQp5G+HUGsLGRyXFP4fPzxK2txNAMBQTkCX4Fu DnIzJNHjiDdS2sMnCxrJeJWsfXlM6NpqtU5+0KtkKkF9pkzltZk2U6LZl6WB6S4ZSikM 3xzNyyMjf5vfx6gv+SPrmQ17pbU43Qf5liiMdcqGFgLzzgUB1ID/QR+2cqpUxqGDEvu4 JvfgWCvdy1qFSKkMIay7boj7/mt5Cc9tM6ovs7TTll3Zbo3ZP2n/XJX96req2Pufm9vY HjUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:content-transfer-encoding:mime-version:user-agent :date:message-id:subject:from:to; bh=vVquwNeVVXkCqNGfr+8jGp5QZByKapsa+wodFh3rKJQ=; b=tp1NTZN1nQhJVwUm1OgN2C3cBRNPWjbbnV8Nr885xUWVIEg4kSmhu/s3jwm1LH69KS 1mGkOn7RbFaU8KbD16B96gf9UX2HFy+GVEBjF9ja6P46DK5bbGEij+0j5RbAQgW9s2U8 MYKfJnRR3PSSaJYxcC3OSBvntSoLSpprPij2t7ZARZY+E2o6SEi9LbtCfOSRoizH3dsN u2QodZ4ruxjQLSCli+rPx/w2hHsQ85RxYSnxDHZJsLe6Qw0FWR+iq6zGaKgjogR+e/d9 ki/HXnHOLE7+eLO//AEWKNKp74z4XllHkQ4fp2uM0zYBRjjQ5Nf4oIuxVEzB8ac7ohFG 6VyQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org designates 209.68.5.143 as permitted sender) smtp.mailfrom=cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org Original-Received: from hamza.pair.com (hamza.pair.com. [209.68.5.143]) by gmr-mx.google.com with ESMTPS id m23si511557oic.1.2019.10.24.12.35.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2019 12:35:20 -0700 (PDT) Received-SPF: pass (google.com: domain of cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org designates 209.68.5.143 as permitted sender) client-ip=209.68.5.143; Original-Received: from hamza.pair.com (localhost [127.0.0.1]) by hamza.pair.com (Postfix) with ESMTP id CBF4E33E33 for ; Thu, 24 Oct 2019 15:35:19 -0400 (EDT) Original-Received: from [10.6.10.6] (ip-16-36-244-173.west.us.northamericancoax.com [173.244.36.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by hamza.pair.com (Postfix) with ESMTPSA id 9CC5933E31 for ; Thu, 24 Oct 2019 15:35:19 -0400 (EDT) Content-Language: en-US X-Original-Sender: cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org designates 209.68.5.143 as permitted sender) smtp.mailfrom=cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@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:23678 Archived-At: I have been playing with lua filters, and I have a few corrections to the l= ua-filters page in the documentation. Nothing urgent, just figured I would = pass these along... 1) The example for mediabag.fetch (https://pandoc.org/lua-filters.html#medi= abag-fetch) is incorrect. Fetch returns two values. The second line should = read: =C2=A0=C2=A0=C2=A0 local mt, contents =3D pandoc.mediabag.fetch(diagram_ur= l, ".") 2) In the mediabag list example usage (https://pandoc.org/lua-filters.html#= mediabag-list), the for statement is incorrect. It needs a "do", and the co= lon should be removed. 3) The docs on mediabag (https://pandoc.org/lua-filters.html#module-pandoc.= 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, an= d not if --standalone is used without --extract-media. 4) The example for replacing placeholders with metadata values (https://pan= doc.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". That'= s because boolean values are stored in the metadata table as MetaBools, whi= ch are lua booleans, not tables, and the "v.t" will fail. I believe this co= de 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 r= epresented as MetaInlines. The code should check for MetaBools and MetaStri= ngs, 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 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/193ee2fd-7b82-6176-5cfd-353353816019%40intielectronics.com.