Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bpj opened this issue Oct 1, 2024 · 1 comment
Open

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

bpj opened this issue Oct 1, 2024 · 1 comment

Comments

@bpj
Copy link

bpj commented Oct 1, 2024

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

@bpj bpj added the enhancement label Oct 1, 2024
@jgm
Copy link
Owner

jgm commented Oct 2, 2024

The user data directory is already "local," in the sense that it provides the opportunity to override system defaults. So, what you're proposing is having three layers -- the system defaults, the user data directory, and a super-local data directory.

This would add a lot of complexity.

One solution you didn't mention:

  • use symlinks in the custom data directory to link back to the regular data directory for things that are needed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants