public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "'William Lupton' via pandoc-discuss" <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Directories for lua filters
Date: Sat, 21 Jan 2023 11:44:12 +0000	[thread overview]
Message-ID: <CAEe_xxj5N5ne5-EAWCeHPbeDbeeB=XOXTWauWx2o4JXn_QmyEg@mail.gmail.com> (raw)
In-Reply-To: <198fb70e-dafe-517c-2ca5-f8a9342be92e-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org>

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

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 <cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org> 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\<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-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org> 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-/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
> <https://groups.google.com/d/msgid/pandoc-discuss/1B880D38-AC8E-40B2-A4D1-15B534F81C6F%40gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
> --
> 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
> <https://groups.google.com/d/msgid/pandoc-discuss/9c6e0ddc-b18d-205f-0868-3eb1498848f4%40intielectronics.com?utm_medium=email&utm_source=footer>
> .
>
>
> --
> 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
> <https://groups.google.com/d/msgid/pandoc-discuss/198fb70e-dafe-517c-2ca5-f8a9342be92e%40intielectronics.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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.

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

      parent reply	other threads:[~2023-01-21 11:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 16:47 ChrisD
     [not found] ` <69d75ee2-5140-4415-2da7-aef9ff91df5f-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org>
2023-01-20 17:14   ` ChrisD
     [not found]     ` <1f6a4484-4173-21b9-efcc-d7cd3867d4f7-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org>
2023-01-20 20:25       ` John MacFarlane
     [not found]         ` <1B880D38-AC8E-40B2-A4D1-15B534F81C6F-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-01-20 20:55           ` ChrisD
     [not found]             ` <9c6e0ddc-b18d-205f-0868-3eb1498848f4-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org>
2023-01-20 22:07               ` ChrisD
     [not found]                 ` <198fb70e-dafe-517c-2ca5-f8a9342be92e-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org>
2023-01-21 11:44                   ` 'William Lupton' via pandoc-discuss [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='CAEe_xxj5N5ne5-EAWCeHPbeDbeeB=XOXTWauWx2o4JXn_QmyEg@mail.gmail.com' \
    --to=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).