diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-05 11:34:23 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-05 11:36:55 -0800 |
commit | 7c10e579976a3016d86b613cf4f8b25e3c01a7da (patch) | |
tree | 0883efa6d3ddc4b1a53070166cd9a5da31badb97 /pandoc.hs | |
parent | 91e8d80eee405e4bbb40bf247724b453187619f9 (diff) | |
download | pandoc-7c10e579976a3016d86b613cf4f8b25e3c01a7da.tar.gz |
Changed `--epub-toc-level` to `--toc-level`.
Also writerEpubTOCLevel -> writerTOCLevel.
So far this is only implemented in the EPUB writer.
Diffstat (limited to 'pandoc.hs')
-rw-r--r-- | pandoc.hs | 31 |
1 files changed, 16 insertions, 15 deletions
@@ -115,7 +115,7 @@ data Opt = Opt , optEpubMetadata :: String -- ^ EPUB metadata , optEpubFonts :: [FilePath] -- ^ EPUB fonts to embed , optEpubChapterLevel :: Int -- ^ Header level at which to split chapters - , optEpubTOCLevel :: Int -- ^ Number of levels to include in TOC + , optTOCLevel :: Int -- ^ Number of levels to include in TOC , optDumpArgs :: Bool -- ^ Output command-line arguments , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments , optReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst @@ -169,7 +169,7 @@ defaultOpts = Opt , optEpubMetadata = "" , optEpubFonts = [] , optEpubChapterLevel = 1 - , optEpubTOCLevel = 3 + , optTOCLevel = 3 , optDumpArgs = False , optIgnoreArgs = False , optReferenceLinks = False @@ -340,6 +340,18 @@ options = (\opt -> return opt { optTableOfContents = True })) "" -- "Include table of contents" + , Option "" ["toc-level"] + (ReqArg + (\arg opt -> do + case safeRead arg of + Just t | t >= 1 && t <= 6 -> + return opt { optTOCLevel = t, + optTableOfContents = True } + _ -> err 57 $ + "TOC level must be a number between 1 and 6") + "NUMBER") + "" -- "Number of levels to include in TOC" + , Option "" ["no-highlight"] (NoArg (\opt -> return opt { optHighlight = False })) @@ -569,17 +581,6 @@ options = "NUMBER") "" -- "Header level at which to split chapters in EPUB" - , Option "" ["epub-toc-level"] - (ReqArg - (\arg opt -> do - case safeRead arg of - Just t | t >= 1 && t <= 6 -> - return opt { optEpubTOCLevel = t } - _ -> err 57 $ - "TOC level must be a number between 1 and 6") - "NUMBER") - "" -- "Number of levels to include in EPUB TOC" - , Option "" ["latex-engine"] (ReqArg (\arg opt -> do @@ -830,7 +831,7 @@ main = do , optEpubMetadata = epubMetadata , optEpubFonts = epubFonts , optEpubChapterLevel = epubChapterLevel - , optEpubTOCLevel = epubTOCLevel + , optTOCLevel = epubTOCLevel , optDumpArgs = dumpArgs , optIgnoreArgs = ignoreArgs , optReferenceLinks = referenceLinks @@ -1021,7 +1022,7 @@ main = do writerEpubStylesheet = epubStylesheet, writerEpubFonts = epubFonts, writerEpubChapterLevel = epubChapterLevel, - writerEpubTOCLevel = epubTOCLevel, + writerTOCLevel = epubTOCLevel, writerReferenceODT = referenceODT, writerReferenceDocx = referenceDocx } |