204 Commits
Author SHA1 Message Date
John MacFarlane b81df2464d Bump pandoc-lua-engine to 0.5.3.1. 2026-07-21 22:32:44 +02:00
John MacFarlane 8831b48b9d Change symlink to regular file for COPYING.md in...
pandoc-cli, pandoc-lua-engine, pandoc-server.
2026-07-12 12:09:50 +02:00
John MacFarlane 8547196b44 Markdown reader: ordered sublists must start with 1
(or equivalent, e.g. 'i').  This brings the markdown
parser in line with commonmark, and avoids a lot of
unintended list starts.  Closes #11735.

Note that ordered lists that are not sublists may
still start with numbers other than 1.
2026-07-01 11:17:21 +02:00
John MacFarlane f166e42d4f pandoc-lua-engine: bump to 0.5.3. 2026-06-03 16:34:44 +02:00
John MacFarlane ea1570e8c9 pandoc-lua-engine: require pandoc 3.10.x 2026-06-03 16:34:44 +02:00
John MacFarlane b43762cdc4 Error messages: use single quotes around paths and format names.
Closes #11645.
2026-05-13 17:15:34 +02:00
Albert Krewinkel 62ac67cff4 Lua: Add constructor pandoc.TableBody 2026-04-23 15:19:56 +02:00
John MacFarlane 3e8fca87c8 Bump pandoc-lua-engine to 0.5.2. 2026-03-17 16:13:43 +01:00
John MacFarlane 131cf7ce9b Allow crypton 1.1. 2026-03-07 23:42:44 +01:00
Albert Krewinkel f9fb410cd9 Lua: add new function pandoc.types.Sources.
This provides access to the `Sources` abstraction that pandoc uses for
input files.

