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.
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.
The Lua interpreter no longer terminates when called with `-v` or
`--version` arguments, thus improving compatibility with the default
`lua` interpreter program.
In 3.1.5 boolean arguments were allowed an optional argument
(true|false). This created a regression for uses of fused
short arguments, e.g. `-somyfile.html`, which was equivalent
to `-s -omyfile.html`, but now raised an error because
pandoc attempted to parse `o` as a boolean `true` or `false`.
This change adds a preprocessing step on the raw arguments
before they are sent to the option parser. In this preprocessing
step, `-somyfile.html` would be split into two arguments,
`-s` and `-omyfile.html`. The splitting happens when a
short boolean option is followed by another short option.
Closes#8956.
They now return `Either OptInfo Opt`.
Add `OptInfo` type.
Add `handleOptInfo` function. This performs the IO actions for
things like `--version` that were previously done in `parseOptionsFromArgs`.
An argument for a `ScriptingEngine` has been added, to facilitate
printing custom templates and custom extensions for Lua filters.
(However, at this stage nothing is yet done with it.)
[API change]
This new module exports `pandocVersion` and `pandocVersionText`,
which are no longer exported from Text.Pandoc.Shared. [API change]
Also, we now set the `pandoc-version` variable centrally rather
than in the writers. One effect is the man writer now emits
a comment with the pandoc version (this was intended before,
judging from the template, but it didn't happen because the
vairable wasn't set).
Rolls back 0ab014ed1e.
We don't need this because we aren't needing to print the Lua
version in options any more; we're handling `--version` now at
the pandoc-cli level.
Print flag settings (lua, server) and versions of all relevant packages.
Add suffix for nightly builds.
Move `nightly` flag from pandoc to pandoc-cli.
Closes#8339.
and add a new `pandocVersion` value with type `Version`. This is
consistent with the type used for `pandocTypesVersion` and allows to use
the value where a Version type is required.