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

Look for data files of all kinds in data dir subdirectories #10251

Open
bpj opened this issue Oct 1, 2024 · 0 comments
Open

Look for data files of all kinds in data dir subdirectories #10251

bpj opened this issue Oct 1, 2024 · 0 comments

Comments

@bpj
Copy link

bpj commented Oct 1, 2024

Describe the problem

Currently Pandoc supports looking for data files in the directories

  • $DATADIR/filters
  • $DATADIR/defaults
  • $DATADIR/metadata
  • $DATADIR/templates
  • $DATADIR/csl

but the following potentially equally useful data subdirectories are not currently supported:

  • $DATADIR/reference-docs

  • $DATADIR/abbreviations

  • $DATADIR/highlight

  • $DATADIR/includes

  • $DATADIR/bibliographies

Notes to the above list:

  • †: for both highlighting styles and syntax definitions

  • ‡: for both header and body includes

so I wonder if there are any reasons not to support any or all of these, and similarly for other kinds of data files which may be added in the future and/or I have missed above.

Some reasons why this may be a good idea:

  • Consistency with those already supported.
  • Otherwise there is a strong incentive to just drop everything into the root of $DATADIR which is messy and hard to maintain.
  • Ease of (local) deployment:
    • You can have people put everything in the appropriate subdirectories (or put them there for them)1
    • People can then use simple file names on the command line, without having to remember/be told that they have to use a full path in some cases but not in others. (This last is an issue even if you have a predefined environment variable PANDOC_DATADIR vel sim. or use ${USERDATA} in a defaults file!)
    • Having separate directories makes it easier to use a consistent naming scheme for example for a filter and a related reference doc.

Alternative solutions

Tell people/train yourself to consistently using a predefined prefix environment variable like the above-mentioned PANDOC_DATADIR, and ${USERDATA} in defaults files. This shouldn’t really be necessary.

Related

P.S.

I hope implementing this for all kinds of data files makes it easier rather than harder to implement!
Unfortunately I can't see myself learning Haskell, so I depend on people's good will to implement it.

Footnotes

  1. In most (all?) modern GUIs you can just drop a directory containing properly named subdirectories on the user data directory and they will be automatically merged.

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

1 participant