@@ -115,7 +115,7 @@ data Opt = Opt
115115 , optEpubMetadata :: String -- ^ EPUB metadata
116116 , optEpubFonts :: [FilePath] -- ^ EPUB fonts to embed
117117 , optEpubChapterLevel :: Int -- ^ Header level at which to split chapters
118− , optEpubTOCLevel :: Int -- ^ Number of levels to include in TOC
118+ , optTOCLevel :: Int -- ^ Number of levels to include in TOC
119119 , optDumpArgs :: Bool -- ^ Output command-line arguments
120120 , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
121121 , optReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst
@@ -169,7 +169,7 @@ defaultOpts = Opt
169169 , optEpubMetadata = ""
170170 , optEpubFonts = []
171171 , optEpubChapterLevel = 1
172− , optEpubTOCLevel = 3
172+ , optTOCLevel = 3
173173 , optDumpArgs = False
174174 , optIgnoreArgs = False
175175 , optReferenceLinks = False
@@ -340,6 +340,18 @@ options =
340340 (\opt -> return opt { optTableOfContents = True }))
341341 "" -- "Include table of contents"
342342
343+ , Option "" ["toc-level"]
344+ (ReqArg
345+ (\arg opt -> do
346+ case safeRead arg of
347+ Just t | t >= 1 && t <= 6 ->
348+ return opt { optTOCLevel = t,
349+ optTableOfContents = True }
350+ _ -> err 57 $
351+ "TOC level must be a number between 1 and 6")
352+ "NUMBER")
353+ "" -- "Number of levels to include in TOC"
354+
343355 , Option "" ["no-highlight"]
344356 (NoArg
345357 (\opt -> return opt { optHighlight = False }))
@@ -569,17 +581,6 @@ options =
569581 "NUMBER")
570582 "" -- "Header level at which to split chapters in EPUB"
571583
572− , Option "" ["epub-toc-level"]
573− (ReqArg
574− (\arg opt -> do
575− case safeRead arg of
576− Just t | t >= 1 && t <= 6 ->
577− return opt { optEpubTOCLevel = t }
578− _ -> err 57 $
579− "TOC level must be a number between 1 and 6")
580− "NUMBER")
581− "" -- "Number of levels to include in EPUB TOC"
582−
583584 , Option "" ["latex-engine"]
584585 (ReqArg
585586 (\arg opt -> do
@@ -830,7 +831,7 @@ main = do
830831 , optEpubMetadata = epubMetadata
831832 , optEpubFonts = epubFonts
832833 , optEpubChapterLevel = epubChapterLevel
833− , optEpubTOCLevel = epubTOCLevel
834+ , optTOCLevel = epubTOCLevel
834835 , optDumpArgs = dumpArgs
835836 , optIgnoreArgs = ignoreArgs
836837 , optReferenceLinks = referenceLinks
@@ -1021,7 +1022,7 @@ main = do
10211022 writerEpubStylesheet = epubStylesheet,
10221023 writerEpubFonts = epubFonts,
10231024 writerEpubChapterLevel = epubChapterLevel,
1024− writerEpubTOCLevel = epubTOCLevel,
1025+ writerTOCLevel = epubTOCLevel,
10251026 writerReferenceODT = referenceODT,
10261027 writerReferenceDocx = referenceDocx
10271028 }