git.iko.soy/typeable/pandoc
on master help sign in
Changed --toc-level to --toc-depth.
commitc45ae571ccee3cd0e6aa11b3b43e8eaf6315386b authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 5 Jan 2013, 12:03 (14 years ago) parent2e08945
7 files changed+13−13
README+1−1 data/templates+1−1 pandoc.hs+6−6 src/Text/Pandoc/Options.hs+2−2 src/Text/Pandoc/Writers/EPUB.hs+1−1 src/Text/Pandoc/Writers/LaTeX.hs+1−1 src/Text/Pandoc/Writers/RST.hs+1−1
README+1−1
@@ -296,7 +296,7 @@ General writer options
296296 one) in the output document. This option has no effect on `man`,
297297 `docbook`, `slidy`, `slideous`, or `s5` output.
298298
299−`--toc-level=`*NUMBER*
299+`--toc-depth=`*NUMBER*
300300: Specify the number of section levels to include in the table
301301 of contents. The default is 3 (which means that level 1, 2, and 3
302302 headers will be listed in the contents). Implies `--toc`.
data/templates+1−1

Submodule changed.

pandoc.hs+6−6
@@ -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− , optTOCLevel :: Int -- ^ Number of levels to include in TOC
118+ , optTOCDepth :: 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− , optTOCLevel = 3
172+ , optTOCDepth = 3
173173 , optDumpArgs = False
174174 , optIgnoreArgs = False
175175 , optReferenceLinks = False
@@ -340,12 +340,12 @@ options =
340340 (\opt -> return opt { optTableOfContents = True }))
341341 "" -- "Include table of contents"
342342
343− , Option "" ["toc-level"]
343+ , Option "" ["toc-depth"]
344344 (ReqArg
345345 (\arg opt -> do
346346 case safeRead arg of
347347 Just t | t >= 1 && t <= 6 ->
348− return opt { optTOCLevel = t,
348+ return opt { optTOCDepth = t,
349349 optTableOfContents = True }
350350 _ -> err 57 $
351351 "TOC level must be a number between 1 and 6")
@@ -831,7 +831,7 @@ main = do
831831 , optEpubMetadata = epubMetadata
832832 , optEpubFonts = epubFonts
833833 , optEpubChapterLevel = epubChapterLevel
834− , optTOCLevel = epubTOCLevel
834+ , optTOCDepth = epubTOCDepth
835835 , optDumpArgs = dumpArgs
836836 , optIgnoreArgs = ignoreArgs
837837 , optReferenceLinks = referenceLinks
@@ -1022,7 +1022,7 @@ main = do
10221022 writerEpubStylesheet = epubStylesheet,
10231023 writerEpubFonts = epubFonts,
10241024 writerEpubChapterLevel = epubChapterLevel,
1025− writerTOCLevel = epubTOCLevel,
1025+ writerTOCDepth = epubTOCDepth,
10261026 writerReferenceODT = referenceODT,
10271027 writerReferenceDocx = referenceDocx
10281028 }
src/Text/Pandoc/Options.hs+2−2
@@ -238,7 +238,7 @@ data WriterOptions = WriterOptions
238238 , writerEpubStylesheet :: Maybe String -- ^ EPUB stylesheet specified at command line
239239 , writerEpubFonts :: [FilePath] -- ^ Paths to fonts to embed
240240 , writerEpubChapterLevel :: Int -- ^ Header level for chapters (separate files)
241− , writerTOCLevel :: Int -- ^ Number of levels to include in TOC
241+ , writerTOCDepth :: Int -- ^ Number of levels to include in TOC
242242 , writerReferenceODT :: Maybe FilePath -- ^ Path to reference ODT if specified
243243 , writerReferenceDocx :: Maybe FilePath -- ^ Ptah to reference DOCX if specified
244244 } deriving Show
@@ -278,7 +278,7 @@ instance Default WriterOptions where
278278 , writerEpubStylesheet = Nothing
279279 , writerEpubFonts = []
280280 , writerEpubChapterLevel = 1
281− , writerTOCLevel = 3
281+ , writerTOCDepth = 3
282282 , writerReferenceODT = Nothing
283283 , writerReferenceDocx = Nothing
284284 }
src/Text/Pandoc/Writers/EPUB.hs+1−1
@@ -229,7 +229,7 @@ writeEPUB version opts doc@(Pandoc meta _) = do
229229 -- toc.ncx
230230 let secs = hierarchicalize blocks''
231231
232− let tocLevel = writerTOCLevel opts
232+ let tocLevel = writerTOCDepth opts
233233
234234 let navPointNode :: (Int -> String -> String -> [Element] -> Element)
235235 -> Shared.Element -> State Int Element
src/Text/Pandoc/Writers/LaTeX.hs+1−1
@@ -131,7 +131,7 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
131131 _ -> []
132132 context = writerVariables options ++
133133 [ ("toc", if writerTableOfContents options then "yes" else "")
134− , ("toc-level", show (writerTOCLevel options -
134+ , ("toc-depth", show (writerTOCDepth options -
135135 if writerChapters options
136136 then 1
137137 else 0))
src/Text/Pandoc/Writers/RST.hs+1−1
@@ -81,7 +81,7 @@ pandocToRST (Pandoc (Meta tit auth dat) blocks) = do
8181 , ("title", render Nothing title)
8282 , ("date", render colwidth date)
8383 , ("toc", if writerTableOfContents opts then "yes" else "")
84− , ("toc-level", show (writerTOCLevel opts)) ] ++
84+ , ("toc-depth", show (writerTOCDepth opts)) ] ++
8585 [ ("math", "yes") | hasMath ] ++
8686 [ ("author", render colwidth a) | a <- authors ]
8787 if writerStandalone opts