pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

PandocMonad: allow nested data files

Open tarleb opened this issue 2 years ago • 2 comments

Data file fallbacks are now also searched in the directory that has the same name as the file minus the extension. For example, a filter with name frob.lua will be searched in $DATADIR/filters/frob.lua as well as in $DATADIR/filters/frob/frob.lua.

This allows to place full git repositories in the data directory.

Closes: #6635

tarleb avatar May 04 '23 10:05 tarleb

I'm on the fence about this. I see how it meets a need in the case of filters, but (a) it's slightly "magic" in the way it derives the directory name and (b) it applies to all data files, not just filters.

A narrower intervention would do this just for filters.

I'm just not sure what's best, hence the delay in merging this!

jgm avatar Jun 22 '23 22:06 jgm

A narrower intervention would do this just for filters.

I'm just not sure what's best, hence the delay in merging this!

I wonder if we could downscope it to just the filters for now, and then if a need arises for other things in future, then it could be expanded to those when an appropriate use case is presented?

0xdevalias avatar Jan 13 '25 03:01 0xdevalias

I think my thoughts back when I opened this were that this would also enable (or rather, simulate) "packages" in the sense that templates, filter, etc. could all be placed in a directory together with a defaults file. It would be easier to call -d package than -d package/package.

Now I tend to think that it might be better to invest the time into a proper package system to bundle files into a package. I think that would mostly serve the same use-case as this PR.

tarleb avatar Aug 07 '25 17:08 tarleb

See also the discussion in #10874. The consensus there seemed to be that frob/init.lua would be most idiomatic. I still plan to submit a PR for that at some stage.

rnwst avatar Aug 07 '25 23:08 rnwst