From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/27471 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Lua filter applied to a specific input file Date: Thu, 14 Jan 2021 22:54:04 +0100 Message-ID: <87ft332nib.fsf@zeitkraut.de> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6433"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBA73QKAAMGQEP2D24TQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 14 22:54:13 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f188.google.com ([209.85.208.188]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l0AZJ-0001WX-HD for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 14 Jan 2021 22:54:13 +0100 Original-Received: by mail-lj1-f188.google.com with SMTP id n10sf2450411ljj.0 for ; Thu, 14 Jan 2021 13:54:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1610661253; cv=pass; d=google.com; s=arc-20160816; b=dj8F6i/3d0i3ps8lr0TYQrThTu+U+QtG8N4JnjjjABCll4lnvqo1kwPjzji4qJxvV0 ShEdSthsBD/nbnpFXtAcN6EoXqnmtDdkOyZCEqUkHO8QLqVxTjs8vzxa0qlGCn52wT+e JamSjMJU74r53zkWOsG8aEfSfLf/JAUKl9QLlOy3KVtPGakPl3hL2bOjiM3MxzOrDJfT QQX+Zs1jsQc0hUpMwDIUiclaeuNl7+dI7ZDHtdbmJV2Hx4f9951q5MNSVQNCBgX4ZZpb q4TmBqEj24R/qDQ3i7rBMMl0W07lfSEe0ONEsgmz82EilKFsBhRckXGJ6+yWcUDcQECy ql8A== 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:mime-version:message-id :date:in-reply-to:subject:to:from:references:sender:dkim-signature; bh=Lcjhh4AtAvFp9SmZIXUgfOvLtsMDqIsaEMAuffAJbUg=; b=NPpsqMJZvJRgjMiIxVWUA4F6AkvBXi++8hFp3o8jrW9PrPtKi+bzXgUQaCUpkuucj2 gpQC9v6KrIZpdqUOIm6RdH5bRop78nTPEq323SAAYsTq1mygsy1Br0X8V8kbd0Lb7zLc mfzu2HbH8RqcqoU1Q4lczbTkympqpQECyw4S2EGKhWSXZVeqIiIJf/5OM61G5XEQ05GP MfkH29FYHl5U2BqX5DIU2XijiXW9BZneYQwvoXxYnCc1rOE5WKgvnnsEY7hjJhCDLuvc sPedrtl1v/zBIrT86V/egugRmXTdJs+z7ctq3m+BlXu2F6FEzWbPAo/VpyoyeTccgDeT dxug== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:references:from:to:subject:in-reply-to:date:message-id :mime-version: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=Lcjhh4AtAvFp9SmZIXUgfOvLtsMDqIsaEMAuffAJbUg=; b=cfIIegtZjs9DLtLEZkPcWm0NOSU3IzVF6CqjPkbB0mhmXFeESgqWWClk5Qw8V37xu4 FhFaNYZF4Fw1IuXNbwuTWWOB/dfrNVWgAm78J7ai85PSNSMPaiR6eR00YHs1d8qMEFq3 sLBcecvBqzIILAuN70562XT/PMLLbR6rHdSyZ0L7MzbVByAZDG13xM7EUxJagxwSC7s5 XjGJOP6hwiBK7KKid2CDmHkmxTuY3n7/tr7+F0abJXd2aW00BBrAC7u1ISFGp7Wf7tIk rdK/ZmaDTyqeYme191pOiF3IQ+cnkPUL1aAWSczt6/hqkgvbSXo1desKyuWAfQUeqk+y vvVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:references:from:to:subject:in-reply-to :date:message-id:mime-version: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=Lcjhh4AtAvFp9SmZIXUgfOvLtsMDqIsaEMAuffAJbUg=; b=TM2fkhGJo43VXtPQ82ofpe4E/4PUUar/UxIFR3ioFAOx/iYMzDM+Fasmvz5HIRBpeo UN2a29lp5nUvHMO08KKSjHotoWmq27BZ6ENwVYUMcKvsIWXLpbozX9kf1gZAhfYYBC3q IH88it2zci81lcqxtejJwMzV/l/TgRLcZifH3dCdBOBOpuRe5/8oDxec/rJsxiuYXi/i bb4n/ehHWZJ+BiuciY4Id+sNqhqMSUxQI5+XVz/BjJi7h+lfVWHJvOdCtoUlZ0aC+fgW QLp/B7s7WUdpKr9MzntsoCr++6cFfKC+d8hG7sm3ok6jhHIPK/UIwYHEdek5FeJV6jj8 IgUw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533hzbWW9Qy1v+pTccr98I+vwcxnkjE6UYrEQd/G4WK9uhKplGfn elmNSdxQSd4hh4XlTPHrJv4= X-Google-Smtp-Source: ABdhPJyolzQwvWIveNwpz1NTgP6zGoxxtE1FLcm3gSFtP6p7KmGuCBZf18UscYedzLMXWBX+Uoo0rQ== X-Received: by 2002:a05:6512:b04:: with SMTP id w4mr2349390lfu.43.1610661253093; Thu, 14 Jan 2021 13:54:13 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a2e:3614:: with SMTP id d20ls1193239lja.6.gmail; Thu, 14 Jan 2021 13:54:10 -0800 (PST) X-Received: by 2002:a2e:8156:: with SMTP id t22mr3812656ljg.263.1610661250141; Thu, 14 Jan 2021 13:54:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610661250; cv=none; d=google.com; s=arc-20160816; b=r2keQTAeRnzLPDGoYIuhgkHeXxs7/6cqIVBrb37fXD7KOuctXX3k+wZXgv6bUt/BBx KpqviYEBLYPgWvBaHO66SErp0tql7ncLoEzfCUVMsMZdZS4YFB/deYNMz4OyFtVDfkbY IjcoQY0Fpybrv3jCbN0yWKfkJX8K0NLJAf8rjUCjoAz9UucnXfZ2ZypGvM6h2wFTA4oq wsdy8bC1THMMP1GrGxegdBF3IcDo3spYVthFu2c3UGHQNITQc8/QTxGcoU7vUSqbehnH sunlO8i+bRID1Wsb/uxZtmXgMz3Ga0MykfL/60/s21p9UDwuOVmnHuNQrnDSq9bpXHpF 93AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:in-reply-to:subject:to:from:references; bh=/Q0qpOHCXKmK1fTr8c/uMGqZzWVkIOt2hOnI3E8emOA=; b=0zmMJQ+us8hVZ7MRsAK0FJiQmW4CeWvqah+LMzZ+rp2fwHw6PDAjfVx5EEBy3Wk8cG dT3D6mF1uo0xGKpxuD2DqvpgEjYye3t0ou2msnOwj+oQ6MsdsHeaW7Dbftwjk5CMi9Wq qQgIgleGAJkFIi6wlJeNLApmgVsE8mDhKkGgpH0QFEOkjfh/TIpYSckK1ey19vYWO8eM zRmMEVfcNnNUYPiwhHR4qJxB0WInZmJYoJt3wIqoAMdMkR+WHjOIziBt96D+DmA/3DCg 5yVbjrFtjYaDRDWYbSNdCjctThSMYUd8TYFQIrq8JRNWcIYRwK5a6AeCT2wQ7umWaq71 39dA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org. [2001:67c:2050::465:201]) by gmr-mx.google.com with ESMTPS id t65si261907lff.3.2021.01.14.13.54.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 13:54:10 -0800 (PST) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:201 as permitted sender) client-ip=2001:67c:2050::465:201; Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4DGykn39jYzQkGx for ; Thu, 14 Jan 2021 22:54:09 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id fgLWul7Np3Xq for ; Thu, 14 Jan 2021 22:54:05 +0100 (CET) In-reply-to: X-Rspamd-Score: -5.16 / 15.00 / 15.00 X-Rspamd-Queue-Id: 287C7170F X-Rspamd-UID: b3ca01 X-Original-Sender: albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@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:27471 Archived-At: Peter writes: > I have a working Lua filter and I'll be having pandoc iterate over multiple > input files (for loop). However, I know in advance that my filter will only > match on a specific file's data. Is it possible, within the AST model, to > have the filter bail unless it's inspecting data associated with this > specific file? Or do I need to deal with this at the pandoc invocation > level (i.e. specify what filter to use based on the input files)? One possibility would be to match the exact file name. You can do so by inspecting the `input_files` field of the global variable `PANDOC_STATE`: local input_files = pandoc.List(PANDOC_STATE.input_files) if not input_files:includes('my-special-file.md') then return {} end -- rest of the script begins here. Does that help? -- Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124