public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Using lfs in Pandoc filter (for scanning directories)
Date: Thu, 14 Jul 2022 15:35:35 +0200	[thread overview]
Message-ID: <87cze7g5ud.fsf@zeitkraut.de> (raw)
In-Reply-To: <0b03f580-ac49-4589-98a5-c955514dbab0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

Hi Claudio,

Claudio Di Vita <claudio.divita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> I created a Docker image from pandoc/latex (the Ubuntu version) to run
> my pandoc conversions, thus developing some custom filters.
>
> Due to new requirements, within a filter I need to scan directories and
> looking for files. I would use lfs (installing it via luarocks) but I'm
> wondering how I can use it with pandoc.
>
> Should I install lua separately within my custom Docker image and
> instructs pandoc to use such version ?

We build the image such that you can simply use the Ubuntu package
manager to install Lua libraries. E.g., for lfs, try this:

```
RUN apt-get -q --no-allow-insecure-repositories update \
  && DEBIAN_FRONTEND=noninteractive \
     apt-get install --assume-yes lua-filesystem
  && rm -rf /var/lib/apt/lists/*
```

The pandoc versions in our images are built against the system's Lua
library, so any system-wide Lua package can be used with pandoc.

> Any other suggestions on how to scan directories from a Lua filter ? I
> could run a find through pandoc.pipe, but then I have to parse the
> output and, in general, looks like a dirty solution.

We could think about making more functions from
[hslua-module-system](https://github.com/hslua/hslua/hslua-module-system)
available in the `pandoc.system` module. See also the discussion in
https://github.com/jgm/pandoc/pull/5468

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


  parent reply	other threads:[~2022-07-14 13:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 10:40 Claudio Di Vita
     [not found] ` <0b03f580-ac49-4589-98a5-c955514dbab0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-07-14 13:35   ` Albert Krewinkel [this message]
     [not found]     ` <87cze7g5ud.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-07-15 15:29       ` Claudio Di Vita

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=87cze7g5ud.fsf@zeitkraut.de \
    --to=albert+pandoc-9eawchwdxg8hfhg+jk9f0w@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).