Commit Graph
28 Commits
Author SHA1 Message Date
Albert Krewinkel 522302a97e pandoc-cli: Refer printing of version info to the Lua interpreter
The Lua interpreter no longer terminates when called with `-v` or
`--version` arguments, thus improving compatibility with the default
`lua` interpreter program.
2024-06-28 10:03:14 +02:00
John MacFarlane 03630a2c6e Update copyright dates to 2024. 2024-04-25 18:16:49 -07:00
John MacFarlane 1904fa53fa pandoc-cli: ensure UTF8 when emitting version info. 2024-04-25 17:49:38 -07:00
John MacFarlane bec5429e4f Fix regression on short boolean arguments.
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.
2023-07-19 11:56:58 -07:00
Andreas Scherer 6da429f829 Purge double space. 2023-04-05 07:52:52 -07:00
Albert Krewinkel b55cd83a60 Update copyright years, it's 2023! 2023-01-10 20:28:27 +01:00
John MacFarlane 848f6b51b2 Text.Pandoc.App: Change parseOptionsFromArgs and parseOptions... (#8406)
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]
2022-11-02 19:07:22 -07:00
John MacFarlane 3e48d9701d Re-add TemplateHaskell pragma in pandoc-cli.
This was an hlint false positive.
2022-10-31 09:03:10 -07:00
John MacFarlane 8b3be07ae8 hlint suggestions. 2022-10-30 11:02:00 -07:00
John MacFarlane 2e1f424daa Move defaultUserDataDir from T.P.Shared to T.P.Data [API change]. 2022-10-19 10:48:49 -07:00
John MacFarlane fde8635a18 Split Text.Pandoc.Version from Text.Pandoc.Shared.
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).
2022-10-19 09:16:13 -07:00
John MacFarlane f486fcde13 Rollback parameterize options on scripting engine.
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.
2022-10-13 17:59:49 -07:00
John MacFarlane 42b6e3907c Fix nightly flag build. 2022-10-01 09:56:50 -07:00
John MacFarlane 215d62ccd6 Remove build versions info from --version output. 2022-09-30 17:18:15 -07:00
John MacFarlane aa0e9c4d6e Move --version handling to pandoc-cli.
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.
2022-09-30 16:46:39 -07:00
Albert Krewinkel cfc2024d37 Use server as command to start the pandoc server 2022-09-30 18:41:51 +02:00
Albert Krewinkel b6a571d577 pandoc-cli: Allow building a binary without Lua support
Disabling the `lua` cabal flag will result in a binary without Lua.
2022-09-30 08:33:40 -07:00
Albert Krewinkel 79980eee4a [API Change] Parameterize convertWithOpts over scripting engine. 2022-09-30 08:33:40 -07:00
Albert Krewinkel 0ab014ed1e [API Change] App: parameterize options over the scripting engine 2022-09-30 08:33:40 -07:00
Albert Krewinkel ddaadc88bc [API Change] Rename pandocVersion to pandocVersionText...
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.
2022-09-30 08:33:40 -07:00
Albert Krewinkel efecff1f2f pandoc-cli: support -E flag in pandoc-lua 2022-09-27 08:42:27 -07:00
Albert Krewinkel 175b791529 pandoc-cli: support "lua" and "serve" as commands
Pandoc behaves like `pandoc-lua` and `pandoc-server` if the first
argument is `lua` and `serve`, respectively.
2022-09-27 08:42:27 -07:00
Albert Krewinkel a3fd6c674d pandoc-cli: update to hslua-cli-1.2 2022-09-27 08:42:27 -07:00
Albert Krewinkel 2bad9a9aa4 pandoc-cli: Avoid the CPP language extension
Alternative behavior for the *server* flag is implemented by using
separate modules.
2022-09-27 08:42:27 -07:00
John MacFarlane 13ee8b82da Add server flag to pandoc-cli.
This allows the executable to be built without support for
"server mode."
2022-09-26 09:25:54 -07:00
Albert Krewinkel e3648357cf Use hslua-cli package for pandoc-lua interface 2022-09-23 22:26:37 +02:00
Albert Krewinkel 22fa51ded1 Make pandoc behave like a Lua interpreter when called as pandoc-lua. (#8311) 2022-09-22 14:39:25 -07:00
John MacFarlane bd1d923b86 Split pandoc-server, pandoc-cli into separate packages. (#8309)
This also removes the unnecessary Setup.hs from pandoc.
Cabal does not need this with build-type 'simple'.
2022-09-22 09:47:07 -07:00