Closed gabyx closed 3 years ago
The next pandoc version, probably either 2.11.4.1 or 2.11.5, will ship a new Lua module pandoc.path
with the necessary functions. We should think about adding additional functions to that module, like canonicalize
, but I'd expect it to be good enough for now.
Because of filters as
lilypond
andinlcude-files
we need path manipulation utilities.We need the PR from pandoc and another Lua implementation
make_relative
function.The function
make_relative
could be a pure path computation, no filesystem needed. (no symlinks resolving, its probably not needed in a filter context...)This implementation should be provided in hslua-system-module with for example a copy-implementation of
makeRelativeEx
Lilipond:
replace
realpath
anddirname
in lilypond withmake_relative
and [PR](https://github.com/jgm/pandoc/pull/6565 If the working dir is/a/b/c
and the image directory/imagedir
andrelativize
is enabled, an image/imagedir/img
would resolve into../../../imagedir/img
. https://github.com/pandoc/lua-filters/blob/1c553017ecc58914c22bf2372902dca4a456929b/lilypond/lilypond.lua#L109