aboutsummaryrefslogtreecommitdiff
path: root/pandoc-lua-engine
AgeCommit message (Collapse)Author
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
2023-06-22Lua: report warnings from Lua scriptsAlbert Krewinkel
Lua's warning system is plugged into pandoc's reporting architecture. Warnings that are raised with the Lua `warn` function are now reported together with other messages.
2023-06-09Bump pandoc-lua-engine to 0.2.0.1.pandoc-lua-engine-0.2.0.1John MacFarlane
2023-06-09Include lua/module/sample.svg in hackage tarballFelix Yan
Should fix the following error when running tests from Hackage tarball: ``` pandoc.mediabag: [WARNING] Could not fetch resource lua/module/sample.svg: replacing image with description FAIL fetch // populates media bag: File lua/module/sample.svg not found in resource path DEBUG:root:haskell-pandoc-lua-engine: fill // populates media bag: lua/module/pandoc-mediabag.lua:70: expected values to be equal, got 'nil' and 'image/svg+xml' ```
2023-04-16Lua: fix value of PANDOC_SCRIPT_FILE for custom readers & writersAlbert Krewinkel
The value did not hold the actual file path for scripts in the *custom* folder of the datadir. Fixes: #8781
2023-03-27Bump pandoc-lua-engine to 0.2, depend on latest pandocJohn MacFarlane
2023-03-21Lua: Fix typo in pandoc.cli doc string.Albert Krewinkel
2023-03-20T.P.Format: add new function `formatFromFilePaths` [API Change] (#8710)Albert Krewinkel
* T.P.Format: export `formatFromFilePaths` [API change] * Lua: add function `pandoc.format.from_path` * Update lua-filters.md * The old T.P.App.FormatHeuristics module has been removed. This is an alternative to #8693.
2023-03-20Lua: add Windows-specific note to pandoc.cli.repl docsAlbert Krewinkel
2023-03-20lua-filters: auto-generate docs for `pandoc.system` module.Albert Krewinkel
2023-03-20Lua: fix json.encode for nested AST elements.Albert Krewinkel
Ensures that objects with nested AST elements can be encoded as JSON.
2023-03-20Lua: load text module as `pandoc.text`.Albert Krewinkel
This only affects the name in the Lua-internal documentation. It is still possible to load the modules via `require 'text'`, although this is deprecated.
2023-03-20lua-filters.md: Generate docs for pandoc.utilsAlbert Krewinkel
The documentation in the Haskell sources has been updated.
2023-03-19lua-filters.md: auto-generate docs for more modulesAlbert Krewinkel
2023-03-19Lua tests: add more tests for pandoc.mediabag.Albert Krewinkel
2023-03-19Lua: add info on when functions became available in pandocAlbert Krewinkel
2023-03-19lua-filters.md: generate docs from Haskell for pandoc.structureAlbert Krewinkel
2023-03-19lua-filters.md: autogenerate parts of the Lua API docsAlbert Krewinkel
2023-03-18Lua: add pandoc.cli.repl functionAlbert Krewinkel
2023-03-17pandoc-cli: add a Lua REPLAlbert Krewinkel
2023-03-15Lua: keep the Lua stack cleanAlbert Krewinkel
A metatable used during initialization was not properly removed from the stack. Likewise, accessing the CommonState from Lua previously led to the pollution of the Lua stack with a left-over value.
2023-03-13Switch to hslua-2.3Albert Krewinkel
2023-03-12Lua: allow to get the JSON encoding of log messagesAlbert Krewinkel
2023-02-14Lua: add new function pandoc.system.cputime.Albert Krewinkel
The function returns the CPU time consumed by pandoc and can be used to benchmark Lua computations.
2023-02-11Lua: add module `pandoc.json` to handle JSON encodingAlbert Krewinkel
Closes: #8605
2023-02-11Use latest pandoc-lua-marshal release, version 0.2.1.Albert Krewinkel
All major AST elements now have `__tojson` metamethods that return the JSON representation of an element. This allows to JSON-encode these elements with libraries that respect the `__tojson` metamethod, including dkjson.
2023-02-09Bump pandoc-lua-engine to 0.1.1pandoc-lua-engine-0.1.13.1John MacFarlane
2023-02-09pandoc-lua-engine: require pandoc >= 3.1.John MacFarlane
2023-02-09Lua: add field `chunk_template` to WriterOptions objects [API change]Albert Krewinkel
The PathTemplate type exported from Text.Pandoc.Chunks is now an instance of the ToJSON and FromJSON classes. Closes: #8607
2023-02-08pandoc-lua-engine: relax version bound to allow pandoc 3.1.John MacFarlane
2023-01-18Add param to tocToList for numberSections.John MacFarlane
Otherwise sections are always numbered in the TOC, even if `--number-sections` is not used.
2023-01-18Lua: add function pandoc.format.extensions.Albert Krewinkel
This simplifies the creation of custom readers and writers that are based on built-in formats.
2023-01-16Lua: Add function `pandoc.mediabag.write`.Albert Krewinkel
Allows to write the complete mediabag or just a specific file to a given directory.
2023-01-15T.P.Chunks changes.John MacFarlane
+ Re-use `toTocTree` in constructing `chunkedTOC`. Previously we used an entirely different function toTOCTree'. + Improve `tocToList` so that it avoids empty lists of items that are omitted because they are below the toc depth. pandoc-lua-engine: + Fix structure tests in light of last change. T.P.Writers.ChunkedHTML: + Reuse `tocToList` in `buildTOC`. T.P.Writers.EPUB: + Adjust EPUB writer for Chunks changes.
2023-01-15Lua: add module `pandoc.structure`.Albert Krewinkel
Adds support for table of contents and chunks handling. The function `make_sections` has been given a friendlier interface and was moved to the new module; the old `pandoc.utils.make_sections` has been deprecated.