Hackage rejected the previous version, though it worked fine.
The problem was that with two pandoc.hs files in different
directories, one of them wasn't being included in the sdist tarball.
To work around this, put the WASM exported functions in a
library module that is conditionally imported.
This is out of the pandoc-cli source directory, but it is
relevant only to pandoc-cli, not pandoc. In any case, it doesn't
help to have it in the tarball, because the build is only possible
with the provided cabal.project.
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.
Text.Pandoc.App.CommandLineOptions and pandoc-cli/src/pandoc.hs
had similar code for generating version information.
To avoid duplication, we now export `versionInfo` from
Text.Pandoc.App [API change]. (The function is reexported from the
non-public module Text.Pandoc.App.CommandLineOptions.) This function
has three parameters that can be filled in when it is called by
pandoc-cli.
This change will make it simpler to revise version information.
Export `copyrightMessage` from the unexported module
Text.Pandoc.App.CommandLineOptions
and reexport from Text.Pandoc.App [API change].
This avoids the need for a duplicated version in pandoc-cli, which can
now depend on the library's exported version.