git.iko.soy/typeable/pandoc
on master help sign in
Implemented --toc-depth (and --toc!) for RTF writer.
commit4343f0dbcd941394e1e5bb3eeff1c14dbfbbe3ec authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 5 Jan 2013, 18:23 (14 years ago) parent65d0185
2 files changed+4−2
data/templates+1−1 src/Text/Pandoc/Writers/RTF.hs+3−1
data/templates+1−1

Submodule changed.

src/Text/Pandoc/Writers/RTF.hs+3−1
@@ -72,13 +72,15 @@ writeRTF options (Pandoc (Meta title authors date) blocks) =
7272 datetext = inlineListToRTF date
7373 spacer = not $ all null $ titletext : datetext : authorstext
7474 body = concatMap (blockToRTF 0 AlignDefault) blocks
75+ isTOCHeader (Header lev _) = lev <= writerTOCDepth options
76+ isTOCHeader _ = False
7577 context = writerVariables options ++
7678 [ ("body", body)
7779 , ("title", titletext)
7880 , ("date", datetext) ] ++
7981 [ ("author", a) | a <- authorstext ] ++
8082 [ ("spacer", "yes") | spacer ] ++
81− [ ("toc", tableOfContents $ filter isHeaderBlock blocks) |
83+ [ ("toc", tableOfContents $ filter isTOCHeader blocks) |
8284 writerTableOfContents options ]
8385 in if writerStandalone options
8486 then renderTemplate context $ writerTemplate options