Closes: #11441
2026-02-09 22:03:06 +01:00
John MacFarlane 45c4a98ba8 pandoc-lua-engine: depend on pandoc 3.9. 2026-02-02 17:24:39 +01:00
John MacFarlane 69e5727372 Bump pandoc-lua-engine to 0.5.1. 2026-02-02 17:21:02 +01:00
John MacFarlane bbc4f30a62 Use released citeproc 0.13. 2026-02-01 15:44:35 +01:00
John MacFarlane 4b26f50118 Add support for compiling pandoc.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.
2026-02-01 14:50:50 +01:00
Albert Krewinkel 9219a313e9 Lua: add function pandoc.utils.documentation (#11383)
Closes #10999.

This is now used to generate much of the Lua API documentation.
2026-01-15 09:59:58 +01:00
Albert Krewinkel cb8739f5b0 Lua: switch to HsLua 2.5 2026-01-08 17:55:04 +01:00
Albert Krewinkel e9c4d7f724 Lua: let pandoc.with_state error on unknown options
Unknown or unsupported options now cause the `pandoc.with_state`
function to fail.

Closes: #11376
2026-01-05 22:48:45 +01:00
Albert Krewinkel 8f8ea44d02 Lua: add function pandoc.with_state
The function allows to run a callback with a modified pandoc state. This
provides the ability to temporarily modify the resource path, the user
data directory, and the HTTP request headers.

Closes: #10859
2026-01-02 11:10:09 -05:00
Albert Krewinkel e8d140f41f Lua: support equallity checks of LogMessage objects
The *LogMessage* type now has the appropriate metamethod.
2026-01-02 14:42:11 +01:00
Albert Krewinkel 7b68846b92 Lua: mark readers and writers with their types.
The `pandoc.readers` and `pandoc.writers` maps now have string values
instead of boolean values. The string signals the type of the
reader/writer, `"text"` for *TextReader*/*TextWriter* and `"bytestring"`
for *ByteStringReader*/*ByteStringWriter*.

Closes: #11367
2025-12-31 10:43:07 +01:00
John MacFarlane 867686b554 pandoc-lua-engine: bump to 0.5.0.2. 2025-12-01 09:38:08 +01:00
John MacFarlane 48badd2073 pandoc-lua-engine: allow citeproc 0.12. 2025-11-30 18:05:49 +01:00
Albert Krewinkel 4e0f626898 Lua: preserve common state of custom Lua readers
The common state is transferred to Lua when calling a custom Lua reader,
and is now also transferred back after the reader has finished. This
ensures that info messages, warnings, and mediabag entries are available
to the main program and all subsequent processing steps.
2025-11-19 12:22:41 +01:00
John MacFarlane d929bbf394 Bump pandoc-lua-engine to 0.5.0.1 2025-10-20 10:18:44 +02:00
John MacFarlane 3766e39389 pandoc-lua-engine: allow citeproc 0.11. 2025-10-19 23:27:09 +02:00
John MacFarlane 69709e1b1d Bump pandoc-lua-engine to 0.5. 2025-09-06 11:03:42 +02:00
John MacFarlane ede7128ea5 pandoc-lua-engine: change pandoc dependency bounds. 2025-09-06 10:59:05 +02:00
John MacFarlane ad77315d22 Bump version bound for citeproc in pandoc-lua-engine. 2025-09-04 12:23:53 +02:00
Albert Krewinkel e0acb24528 Refactor highlighting options [API Change]
A new command line option `--syntax-highlighting` is provided; it takes
the values `none`, `default`, `idiomatic`, a style name, or a path to a
theme file. It replaces the `--no-highlighting`, `--highlighting-style`,
and `--listings` options.

The `writerListings` and `writerHighlightStyle` fields of the
`WriterOptions` type are replaced with `writerHighlightStyle`.

Closes: #10525
2025-09-02 17:50:47 +02:00
Albert Krewinkel a36654b222 Lua: add function pandoc.structure.unique_identifier.
The function generates element identifiers based on inlines content.
It's primary use case is the programmatic generation of ID, similar to
what the `auto_identifiers` extension provides for many formats.
2025-08-12 21:37:35 +02:00
Albert Krewinkel 68d80cc9d9 Lua: add functions pandoc.text.superscript and subscript.
The functions convert numbers and parentheses to superscript and
subscript, respectively.
2025-08-12 08:47:49 +02:00
Albert Krewinkel 282fa55421 Lua: require hslua-module-system 1.2.3
This provides List methods to the value returned by
`pandoc.system.list_directory`.

Closes: #11032
2025-08-09 20:59:11 +02:00
Albert Krewinkel b24bba7a20 Add smart_quotes and special_strings extensions for Org
Org mode makes a distinction between smart parsing of quotes, and smart
parsing of special strings like `...`. The finer grained control over
these features is necessary to truthfully reproduce Emacs Org mode
behavior. Special strings are enabled by default, while smart quotes are
disabled.

The behavior of `special_string` is brought closer to the reference
implementation in that `\-` is now treated as a soft hyphen.
2025-08-06 12:54:12 -07:00
Albert Krewinkel 75aee7a23c Lua: use proper interface functions to access the CommonState.
- The `PANDOC_STATE` is no longer a userdata object, but a table that
  behaves like the old object.

- Log messages in `PANDOC_STATE.log` are now in temporal order.
2025-08-01 10:04:14 -07:00
Albert Krewinkel 01a305af58 Lua: add function pandoc.path.exists.
The functions allows to check the existence of file-system objects.
2025-07-23 19:31:03 +02:00
Albert Krewinkel 9893fe8c65 Lua: add normalize function to *Pandoc* objects
This function performs a normalization of Pandoc documents. E.g.,
multiple successive spaces are collapsed, and tables are normalized such
that all rows and columns contain the same number of cells.

Closes: #10356
2025-07-19 15:42:37 +02:00
Albert Krewinkel 6b81649771 Lua: add more UTF-8-aware file operations to pandoc.system.
Functions that expect UTF-8-encoded filenames should make it easier to
write platform-independent scripts, as the encoding of the actual
filename depends on the system.

Additionally, this also adds a generalized method to run commands, and
functions to retrieve XDG directory names.

The new functions are `command`, `copy`, `read_file`, `remove`,
`rename`, `times`, `write_file`, `xdg`.
2025-06-30 09:56:08 -06:00
Albert Krewinkel bffdd13038 pandoc-lua-engine: Allow hslua-2.4.0 in the tests 2025-06-25 17:06:55 +02:00
Albert Krewinkel d3f2fcc5f8 pandoc-lua-engine: Allow hslua-2.4. 2025-06-23 13:02:19 +02:00
John MacFarlane 883c8725d5 Bump pandoc-lua-engine to 0.4.3. 2025-05-28 15:03:37 -07:00
Albert Krewinkel c92cc277f5 doc/lua-filters.md: add missing docs for pandoc.Caption 2025-05-28 14:00:42 +02:00
Albert Krewinkel ce5e2a2efc Lua: add function pandoc.mediabag.make_data_uri.
The function takes a MIME type and raw data from which it creates an
RFC 2397 data URI.

Closes: #10876
2025-05-28 13:19:01 +02:00
John MacFarlane fdec82c5d8 pandoc-lua-engine: bump to 0.4.2, bump pandoc bounds. 2025-05-14 14:42:28 -07:00
Albert Krewinkel 992842d07b Lua: accept filename-contents pairs as env for pandoc.read
Key-value pairs, mapping from filename to contents, can be used to fill
the ersatz file system used in the reader sandbox.
2025-05-14 09:17:24 -07:00
Albert Krewinkel 5b896bc1a9 Lua: allow to pass files to the pandoc.read sandbox
The sandbox is now enabled if the fourth parameter is a list of files.
The files are read and then made available in the sandbox via a mock
file system.
2025-05-14 09:17:24 -07:00
Albert Krewinkel be9fbb3f67 pandoc-lua-engine: add all test files to the cabal file 2025-05-13 23:41:03 +02:00
Albert Krewinkel 31f74fac06 Lua: support sandboxed parsing with pandoc.read.
The function `pandoc.read` is now taking an optional fourth parameter
that specifies the environment in which the parser will be run. Passing
the string `sandbox` as the argument causes the reader to run in a
sandbox, thereby preventing all access to the network and file system.

Closes: #10831
2025-05-13 23:38:36 +02:00
John MacFarlane 9bb805adb0 Use citeproc-0.9. Bump citeproc bounds for pandoc, pandoc-lua-engine. 2025-05-12 00:43:39 -07:00
John MacFarlane da45a9c76a pandoc-lua-engine to 0.4.1.1, allow latest containers 2025-03-16 10:58:49 -07:00
John MacFarlane 26ad26b7e6 pandoc-lua-engine: bump to 0.4.1. 2024-12-23 00:51:49 -08:00