summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App/Opt.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2022-12-04 09:56:54 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2022-12-04 09:59:05 -0800
commitaaa3beacc0c624fc3bd3ac154024a6be36af83af (patch)
tree667cae7ef80ee85af72611a9ec181a8c45464fe9 /src/Text/Pandoc/App/Opt.hs
parentb34ec00607c0218b3f9e8718d0fc68b3cf228f6c (diff)
EPUB writer: make title page optional.
New command line option: `--epub-title-page=true|false`. New `writerEpubTitlePage` field on `WriterOptions` [API change]. New `optEpubTitlePage` field on `Opts` [API change]. Closes #6097.
Diffstat (limited to 'src/Text/Pandoc/App/Opt.hs')
-rw-r--r--src/Text/Pandoc/App/Opt.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs
index a8b08e7a8..80864967f 100644
--- a/src/Text/Pandoc/App/Opt.hs
+++ b/src/Text/Pandoc/App/Opt.hs
@@ -131,6 +131,7 @@ data Opt = Opt
, optEpubFonts :: [FilePath] -- ^ EPUB fonts to embed
, optEpubChapterLevel :: Int -- ^ Header level at which to split chapters
, optEpubCoverImage :: Maybe FilePath -- ^ Cover image for epub
+ , optEpubTitlePage :: Bool -- ^ INclude title page in EPUB
, optTOCDepth :: Int -- ^ Number of levels to include in TOC
, optDumpArgs :: Bool -- ^ Output command-line arguments
, optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
@@ -211,6 +212,7 @@ instance FromJSON Opt where
<*> o .:? "epub-fonts" .!= optEpubFonts defaultOpts
<*> o .:? "epub-chapter-level" .!= optEpubChapterLevel defaultOpts
<*> o .:? "epub-cover-image"
+ <*> o .:? "epub-title-page" .!= optEpubTitlePage defaultOpts
<*> o .:? "toc-depth" .!= optTOCDepth defaultOpts
<*> o .:? "dump-args" .!= optDumpArgs defaultOpts
<*> o .:? "ignore-args" .!= optIgnoreArgs defaultOpts
@@ -739,6 +741,7 @@ defaultOpts = Opt
, optEpubFonts = []
, optEpubChapterLevel = 1
, optEpubCoverImage = Nothing
+ , optEpubTitlePage = True
, optTOCDepth = 3
, optDumpArgs = False
, optIgnoreArgs = False