-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Lua filters: add make_relative_path to pandoc.system module #6001
Comments
There is an interesting difficulty to this: The See the make-relative-path branch in https://github.com/hslua/hslua-module-system for an (unfinished) implementation using that function. |
Pardon me for ignoring this for the last few weeks. I think the function would be substantially less useful without the ability to produce |
I did not introduce I think one should never resolve symlinks while processing paths in markdown. Symlinks are on filesystem level to help the operating system user. Also, when we write markdown we have almost in all cases a base folder |
@gabyx Since there's some additional complexity that I didn't account for in the original issue I think it's reasonable to omit this from As for the original use-case, I wanted pandoc to generate HTML with relativized links for a web site, so that I could relocate the site root in the filesystem without updating a bunch of pages with the changed absolute paths. |
I think you are describing a common usecase, so I'd like to keep this open. |
Is there any progress :). Would it be possible to integrate at least #6565 |
@jgm voiced the concern that too many Lua modules will prove unmaintainable, and I agree. From my point of view, this is what needs to be done:
The first point is up to @jgm. The second, third, and probably fourth points are all mine, but honestly not very high on my list. Realistically, this won't see progress anytime soon, unless the mentioned projects all suddenly experience a flood of high-quality pull requests. |
@tarleb suggested that I open a feature request here to add a
make_relative_path
function to thepandoc.system
Lua submodule, after I implemented something similar for a filter. The prototype would be something likeI used
realpath
from the GNU coreutils to do this, but it could be accomplished more portably in the parent module.My use-case for this is that I had HTML output in mind for my filter, and I wanted filter-generated files to be linked in the output document with relative paths.
ETA: I'm happy to work on implementing this if it's judged a good idea.
ETA again: actually, since it looks like all the existing
pandoc.system
Lua functions are borrowed fromhslua-module-system
, perhaps it makes sense to do the same here?The text was updated successfully, but these errors were encountered: