pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Local data dir(s) at a higher precedence than `--data-dir`

Open bpj opened this issue 1 year ago • 1 comments

The problem

The --data-dir option is useful, but its overriding the default user data directory is often a problem, since you may want to use files both from a custom data directory and the default directory, particularly filters and defaults files.

Proposed solution

I think the best solution is a command line/defaults file option --local-data-dir used to specify one or more directories (with appropriate subdirectories) where Pandoc will look for data files after looking in the current directory but before looking in the --data-dir. (preferably repeatable)

Alternative solutions

  • Keep everything in the current directory. :-( This is not only messy but is suboptimal for example if you have a filters etc. which you want to be able to use from different places in a directory tree, but still cannot or don’t want to keep in the default data directory, e.g. if they have standardized (short) names.
  • Use long paths repeatedly on the command line. :-(
  • Use custom prefix environment variables (which need to be defined per session and/or on several accounts/machines and cannot be used in defaults files.
  • Look for directories with a certain name, say pandoc-data in the current directory and its ancestors. This approach has its own well-known problems!

Related

  • #10251
  • #10252

bpj avatar Oct 01 '24 17:10 bpj