Auto-inject embed_images filter for PDF via Typst. Otherwise
conversion fails because we can't write the images in a temporary
directory in the WASM sandbox. See jgm/pandoc#11584.
We now provide two functions: convert and query.
extensions_for_format has been dropped, as query can do the
work.
convert is what pandoc used to be.
query takes a JSON object describing the information needed,
and returns information. Currently only "extensions-for-format"
is implemented.
Also: the use of multiple main-is causes problems with cabal.
Instead, we use pandoc.hs as main throughout, but change the
hs-src-dir for wasm.
'make pandoc.wasm' will compile a wasm version of pandoc.
This also adds a 'repl' flag to pandoc-lua-engine, so that
support for a Lua repl can be disabled for the wasm build.
A new wasm directory contains:
- pandoc.js, a JavaScript wrapper for pandoc.wasm
- index.html + index.js, a web app exposing all of pandoc's
functionality in a GUI interface
- a set of illustrative examples that can be loaded from the web app
Most of the code in index.html and index.js has been produced in
interaction with Claude code.