Description
Consider the following directory layout:
├── datadir
│ └── templates
│ └── my-templates
│ └── my-template.html
│ └── defaults
├── my-template.html
├── my-defaults.yaml
Standing at the root of this layout, pandoc --data-dir=datadir --defaults=../../my-defaults.yaml
will load my-defaults.yaml
from outside of the user directory $DATADIR
. This might be the case for other file types too.
On the other hand, pandoc --data-dir=datadir --template=../../my-template.html
will not load my-template.html
. Neither will pandoc --data-dir=datadir --template=my-templates/my-template.html
. Templates loaded from under $DATADIR
must lie in $DATADIR/templates
and may not lie in subdirectories of $DATADIR/templates
. This might be the case for other file types too.
This is inconsistent and pandoc should either:
- Allow any files to be loaded outside of
$DATADIR
. - Only allow files in a set subdirectory of
$DATADIR
to be loaded. - Only allow files in subdirectories of a set subdirectory of
$DATADIR
to be loaded.
Here, "a set subdirectory" could be ./
, depending on the file type.
Related: #5987
pandoc 2.14.0.3 on NixOS