I researched this a little more. The lua "require" function searches paths using
    global variable LUA_PATH
    environment variable LUA_PATH      
    a fixed path which is "easy to change when you compile lua"

I do not have either of the LUA_PATH values set.

Inside the interpreter, the search path is contained in package.path.
On my win 10/pandoc 3.0 install, package.path contains this string (I have split it across lines to be more readable):
    C:\USERS\<username>\APPDATA\LOCAL\PANDOC\lua\?.lua;
    C:\USERS\<username>\APPDATA\LOCAL\PANDOC\lua\?\init.lua;
    C:\USERS\<username>\APPDATA\LOCAL\PANDOC\?.lua;
    C:\USERS\<username>\APPDATA\LOCAL\PANDOC\?\init.lua;
    C:\USERS\<username>\APPDATA\LOCAL\PANDOC\..\share\lua\5.4\?.lua;
    C:\USERS\<username>\APPDATA\LOCAL\PANDOC\..\share\lua\5.4\?\init.lua;
    .\?.lua;
    .\?\init.lua

I'm surprised not to find
    C:\Users\<username>\AppData\Roaming\pandoc\filters
in that list.

But it looks like (3) is enabled by the first line of package.path. I have no clue how that gets set.






On 1/20/2023 1:25 PM, John MacFarlane wrote:
Manual definitely covers both 1 and 2: it says

In order of preference, pandoc will look for Lua filters in

• a specified full or relative path,

• $DATADIR/filters where $DATADIR is the user data directory (see --data-dir, above).

I wouldn’t expect 3 to work.  If it does, that’s quite unexpected.  Can anyone else reproduce this?


On Jan 20, 2023, at 9:14 AM, ChrisD <cd34-gg@intielectronics.com> wrote:

Sorry, this is my error.

Filters work when placed in
1) The current working directory
2) $DATADIR/filters
3) <Location of pandoc.exe>/lua

So the manual is correct, though it only specifies (2), not (1) or (3).

Sorry for the noise.


On 1/20/2023 9:47 AM, ChrisD wrote:
What is the correct location for lua filters?

The pandoc manual says it will search for lua filters in $DATADIR/filters. However that doesn't work for me on Windows. What does work is:

1) The current working directory
2) $DATADIR/lua
3) <Location of pandoc.exe>/lua

The location of pandoc.exe for me is user/<username>/AppData/Local/Pandoc. This is on my path.

Is this an error in the manual, or do I have something configured wrong? It seems to me I must have read somewhere to use the lua sub-directory, but I can't find it anywhere online now.


-- 
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1f6a4484-4173-21b9-efcc-d7cd3867d4f7%40intielectronics.com.

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1B880D38-AC8E-40B2-A4D1-15B534F81C6F%40gmail.com.

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9c6e0ddc-b18d-205f-0868-3eb1498848f4%40intielectronics.com.