All relative paths are processed relatively to the working directory.
Relative path in a document (main source file) are obviously relative to the directory of this document.
So the filter works only if the working directory (from which the pandoc command is run) is the directory where the main document is stored.
This should be easily fixed if we could access to the sourcefile variable set by Pandoc (see Pandoc's manual).
I was not able to figure out how it can be accessed from a lua filter.
NB1. I suspect the same restriction applies to include-code-files.lua
NB2. With this restriction we can not even build clean test cases with all files stored in a test subdirectory
All relative paths are processed relatively to the working directory.
Relative path in a document (main source file) are obviously relative to the directory of this document.
So the filter works only if the working directory (from which the
pandoccommand is run) is the directory where the main document is stored.This should be easily fixed if we could access to the
sourcefilevariable set by Pandoc (see Pandoc's manual).I was not able to figure out how it can be accessed from a lua filter.
NB1. I suspect the same restriction applies to
include-code-files.luaNB2. With this restriction we can not even build clean test cases with all files stored in a test subdirectory