public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Custom readers and writer paths
@ 2022-06-06 16:58 John MacFarlane
       [not found] ` <m2h74xhgpp.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2022-06-06 16:58 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


I believe that currently one must specify the path to a custom
Lua reader or writer: you can't put it in your data directory,
as you can with a Lua filter, and it won't be found in your
executable PATH.

(Is that correct, Albert?)

My question is whether we should change that.  I think it could
be quite convenient to allow custom readers and writers to be
distributed as Lua rocks.  You could then do `luarocks install
cool-pandoc-writer` and it would put `cool-writer.lua` in the
`bin` directory of your luarocks installation. Pandoc could then
be trained to look in the executable path for a custom writer
if it is not found locally.

Alternatively, we could search a custom-writers and custom-readers
subdirectory of the user data directory (as we do with filters).

It is a little cumbersome to have to copy the default
writer/reader somewhere and pass its path to pandoc.  This may
be good from a security point of view, however, as it makes it
less likely that people will blindly use custom readers/writers
from third parties, not realizing that a custom reader/writer
could in principle do just about anything on your file system.

A related question: would it be possible for pandoc to set up
the Lua environment in which custom readers/writers are run so
that it is "sandboxed," limiting I/O operations to (e.g.) a
local directory, or perhaps logging I/O operations as pandoc
warnings?

Thoughts welcome.

John


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-06 20:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-06 16:58 Custom readers and writer paths John MacFarlane
     [not found] ` <m2h74xhgpp.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2022-06-06 17:41   ` Albert Krewinkel
     [not found]     ` <874k0xpszm.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-06-06 18:38       ` John MacFarlane
     [not found]         ` <yh480kv8tdd4de.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2022-06-06 19:53           ` BPJ
     [not found]             ` <CADAJKhDdwHuvBjTCAAwrFY6RcaZ+d_FRMnkVp3MMUtntrsBdYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-06-06 20:02               ` AW: " denis.maier-NSENcxR/0n0
2022-06-06 20:19               ` John MacFarlane
2022-06-06 20:41               ` Albert Krewinkel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).