aboutsummaryrefslogtreecommitdiff
path: root/pandoc-lua-engine
AgeCommit message (Collapse)Author
2024-09-21Lua: support character styling via `pandoc.layout`Albert Krewinkel
The `Doc` values produced and handled by the `pandoc.layout` module can now be styled using `bold`, `italic`, `underlined`, or `strikeout`. The style is ignored in normal rendering, but becomes visible when rendering to ANSI output. The `pandoc.layout.render` function now takes a third parameter that defines the output style, either *plain* or *ansi*.
2024-09-21Lua: update List moduleAlbert Krewinkel
The module now comes with a method `:at(index[, def])` that allows to access indices, accepts negative indices to count from the end, and will return the `def` value as a default if the list has no item at the given position. Furthermore, the list constructor `pandoc.List` now accepts iterators. E.g., `pandoc.List(text:gmatch '%S+')` returns the list of words in `text`. Closes: #9835
2024-09-09Bump pandoc-lua-engine to 0.3.2.John MacFarlane
2024-09-09Depend on doclayout 0.5.John MacFarlane
2024-09-08pandoc-lua-engine: marshall list_tables, epub_title_page writer options.John MacFarlane
2024-09-08Finishing touches on `--link-images`:John MacFarlane
- Document in defaults file section of MANUAL. - Add to pandoc-lua-engine writer option marshalling. - Add to pandoc-server initialization of writer options.
2024-09-08Include accessors for new writer optionsJohn MacFarlane
2024-07-28Bump pandoc version in pandoc-lua-engine.John MacFarlane
2024-07-28Bump pandoc-lua-engine version to 0.3.1, depend on it in pandoc-cliJohn MacFarlane
2024-07-08lua-filters.md: Partially autogenerate docs for module "pandoc"Albert Krewinkel
The documentation system isn't powerful enough to generate the full documentation automatically.
2024-07-08Harmonize maintainer email addresses in module headers.Albert Krewinkel
2024-06-28Lua: keep `lpeg` and `re` as "loaded" modules.Albert Krewinkel
The modules `lpeg` and `re` are now treated as if they had been loaded with `require`. Previously the modules were only assigned to global values, but could be loaded again via `require`, thereby allowing to use a system-wide installation. However, this proved to be confusing. The old behavior can be restored by adding the following lines to the top of Lua scripts, or to the `init.lua` in the data dir. debug.registry()['_LOADED'].lpeg = nil debug.registry()['_LOADED'].re = nil
2024-06-24Bump pandoc version bound in pandoc-lua-engine.John MacFarlane
2024-06-24Update pandoc-lua-engine to 0.3John MacFarlane
2024-06-09Lua: split Init module into more modules.Albert Krewinkel
The module has grown unwieldy and is therefore split into three internal Haskell modules, `Init`, `Module`, and `Run`.
2024-06-08Lua: add function `pandoc.template.get`.Albert Krewinkel
The function allows to specify a template with the same argument value that would be used with the `--template` command line parameter. Closes: #9854 Co-authored-by: Carsten Gips <[email protected]>
2024-06-08Update more copyright dates to 2024.Albert Krewinkel
2024-06-08Lua: keep CommonState object in the registryAlbert Krewinkel
The state is an internal value and should be treated as such. The `PANDOC_STATE` global is merely a copy; unsetting the global no longer breaks the Lua engine.
2024-06-08Lua: add tests for PANDOC_STATE globalAlbert Krewinkel
2024-06-07doc/lua-filters: autogenerate docs for module pandoc.templateAlbert Krewinkel
2024-06-07Lua: allow passing an environment to `run_lua_filter`.Albert Krewinkel
The default is now to use a *copy* of the global environment when running a filter; this ensures better separation when `run_lua_filter` is used multiple times. A custom environment can be specified via the optional third parameter.
2024-06-01Lua: Set `pandoc.List` as default metatable for JSON listsAlbert Krewinkel
Lists created by `pandoc.json.decode` now behave like lists generated via `pandoc.List`. This also ensures that `pandoc.List` tables are encoded as JSON arrays when passed to `pandoc.json.encode`. Fixes: #9834
2024-05-28Lua: fix typo in `run_lua_filter`Albert Krewinkel
Fixes previous commit ad68ff34aeb78e26d98a593dfdaf6bc4933857fc.
2024-05-27Lua: add function `pandoc.utils.run_lua_filter` (#9803)Albert Krewinkel
2024-05-13pandoc-lua-engine: depend on pandoc >= 3.2.John MacFarlane
See https://github.com/jgm/pandoc/issues/9755
2024-05-11Bump pandoc, pandoc-cli to 3.2, update changelog.John MacFarlane
Also bump pandoc-lua-engine to 0.2.1.5 and allow pandoc 3.2.
2024-05-10Lua: add a `pandoc.log` module.Albert Krewinkel
2024-05-06Lua: update to pandoc-lua-marshal version 0.2.7.Albert Krewinkel
This fixes counterintuitive behavior of the `content` property on BulletList and OrderedList items. Unmarshalling of that field now matches the behavior of the constructor. Fixes: #8916
2024-05-05Lua: use hslua-module-zip-1.1.3 to fix the windows buildAlbert Krewinkel
2024-05-05Lua: use newest zip module.Albert Krewinkel
This adds a `symlink` function to Entry objects, allowing to check if an entry represents a symbolic link.
2024-05-05Lua: improve `pandoc.json.decode` docs.Albert Krewinkel
2024-05-04Lua: fix generated docs.Albert Krewinkel
Update and fix docs for `pandoc.types.Version` and `pandoc.utils.type`.
2024-04-25Update copyright dates to 2024.John MacFarlane
2024-04-16Lua: add new module `pandoc.image`Albert Krewinkel
The module provides basic querying functions for image properties.
2024-04-07Bump pandoc-lua-engine to 0.2.1.4.pandoc-lua-engine-0.2.1.4John MacFarlane
2024-03-29Require pandoc-lua-marshal 0.2.6Albert Krewinkel
Fixes an issue arising when the value of `content` properties on *BlockQuote*, *Figure*, and *Div* elements was an empty list. Fixes: #9613
2024-02-20Lua: avoid crashing when an error message is not valid UTF-8Albert Krewinkel
Invalid input bytes in error messages caused pandoc to crash with an encoding exception. Instead, the invalid bytes are now replaced with the Unicode replacement character U+FFFD.
2024-02-14Allow containers 0.7.John MacFarlane
- Bump pandoc-lua-engine to 0.2.1.3. - Bump pandoc-server to 0.1.0.5.
2024-02-14Bump pandoc-server to 0.1.0.5 and allow containsers 0.7John MacFarlane
2024-02-03Shared: `makeSections` behavior changes.John MacFarlane
+ When the optional base level parameter is provided, we no longer ensure that the sequence of heading levels is gapless [behavior change]. Instead, we set the lowest heading level to the specified base level, and adjust the others accordingly. If an author wants to skip a level, e.g. from level 1 to level 3, they can do that. In general, the heading levels specified in the source document are preserved; `makeSections` only puts them into a hierarchical structure. Closes #9398. + Section numbers are now assigned so that the top level gets `1`, no matter what heading level is used. So, even if the top heading level is 2, numbers will be `1`, `2`, etc. rather than `0.1`, `0.2`, as in the past. Closes #5071. + We revert to the old behavior when the `--number-offset` option is used. So, for example, if a document begins with a level-3 heading, and `--number-offset=1,2` is used, the top-level section numbers will be `1.2.1`, `1.2.2`, etc. This is mainly for backwards-compatibility.
2024-01-30Update lua tests for change to toTOCTree.John MacFarlane
2024-01-29Lua: catch encoding error in `pandoc.read`Albert Krewinkel
Fixed a bug that could lead to an un-catchable error and program termination when `pandoc.read` was called with invalid UTF-8 input. Fixes: #9385
2024-01-20Custom writers: fix handling of common stateAlbert Krewinkel
The CommonState (`PANDOC_STATE` in Lua) may change between the time that a custom writer script is first loaded and when the writer is run. However, the writer was always using the initial state, which led to problems, e.g. when the mediabag was updated in a filter, as those updates where not visible to the writer. The state is now updated right before the writer function runs. Fixes: #9229
2023-09-27Lua: Use the newest LPeg version (lpeg-1.1.*)Albert Krewinkel
Closes: #9107
2023-09-01pandoc-lua-engine: bump lower bound for pandoc.John MacFarlane
See #9046.
2023-08-31pandoc-lua-engine: bump to 0.2.1.2pandoc-lua-engine-0.2.1.2John MacFarlane
2023-08-31pandoc-lua-engine; allow text 2.1.John MacFarlane
2023-08-06Bump pandoc-lua-engine version to 0.2.1.1pandoc-server-0.1.0.2pandoc-lua-engine-0.2.1.13.1.6.1John MacFarlane
2023-08-06Bump dates, update dependencies.John MacFarlane
2023-06-24Bump pandoc-lua-engine to 0.2.1.pandoc-lua-engine-0.2.1John MacFarlane