public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Michael Hayes <es6.mike-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Using lua filter include-files on pandoc 2.5 does not work
Date: Wed, 27 Jul 2022 02:18:53 -0700 (PDT)	[thread overview]
Message-ID: <aedaea34-387e-4726-bf36-8a34c94b3291n@googlegroups.com> (raw)
In-Reply-To: <bd9382fbf7ab4205ad04f5dfd398ed5e-NSENcxR/0n0@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2758 bytes --]

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 <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> *Im 
> Auftrag von *Michael Hayes
> *Gesendet:* Mittwoch, 13. Juli 2022 01:46
> *An:* pandoc-discuss <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> *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.

[-- Attachment #1.2: Type: text/html, Size: 4998 bytes --]

      parent reply	other threads:[~2022-07-27  9:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AQHYlkmLQSWBnyserE2AdkoYSfVyWa2O6UgA>
2022-01-17  7:48 ` Jacco Steur
     [not found]   ` <091e1142-2cf5-40f0-a0f4-1c6a2bd0af4bn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-01-17 12:05     ` Albert Krewinkel
     [not found]       ` <8735lmefdv.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-01-17 16:14         ` Jacco Steur
     [not found]           ` <9aaa4fcd-5dad-4278-bd37-0a1e3e4073b1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-01-17 17:10             ` Albert Krewinkel
     [not found]               ` <87y23ecmd7.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-01-17 20:59                 ` Jacco Steur
2022-01-17 17:55             ` T. Kurt Bond
     [not found]               ` <CAN1EhV9rpeD57BXHOhN8=3DBEWfMYmD4wsdkGg+Q5L4Bnr7-qw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-01-17 20:57                 ` Jacco Steur
     [not found]                   ` <CADjKMHroW1=m_XaNT+B7Mn8PU8eUc2nEp4AVA6B1fVwMr4W2Hw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-01-17 22:13                     ` T. Kurt Bond
     [not found]                       ` <CAN1EhV-8P3RK06EdJ9U3hL-AZgxE6i93BMVDc3ySn4cuYz_esg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-12 23:45                         ` Michael Hayes
     [not found]                           ` <9e1098df-5871-4650-8171-c5b1889171d7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-07-25  9:43                             ` AW: " denis.maier-NSENcxR/0n0
     [not found]                               ` <bd9382fbf7ab4205ad04f5dfd398ed5e-NSENcxR/0n0@public.gmane.org>
2022-07-27  9:18                                 ` Michael Hayes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aedaea34-387e-4726-bf36-8a34c94b3291n@googlegroups.com \
    --to=es6.mike-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).