public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Using lua filter include-files on pandoc 2.5 does not work
@ 2022-01-17  7:48 ` Jacco Steur
       [not found]   ` <091e1142-2cf5-40f0-a0f4-1c6a2bd0af4bn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Jacco Steur @ 2022-01-17  7:48 UTC (permalink / raw)
  To: pandoc-discuss


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

My goal is debugging LUA filters with the zerobrane ide.

I got stuck on this:

On Ubuntu I installed pandoc 2.5 using sudo apt install pandoc.
After that I cloned the lua filter repository 
(https://github.com/pandoc/lua-filters)
When I run the pandoc commmand like so:

>pandoc --lua-filter=include-files.lua sample.md --output result.html
(
This lua filter requires this:
local List = require 'pandoc.List'
local path = require 'pandoc.path'
local system = require 'pandoc.system'
)

I get this error:
include-files.lua:10: module 'pandoc.path' not found:no file 
'pandoc.path.lua' in pandoc's datadir
        no field package.preload['pandoc.path']
        no file '/usr/local/share/lua/5.3/pandoc/path.lua'
        no file '/usr/local/share/lua/5.3/pandoc/path/init.lua'
        no file '/usr/local/lib/lua/5.3/pandoc/path.lua'
        no file '/usr/local/lib/lua/5.3/pandoc/path/init.lua'
        no file './pandoc/path.lua'
        no file './pandoc/path/init.lua'
        no file '/usr/local/lib/lua/5.3/pandoc/path.so'
        no file '/usr/local/lib/lua/5.3/loadall.so'
        no file './pandoc/path.so'
        no file '/usr/local/lib/lua/5.3/pandoc.so'
        no file '/usr/local/lib/lua/5.3/loadall.so'
        no file './pandoc.so'
stack traceback:
        [C]: in function 'require'
        include-files.lua:10: in main chunk

After some research I found that there is a directory 
/usr/share/pandoc/data.

The contents of this directory contains the lua files:
init.lua  pandoc.List.lua  pandoc.lua  sample.lua

There is no pandoc.path.lua.....

So pandoc is not checking /usr/share/pandoc/data and even if I set LUA_PATH 
like so:
>export LUA_PATH=/usr/share/?/?.lua
It gives me this error:
Error running filter include-files.lua:
include-files.lua:10: module 'pandoc.path' not found:no file 
'pandoc.path.lua' in pandoc's datadir
        no field package.preload['pandoc.path']
        no file '/usr/share/pandoc/path/pandoc/path.lua'
        no file '/usr/local/lib/lua/5.3/pandoc/path.so'
        no file '/usr/local/lib/lua/5.3/loadall.so'
        no file './pandoc/path.so'
        no file '/usr/local/lib/lua/5.3/pandoc.so'
        no file '/usr/local/lib/lua/5.3/loadall.so'
        no file './pandoc.so'
stack traceback:
        [C]: in function 'require'
        include-files.lua:10: in main chunk
 
What am I doing wrong here......
 



-- 
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/091e1142-2cf5-40f0-a0f4-1c6a2bd0af4bn%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using lua filter include-files on pandoc 2.5 does not work
       [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>
  0 siblings, 1 reply; 11+ messages in thread
From: Albert Krewinkel @ 2022-01-17 12:05 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw; +Cc: Jacco Steur


Jacco Steur <jacco.steur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> My goal is debugging LUA filters with the zerobrane ide.
>
> I got stuck on this:
>
> On Ubuntu I installed pandoc 2.5 using sudo apt install pandoc.
>
> [...]
>
> What am I doing wrong here......

You are doing everything right, it's just that the pandoc version
shipped by Ubuntu is too old for this. The `pandoc.path` module is a
relatively recent addition that became available in pandoc 2.12,
released about a year ago. You can install a current version with the
help of the *deb* packages published on the official pandoc release
page: https://github.com/jgm/pandoc/releases/latest

Alternatively, you could use a Docker image that suits your needs, e.g.,
<https://hub.docker.com/r/pandoc/core>, but the .deb installer is
probably easier.

HTH,
Albert

PS: This is also a shortcoming of the filter: it would be better if the
  filter was checking the pandoc version, returning a meaningful error
  message if the version is too old. I'll go and fix that.

-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using lua filter include-files on pandoc 2.5 does not work
       [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>
  0 siblings, 1 reply; 11+ messages in thread
From: Jacco Steur @ 2022-01-17 16:14 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi Albert,

Thanks for the swift response. That did the trick. I am amble to run the 
include-file filter now.

The next thing is that I run into this issue:
:~/workspace/lua-filters/include-files$ ./run-it.sh 
Error running filter include-files.lua:
error loading module 'socket.core' from file 
'/opt/zbstudio/bin/linux/x64/clibs53/socket/core.so':
        *Dynamic loading not supported*
stack traceback:
        [C]: in ?
        [C]: in function 'require'
        /opt/zbstudio/lualibs/socket.lua:12: in main chunk
        [C]: in function 'require'
        /opt/zbstudio/lualibs/mobdebug/mobdebug.lua:102: in main chunk
        [C]: in function 'require'
        include-files.lua:13: in main chunk

I do the following... I set my variables like so:
export ZBS=/opt/zbstudio
export LUA_PATH="./?.lua;$ZBS/lualibs/?/?.lua;$ZBS/lualibs/?.lua"
export LUA_CPATH="$ZBS/bin/linux/x64/?.so;$ZBS/bin/linux/x64/clibs53/?.so"

My architecture is:
$ uname -i
x86_64

pandoc uses LUA5.3

There is some remark in the troubleshooting section about dynamic libraries 
not enabled:
"

   - 
   
   *I get dynamic libraries not enabled error.* You may get the following 
   error when loading socket.core on Linux: *error loading module 
   ‘socket.core’ from file ‘/opt/zstudio/bin/linux/x86/clibs/socket/core.so’: 
   dynamic libraries not enabled; check your Lua installation*. This most 
   likely means that the Lua interpreter you are using was built 
   without LUA_USE_DLOPEN option enabled. You can either enable it or 
   statically link your application with luasocket.
   
"
I am using the lua that comes with the debugger and pandoc. The 
troubleshooting section does not really give a pointer where to go next. 
What could this be?




On Monday, 17 January 2022 at 13:06:00 UTC+1 Albert Krewinkel wrote:

>
> Jacco Steur <jacco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > My goal is debugging LUA filters with the zerobrane ide.
> >
> > I got stuck on this:
> >
> > On Ubuntu I installed pandoc 2.5 using sudo apt install pandoc.
> >
> > [...]
> >
> > What am I doing wrong here......
>
> You are doing everything right, it's just that the pandoc version
> shipped by Ubuntu is too old for this. The `pandoc.path` module is a
> relatively recent addition that became available in pandoc 2.12,
> released about a year ago. You can install a current version with the
> help of the *deb* packages published on the official pandoc release
> page: https://github.com/jgm/pandoc/releases/latest
>
> Alternatively, you could use a Docker image that suits your needs, e.g.,
> <https://hub.docker.com/r/pandoc/core>, but the .deb installer is
> probably easier.
>
> HTH,
> Albert
>
> PS: This is also a shortcoming of the filter: it would be better if the
> filter was checking the pandoc version, returning a meaningful error
> message if the version is too old. I'll go and fix that.
>
> -- 
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
>

-- 
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/9aaa4fcd-5dad-4278-bd37-0a1e3e4073b1n%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using lua filter include-files on pandoc 2.5 does not work
       [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 17:55             ` T. Kurt Bond
  1 sibling, 1 reply; 11+ messages in thread
From: Albert Krewinkel @ 2022-01-17 17:10 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Oh, right. The official `deb` contains a static binary. This has the
advantage that it runs on all (Linux) systems, but the disadvantage is
the one you are seeing: it's not possible to dynamically load share
libraries.

You could try to replace the binary with the one in the
pandoc/minimal:latest-ubuntu Docker image. I don't have time now, but I
can try to write a step-by-step instruction tomorrow in case you run
into issues there.

Cheers,
Albert

-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using lua filter include-files on pandoc 2.5 does not work
       [not found]           ` <9aaa4fcd-5dad-4278-bd37-0a1e3e4073b1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2022-01-17 17:10             ` Albert Krewinkel
@ 2022-01-17 17:55             ` T. Kurt Bond
       [not found]               ` <CAN1EhV9rpeD57BXHOhN8=3DBEWfMYmD4wsdkGg+Q5L4Bnr7-qw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 11+ messages in thread
From: T. Kurt Bond @ 2022-01-17 17:55 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]

Hi,  Jacco.

 I have found that using the homebrew package manager  -- https://brew.sh/
-- on Linux and macOS makes having an up-to-date version of pandoc very
easy, and I just tried the include-files.lua filter with your command line

pandoc --lua-filter=include-files.lua sample.md --output result.html


using the homebrew installed pandoc (version 2.17.0.1) on Fedora 34 and it
worked fine there.  I use homebrew on an Ubuntu box at work, and although
I've not tried this specific example on that machine, the other things use
pandoc for work fine there.

-- 
T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io

-- 
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/CAN1EhV9rpeD57BXHOhN8%3D3DBEWfMYmD4wsdkGg%2BQ5L4Bnr7-qw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 2013 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using lua filter include-files on pandoc 2.5 does not work
       [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>
  0 siblings, 1 reply; 11+ messages in thread
From: Jacco Steur @ 2022-01-17 20:57 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]

Hi Kurt,

I have the filter exammmple working as wel using the deb package. I also
need it on macos so thanks for that tip.
I also want to get it working with zerobrane debugger. I think that really
makes sense when writing a custom fillter.

Do you have experience with zerobrane or any other pandoc lua filter
debugger?

Jacco.

On Mon, 17 Jan 2022 at 18:55, T. Kurt Bond <tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Hi,  Jacco.
>
>  I have found that using the homebrew package manager  -- https://brew.sh/
> -- on Linux and macOS makes having an up-to-date version of pandoc very
> easy, and I just tried the include-files.lua filter with your command line
>
> pandoc --lua-filter=include-files.lua sample.md --output result.html
>
>
> using the homebrew installed pandoc (version 2.17.0.1) on Fedora 34 and it
> worked fine there.  I use homebrew on an Ubuntu box at work, and although
> I've not tried this specific example on that machine, the other things use
> pandoc for work fine there.
>
> --
> T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io
>
> --
> 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/CAN1EhV9rpeD57BXHOhN8%3D3DBEWfMYmD4wsdkGg%2BQ5L4Bnr7-qw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CAN1EhV9rpeD57BXHOhN8%3D3DBEWfMYmD4wsdkGg%2BQ5L4Bnr7-qw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Jacco Steur

-- 
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/CADjKMHroW1%3Dm_XaNT%2BB7Mn8PU8eUc2nEp4AVA6B1fVwMr4W2Hw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 3687 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using lua filter include-files on pandoc 2.5 does not work
       [not found]               ` <87y23ecmd7.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2022-01-17 20:59                 ` Jacco Steur
  0 siblings, 0 replies; 11+ messages in thread
From: Jacco Steur @ 2022-01-17 20:59 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]

Hi Albert,

I have docker installed on my dev box so I should be able to extract it. If
I can not manage I will let you know. I saw that the Dockerfile is creating
the pandoc binaries from scratch.

Hopefully the binary works then using the zerobrane debugger.

Jacco.

On Mon, 17 Jan 2022 at 18:18, Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
wrote:

> Oh, right. The official `deb` contains a static binary. This has the
> advantage that it runs on all (Linux) systems, but the disadvantage is
> the one you are seeing: it's not possible to dynamically load share
> libraries.
>
> You could try to replace the binary with the one in the
> pandoc/minimal:latest-ubuntu Docker image. I don't have time now, but I
> can try to write a step-by-step instruction tomorrow in case you run
> into issues there.
>
> Cheers,
> Albert
>
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124
>
> --
> 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/87y23ecmd7.fsf%40zeitkraut.de
> .
>


-- 
Jacco Steur

-- 
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/CADjKMHoFFftoNZxHH%3D_fpbvN%2BJnQz5LEjfpz6df8zKX%3DeqN5FA%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 2857 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using lua filter include-files on pandoc 2.5 does not work
       [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>
  0 siblings, 1 reply; 11+ messages in thread
From: T. Kurt Bond @ 2022-01-17 22:13 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 3161 bytes --]

Unfortunately, I don't have any experience with zerobrane or other lua
filter debuggers.  Something that I should look into.

On Mon, Jan 17, 2022 at 3:57 PM Jacco Steur <jacco.steur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Hi Kurt,
>
> I have the filter exammmple working as wel using the deb package. I also
> need it on macos so thanks for that tip.
> I also want to get it working with zerobrane debugger. I think that really
> makes sense when writing a custom fillter.
>
> Do you have experience with zerobrane or any other pandoc lua filter
> debugger?
>
> Jacco.
>
> On Mon, 17 Jan 2022 at 18:55, T. Kurt Bond <tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> Hi,  Jacco.
>>
>>  I have found that using the homebrew package manager  --
>> https://brew.sh/ -- on Linux and macOS makes having an up-to-date
>> version of pandoc very easy, and I just tried the include-files.lua filter
>> with your command line
>>
>> pandoc --lua-filter=include-files.lua sample.md --output result.html
>>
>>
>> using the homebrew installed pandoc (version 2.17.0.1) on Fedora 34 and
>> it worked fine there.  I use homebrew on an Ubuntu box at work, and
>> although I've not tried this specific example on that machine, the other
>> things use pandoc for work fine there.
>>
>> --
>> T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io
>>
>> --
>> 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/CAN1EhV9rpeD57BXHOhN8%3D3DBEWfMYmD4wsdkGg%2BQ5L4Bnr7-qw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/CAN1EhV9rpeD57BXHOhN8%3D3DBEWfMYmD4wsdkGg%2BQ5L4Bnr7-qw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> Jacco Steur
>
> --
> 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/CADjKMHroW1%3Dm_XaNT%2BB7Mn8PU8eUc2nEp4AVA6B1fVwMr4W2Hw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CADjKMHroW1%3Dm_XaNT%2BB7Mn8PU8eUc2nEp4AVA6B1fVwMr4W2Hw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io

-- 
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/CAN1EhV-8P3RK06EdJ9U3hL-AZgxE6i93BMVDc3ySn4cuYz_esg%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 5363 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using lua filter include-files on pandoc 2.5 does not work
       [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>
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Hayes @ 2022-07-12 23:45 UTC (permalink / raw)
  To: pandoc-discuss


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

I've been using VSCode with the local lua debugger extension to debug 
pandoc lua filters, and it works great.

On Monday, 17 January 2022 at 22:13:33 UTC tkur...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:

> Unfortunately, I don't have any experience with zerobrane or other lua 
> filter debuggers.  Something that I should look into.
>
> On Mon, Jan 17, 2022 at 3:57 PM Jacco Steur <jacco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> Hi Kurt,
>>
>> I have the filter exammmple working as wel using the deb package. I also 
>> need it on macos so thanks for that tip.
>> I also want to get it working with zerobrane debugger. I think that 
>> really makes sense when writing a custom fillter.
>>
>> Do you have experience with zerobrane or any other pandoc lua filter 
>> debugger?
>>
>> Jacco.
>>
>> On Mon, 17 Jan 2022 at 18:55, T. Kurt Bond <tkur...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>>> Hi,  Jacco.
>>>
>>>  I have found that using the homebrew package manager  -- 
>>> https://brew.sh/ -- on Linux and macOS makes having an up-to-date 
>>> version of pandoc very easy, and I just tried the include-files.lua filter 
>>> with your command line 
>>>
>>> pandoc --lua-filter=include-files.lua sample.md --output result.html
>>>
>>>
>>> using the homebrew installed pandoc (version 2.17.0.1) on Fedora 34 and 
>>> it worked fine there.  I use homebrew on an Ubuntu box at work, and 
>>> although I've not tried this specific example on that machine, the other 
>>> things use pandoc for work fine there.
>>>
>>> -- 
>>> T. Kurt Bond, tkur...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io
>>>
>>> -- 
>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/pandoc-discuss/CAN1EhV9rpeD57BXHOhN8%3D3DBEWfMYmD4wsdkGg%2BQ5L4Bnr7-qw%40mail.gmail.com 
>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAN1EhV9rpeD57BXHOhN8%3D3DBEWfMYmD4wsdkGg%2BQ5L4Bnr7-qw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> Jacco Steur
>>
>> -- 
>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/CADjKMHroW1%3Dm_XaNT%2BB7Mn8PU8eUc2nEp4AVA6B1fVwMr4W2Hw%40mail.gmail.com 
>> <https://groups.google.com/d/msgid/pandoc-discuss/CADjKMHroW1%3Dm_XaNT%2BB7Mn8PU8eUc2nEp4AVA6B1fVwMr4W2Hw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> T. Kurt Bond, tkur...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io
>

-- 
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/9e1098df-5871-4650-8171-c5b1889171d7n%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* AW: Using lua filter include-files on pandoc 2.5 does not work
       [not found]                           ` <9e1098df-5871-4650-8171-c5b1889171d7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-07-25  9:43                             ` denis.maier-NSENcxR/0n0
       [not found]                               ` <bd9382fbf7ab4205ad04f5dfd398ed5e-NSENcxR/0n0@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: denis.maier-NSENcxR/0n0 @ 2022-07-25  9:43 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 3568 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Using lua filter include-files on pandoc 2.5 does not work
       [not found]                               ` <bd9382fbf7ab4205ad04f5dfd398ed5e-NSENcxR/0n0@public.gmane.org>
@ 2022-07-27  9:18                                 ` Michael Hayes
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Hayes @ 2022-07-27  9:18 UTC (permalink / raw)
  To: pandoc-discuss


[-- 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 --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-07-27  9:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AQHYlkmLQSWBnyserE2AdkoYSfVyWa2O6UgA>
2022-01-17  7:48 ` Using lua filter include-files on pandoc 2.5 does not work 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 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).