From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31121 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Hayes Newsgroups: gmane.text.pandoc Subject: Re: Using lua filter include-files on pandoc 2.5 does not work Date: Wed, 27 Jul 2022 02:18:53 -0700 (PDT) Message-ID: References: <091e1142-2cf5-40f0-a0f4-1c6a2bd0af4bn@googlegroups.com> <8735lmefdv.fsf@zeitkraut.de> <9aaa4fcd-5dad-4278-bd37-0a1e3e4073b1n@googlegroups.com> <9e1098df-5871-4650-8171-c5b1889171d7n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_456_58951246.1658913533525" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22692"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCZ5BSFCTECRB74FQSLQMGQEK4NU5FA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jul 27 11:18:58 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-yw1-f185.google.com ([209.85.128.185]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oGdBy-0005hn-MD for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 27 Jul 2022 11:18:58 +0200 Original-Received: by mail-yw1-f185.google.com with SMTP id 00721157ae682-31f56f635a9sf24746977b3.4 for ; Wed, 27 Jul 2022 02:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc; bh=e04tapLeul+BwWsoySpdC9wvQ/DYQKh8RVksBO/mcHQ=; b=i9Vjyw6NOb/5HVKjyLHpjrfjZCHBsDDyxwsf/yO5W02yhNgN2AH43AqCINUUivhItq KsX/0fD/gsk189iDh7KcRxriQFH+pJylJzUI5iVNt6oruip5dHFg3nOf5ZATFs3dTfCT 3Pmb9FrSBZaM0tYiVHHG0P2oyQjtaeOBZdAgr+ZBu/6gPWONiPW9W5sK1Z/ACHtBQnRS k1yGwSjrK4typE3ooMfSerA5eQlk0fcd7taYvOYG5jcXA3ncwAylfNT+tx9RUDyJwolm 9x3Rv4uxqwYzE2BUr43HX9osO2Q5h8VFp/JGe7GTB5ZRLhj2Sh8dSJwIDdhBJDhS3w/5 K2Hw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc; bh=e04tapLeul+BwWsoySpdC9wvQ/DYQKh8RVksBO/mcHQ=; b=MDgd1LdmtAALQzQPRjHY+k1VoDKQJ2+pJzgAUYM9oWdJJvZNHEQ33IER14jVql1Hs8 OSRZoF8jFKV4ofOPEG0/CsZc0qH48F8OlEoAw6XzKIdeBShhNoF1VtkQBlmrwcBLQfpb JrPCT2IVCX5jAcgGZ7FTLI6VOGHSmJ3SAO9afYIdcuVGkQOPIn3b50dL35C+XR/FJS+n Rt9TX2mqKTiF6u2w2AJqbpx5KlL6zKYTvCAVltLHDUTCojeuKlr6qDQbIGhgd2uYokCK NbdI8V1xE68ExuCKjS8RngCEogXxOB32O6CoJBcPQw066IMyjCIHpls6WpxZKMC6HFQL p4Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc; bh=e04tapLeul+BwWsoySpdC9wvQ/DYQKh8RVksBO/mcHQ=; b=KT7YFWJN+6s5nZTyhRlOCvXbzqm74bxN0qlVNdhv2Dqa1tUZgZTuA/gO3hboPJj6JD WB3ReLFvtkrL1gRkiTCpYF+Yus4+dDYEMwbAQokvnoDaUkML+mhQO6O7KINrvY3puls0 JoCY/PPROf2GgGALQ5SiaOXOCYGBaWVzZJIdmKagKU5pNIzdPAfKLyHFjP9g1t1ypQkg TAUN6cF4oPLe6vK57N0z/YQOhyYZcBPJ7sCHXX5SYwsOv0QOPluwV+VG6ceOPL1lXOTJ t6zsT5SJn/mw/4k2Zyg8g/hK0bFB5TUnYraLoWEQUTAb749pIBi7ZhMpeEWd907wbkQ0 ByPQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora/CGw2EmMlEDq4G+JSYuA54nP/5UNMCcKLbqYNEA9nzByjXunoG u6CxitN9jEvqhtRtw3moAHw= X-Google-Smtp-Source: AGRyM1vHrgtzEnsdAaFe8Pad9L2ACgGxrdmWccKn/VXbEfz3RYySGoWSa8KV3FHOjHUmrvYGu0MGGQ== X-Received: by 2002:a81:a154:0:b0:31f:4847:8dc with SMTP id y81-20020a81a154000000b0031f484708dcmr6490344ywg.501.1658913537646; Wed, 27 Jul 2022 02:18:57 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a81:6a57:0:b0:31c:8442:94bf with SMTP id f84-20020a816a57000000b0031c844294bfls4845246ywc.6.-pod-prod-gmail; Wed, 27 Jul 2022 02:18:54 -0700 (PDT) X-Received: by 2002:a81:74c2:0:b0:31e:7916:a556 with SMTP id p185-20020a8174c2000000b0031e7916a556mr17905465ywc.28.1658913534184; Wed, 27 Jul 2022 02:18:54 -0700 (PDT) In-Reply-To: X-Original-Sender: es6.mike-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:31121 Archived-At: ------=_Part_456_58951246.1658913533525 Content-Type: multipart/alternative; boundary="----=_Part_457_456059337.1658913533526" ------=_Part_457_456059337.1658913533526 Content-Type: text/plain; charset="UTF-8" Hi Denis, This is the VSCode extension: [Local Lua Debugger - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=tomblind.local-lua-debugger-vscode). I found the documentation on this page really useful, especially the Tips section, so I would read carefully. There are lots of examples. It has one setting only, the default version of lua you want the debugger's interpreter to use. I have the following in my launch.json to run the debugger: { "type": "lua-local", "request": "launch", "name": "Lua Local: pandoc-argmap.lua", "program": { "command": "pandoc", }, "args": [ "examples/example.md", "-o", "Output/example.html", "--lua-filter pandoc-argmap.lua", ], "env": { "PATH": "X", // Not sure what debugger uses by default but I had to add mine here. "LUA_PATH": "Y", // Not sure what debugger uses by default but I had to add mine here. "LUA_CPATH": "Z", // Not sure what debugger uses by default but I had to add mine here. }, "stopOnEntry": true, // use this when getting set up, set to false to have debugger stop on breakpoints only. }, Then in VSCode debug mode run the launch profile. The VSCode UI breakpoints work on normal lua code, but not pandoc lua filters, so you will instead have to use this code to stop the debugger: require("lldebugger").start() See the extension's documentation for customisation of this breakpoint snippet, and more complex scenarios. This is just what worked for me. I'm pretty new to pandoc and lua, and haven't used VSCode a whole lot either, so there are probably other and better ways to do all this. Thanks, Mike On Monday, 25 July 2022 at 10:44:03 UTC+1 denis...-NSENcxR/0n0@public.gmane.org wrote: > Hi Michael > > > > That sounds interesting. Would you mind sharing your workflow. I would > very much learn how that works for pandoc filters. > > > Best, > > Denis > > > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im > Auftrag von *Michael Hayes > *Gesendet:* Mittwoch, 13. Juli 2022 01:46 > *An:* pandoc-discuss > *Betreff:* Re: Using lua filter include-files on pandoc 2.5 does not work > > > > I've been using VSCode with the local lua debugger extension to debug > pandoc lua filters, and it works great. > -- 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/aedaea34-387e-4726-bf36-8a34c94b3291n%40googlegroups.com. ------=_Part_457_456059337.1658913533526 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Denis,

This is the VSCode extension: [Local Lua = Debugger - Visual Studio Marketplace](https://marketplace.visualstudio.com/= items?itemName=3Dtomblind.local-lua-debugger-vscode). I found the documenta= tion on this page really useful, especially the Tips section, so I would re= ad carefully. There are lots of examples.

It has o= ne setting only, the default version of lua you want the debugger's interpr= eter to use.

I have the following in my launch.jso= n to run the debugger:

{
= "type": "lua-local",
"request": "launch",
"name": "Lua Local: pandoc-argmap.lua",
= "program": {
"command": "pandoc",
= },
"args": [
"exampl= es/example.md",
"-o",
"= Output/example.html",
"--lua-filter pandoc-argmap= .lua",
],
"env": {
= "PATH": "X", // Not sure what debugger uses by default but I = had to add mine here.
"LUA_PATH": "Y", // Not sur= e what debugger uses by default but I had to add mine here.
= "LUA_CPATH": "Z", // Not sure what debugger uses by default but = I had to add mine here.
},
"sto= pOnEntry": true, // use this when getting set up, set to false to have debu= gger stop on breakpoints only.
},

Then in VSCode debug mode run the launch profile.

The VSCode UI breakpoints work on normal lua code, but not pandoc l= ua filters, so you will instead have to use this code to stop the debugger:=
require("lldebugger").start()

See t= he extension's documentation for customisation of this breakpoint snippet, = and more complex scenarios.

This is just what work= ed for me. I'm pretty new to pandoc and lua, and haven't used VSCode a whol= e lot either, so there are probably other and better ways to do all this.

Thanks,

Mike

=
On Monday= , 25 July 2022 at 10:44:03 UTC+1 denis...-NSENcxR/0n0@public.gmane.org wrote:

Hi Michael

=C2=A0

That sounds interesting. Would you mind sharin= g your workflow. I would very much learn how that works for pandoc filters.=


Best,

Denis

=C2=A0

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...@googlegroups.c= om> Im Auftrag von Michael Hayes
Gesendet: Mittwoch, 13. Juli 2022 01:46
An: pandoc-discuss <pa= ndoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: Using lua filter include-files on pandoc 2.5 does not w= ork

=C2=A0

I've been using V= SCode with the local lua debugger extension to debug pandoc lua filters, an= d it works great.

--
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://groups.google.com/d= /msgid/pandoc-discuss/aedaea34-387e-4726-bf36-8a34c94b3291n%40googlegroups.= com.
------=_Part_457_456059337.1658913533526-- ------=_Part_456_58951246.1658913533525--