aboutsummaryrefslogtreecommitdiff
path: root/pandoc-lua-engine
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-01-12 09:01:56 -0800
committerJohn MacFarlane <[email protected]>2023-01-12 09:04:29 -0800
commitd7960212c0d3bf57659f5f6d3ad054eda2d20746 (patch)
tree97c92b385c5a136c267c9d611741add22494dd38 /pandoc-lua-engine
parent2101dcf54ce5d3d2ecce300ca97dba47c5d61f02 (diff)
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`.
Diffstat (limited to 'pandoc-lua-engine')
-rw-r--r--pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs11
-rw-r--r--pandoc-lua-engine/test/lua/module/globals.lua4
2 files changed, 10 insertions, 5 deletions
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 d08b7cc14..960972bed 100644
--- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs
+++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs
@@ -75,10 +75,15 @@ typeWriterOptions = deftype "WriterOptions"
(pushViaJSON, writerEmailObfuscation)
(peekViaJSON, \opts x -> opts{ writerEmailObfuscation = x })
+ , property "split_level"
+ "Level at which EPUB or chunked HTML documents are split into files"
+ (pushIntegral, writerSplitLevel)
+ (peekIntegral, \opts x -> opts{ writerSplitLevel = x })
+
, property "epub_chapter_level"
- "Header level for chapters (separate files)"
- (pushIntegral, writerEpubChapterLevel)
- (peekIntegral, \opts x -> opts{ writerEpubChapterLevel = x })
+ "Deprecated synonym for split_level"
+ (pushIntegral, writerSplitLevel)
+ (peekIntegral, \opts x -> opts{ writerSplitLevel = x })
, property "epub_fonts"
"Paths to fonts to embed"
diff --git a/pandoc-lua-engine/test/lua/module/globals.lua b/pandoc-lua-engine/test/lua/module/globals.lua
index 85b287cf2..72edef036 100644
--- a/pandoc-lua-engine/test/lua/module/globals.lua
+++ b/pandoc-lua-engine/test/lua/module/globals.lua
@@ -20,8 +20,8 @@ return {
test('email_obfuscation', function ()
assert.are_equal(type(PANDOC_WRITER_OPTIONS.email_obfuscation), 'string')
end),
- test('epub_chapter_level', function ()
- assert.are_equal(type(PANDOC_WRITER_OPTIONS.epub_chapter_level), 'number')
+ test('split_level', function ()
+ assert.are_equal(type(PANDOC_WRITER_OPTIONS.split_level), 'number')
end),
test('epub_fonts', function ()
assert.are_equal(type(PANDOC_WRITER_OPTIONS.epub_fonts), 'table')