16 Commits
Author SHA1 Message Date
Albert Krewinkel 3a0fc17880 Lua: add function pandoc.format.extensions.
This simplifies the creation of custom readers and writers that are
based on built-in formats.
2023-01-18 08:59:53 -08:00
John MacFarlane c6551433b2 T.P.Chunks changes.
+ 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-15 22:32:16 -08:00
Albert Krewinkel cdf8c69fb9 Lua: add module pandoc.structure.
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.
2023-01-15 10:47:54 -08:00
John MacFarlane 3376286b7d Update pandoc-lua-engine test: test for Figure, not Null. 2023-01-13 15:08:57 -08:00
John MacFarlane d7960212c0 Replace --epub-chapter-level with --split-level.
Rationale: we need this splitting level now not just in
EPUB but in chunked HTML.

`--epub-chapter-level` will still function as a deprecated
synonynm. `epub-chapter-level` will also continue to work in
defaults files, ande `epub_chapter_level` will still work for
Lua marshalling.

[API changes]

Text.Pandoc.App.Opt: remove `optEpubChapterLevel`, add
`optSplitLevel`.

Text.Pandoc.Options: remove `writerEpubChapterLevel`, add
`writerSplitLevel`.
2023-01-12 09:04:29 -08:00
Albert Krewinkel 1328e57f08 Shared: use LineBreak as default block sep in blocksToInlines
This change also affects the `pandoc.utils.blocks_to_inlines` Lua
function.

Closes: #8499
2022-12-20 13:39:16 -08:00
Albert Krewinkel a36f12119f Lua: allow table structure as format spec.
This allows to pass structured values as format specifiers to
`pandoc.write` and `pandoc.read`.
2022-12-16 10:43:01 -08:00
Albert Krewinkel e0e6087145 Shared: change defaultBlocksSeparator to PARAGRAPH SEPARATOR
This Unicode char (U+2029) is intended as a semantic separator between
paragraphs; it is cleaner and less intrusive than the pilcrow sign that
we used before. This also changes the default `sep` value used in the
`pandoc.utils.blocks_to_inlines` Lua function.
2022-12-08 00:24:07 +01:00
Albert Krewinkel 999916642c Fix test for template marshaling. 2022-10-27 22:46:34 +02:00
Albert Krewinkel 6c4d885bda Lua: allow strings in place of compiled templates.
This allows to use a string as parameter to `pandoc.template.apply` and
in the WriterOptions `template` field.

Closes: #8321
2022-10-27 22:09:39 +02:00
Albert Krewinkel 78d7fc46fe Lua: add function pandoc.template.apply
The new function applies a context, containing variable assignments, to
a template.
2022-10-11 14:03:08 -07:00
Albert Krewinkel a4218b9719 [API Change] Add new module "Text.Pandoc.Format"
The module provides functions and types for format spec parsing and
processing.

The function `parseFormatSpec` was moved from Text.Pandoc.Extensions to
the new module and renamed to `parseFlavoredFormat`. It now operates in
a PandocMonad and is based on the updated types.
2022-10-08 16:05:48 -07:00
Albert Krewinkel 96bdd34a90 Lua: fix tests on Windows broken in previous commit. 2022-10-05 22:07:38 +02:00
Albert Krewinkel 48ab7a17cf Lua: produce more informative error messages for pandoc errors
Errors are reported in Lua in the same words in which they would be
reported in the terminal.
2022-10-05 21:53:03 +02:00
Albert Krewinkel 86e009b495 Lua: add new module pandoc.format.
The module provides functions to query the set of extensions supported
by formats, and the set of extension enabled per default.
2022-10-04 13:06:23 -07:00
Albert Krewinkel 5be9052f5f [API Change] Extract Lua code into new package pandoc-lua-engine
The flag 'lua53` must now be used with that package if pandoc is to be
compiled against Lua 5.3.
2022-09-30 08:33:40 -07:00