From 9eee4a2582822f01cdc46d9576dd9ed17b135e2c Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 9 Feb 2023 07:21:40 +0100 Subject: Lua: add field `chunk_template` to WriterOptions objects [API change] The PathTemplate type exported from Text.Pandoc.Chunks is now an instance of the ToJSON and FromJSON classes. Closes: #8607 --- pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs | 7 ++++++- pandoc-lua-engine/test/lua/module/globals.lua | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'pandoc-lua-engine') diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs index 960972bed..4ef5ae14d 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs @@ -55,7 +55,12 @@ typeWriterOptions = deftype "WriterOptions" <#> udparam typeWriterOptions "opts" "options to print in native format" =#> functionResult pushString "string" "Haskell representation" ] - [ property "cite_method" + [ property "chunk_template" + "Templates used to generate chunked HTML filenames (string)" + (pushViaJSON, writerChunkTemplate) + (peekViaJSON, \opts x -> opts{ writerChunkTemplate = x }) + + , property "cite_method" "How to print cites" (pushViaJSON, writerCiteMethod) (peekViaJSON, \opts x -> opts{ writerCiteMethod = x }) diff --git a/pandoc-lua-engine/test/lua/module/globals.lua b/pandoc-lua-engine/test/lua/module/globals.lua index 72edef036..19fee3e92 100644 --- a/pandoc-lua-engine/test/lua/module/globals.lua +++ b/pandoc-lua-engine/test/lua/module/globals.lua @@ -8,6 +8,9 @@ local assert = tasty.assert -- WriterOptions and its components. UPDATE THE DOCS if anything changes. return { group 'PANDOC_WRITER_OPTIONS' { + test('chunk_template', function () + assert.are_equal(type(PANDOC_WRITER_OPTIONS.chunk_template), 'string') + end), test('cite_method', function () assert.are_equal(type(PANDOC_WRITER_OPTIONS.cite_method), 'string') end), -- cgit v1.2.3