Albert Krewinkel <albert+pandoc@zeitkraut.de> writes:
> I'm not sure if it's better or worse, but we could also look for the
> reader in LUA_PATH (via `require`). Using a bit of pseudo-code:
>
> if file_exists(reader_path) then
> dofile(reader_path)
> reader = Reader
> else
> reader = require (reader_path:gsub('.lua$', ''))
> end
>
> The reader library would have to `return` the Reader function instead of
> just defining it as a global.
Probably better not to change the interface in this way.
Maybe treating these like filters is the most sensible/least
surprising thing to do.
IMO the most sensible. That way you can just clone readers/writers off GitHub without authors needing to go through the hassle of setting up a Lua rock. Having to do that will likely discourage people from publishing their code at all. Also of course templates, filters, defaults all work that way already. I have my data dir in my dropbox directory and symlink it in ~/.local/share, or rclone it on my Android devices (via Termux) where dropbox isn't a regular storage directory.
Should we have readers/ and writers/
subdirectories of user data? Or custom-readers/ custom-writers/ ?
Since they are already subdirectories of the dedicated pandoc data directory `readers/` and `writers/` should suffice. Seven characters less to type for each compared to `custom-*`.