When running pandoc from within makefiles I always do something a bit like this (where $PANDOCDIR contains my project-specific pandoc resources): LUA_PATH="$PANDOCDIR/?.lua;;" pandoc --data-dir $PANDOCDIR --resource-path $PANDOCDIR So lua utilities can be in $PANDOCDIR (perhaps I should move them to $PANDOCDIR/lua), and filters can be in $PANDOCDIR/filters. On Fri, 20 Jan 2023 at 22:07, ChrisD wrote: > I hit send too soon. I'm confusing where Pandoc looks for .lua filters > specified on the command line with where the lua interpreter looks for .lua > files that are included with require functions. Pandoc looks where the > manual says. Lua looks according to package.path. > > This is all my errors. Sorry! > > > On 1/20/2023 1:55 PM, ChrisD wrote: > > 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\\APPDATA\LOCAL\PANDOC\lua\?.lua; > C:\USERS\\APPDATA\LOCAL\PANDOC\lua\?\init.lua; > C:\USERS\\APPDATA\LOCAL\PANDOC\?.lua; > C:\USERS\\APPDATA\LOCAL\PANDOC\?\init.lua; > C:\USERS\\APPDATA\LOCAL\PANDOC\..\share\lua\5.4\?.lua; > C:\USERS\\APPDATA\LOCAL\PANDOC\..\share\lua\5.4\?\init.lua; > .\?.lua; > .\?\init.lua > > I'm surprised not to find > C:\Users\\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 wrote: > > Sorry, this is my error. > > Filters work when placed in > 1) The current working directory > 2) $DATADIR/filters > 3) /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) /lua > > The location of pandoc.exe for me is user//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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 > > . > > > -- > 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/198fb70e-dafe-517c-2ca5-f8a9342be92e%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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxj5N5ne5-EAWCeHPbeDbeeB%3DXOXTWauWx2o4JXn_QmyEg%40mail.gmail.com.