-
-
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
[Enhancement] Search for filters/lua-filters within sub-directories of $DATADIR/filters #6635
Comments
Hi, what would happen If you have two files with the same name under different sub-folders ? |
Hi, @argent0. Prosody uses very simple logic: if you ask it to load So, to answer your question, as per my proposed logic, Pandoc would only recognize a file if it is either in the base directory, or in a sub-directory with the same name as the file. [1]: For simplicity's sake, I'm discounting the optional "mod_" that Prosody uses for identifying modules. For the exact code, see the link I've provided to "pluginloader.lua". |
I'm sympathetic with the request, it would make using the lua-filters repo much easier. However, I'm wary of the complexity that comes with such a feature, so I lean towards treating it as out of scope for pandoc. |
Data file fallbacks are now also searched in the directory that has the same name as the file minus the extension. For example, a filter with name `frob.lua` will be searched in `$DATADIR/filters/frob.lua` as well as in `$DATADIR/filters/frob/frob.lua`. This allows to place full git repositories in the data directory. Closes: jgm#6635
I've changed my stance on this and opened #8822. My reasoning is that I'd rather see people use symbolic links to the filter file; however, Windows doesn't work that well with symbolic links, and even on posix it's often convenient to simply place a fulle git subtrees in the data dir. |
Problem:
Currently, if a lua-filter (say
wordcount.lua
) is at$DATADIR/filters/wordcount.lua
, things work fine. But if it is in$DATADIR/filters/wordcount/wordcount.lua
, then thepandoc
command is unable to locate it.Commands:
Expected:
Actual Output:
Workaround:
The relevant code seems to be in this file:
pandoc/src/Text/Pandoc/Filter/Path.hs
Lines 22 to 35 in 93e3d46
Please close this issue if it isn't worth changing, since the "workaround" works well enough. However, some software (for instance
prosody
wrt to it modules) would allow you to refer to "wordcount/wordcount.lua" as "wordcount" (dropping both the directory name as well as.lua
, as that's the extension it would be looking for).The text was updated successfully, but these errors were encountered: