From 65d01857fbb4041b68ce3767773c151b4f135a27 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 5 Jan 2013 18:14:52 -0800 Subject: Support --toc-depth in context writer. --- data/templates | 2 +- src/Text/Pandoc/Writers/ConTeXt.hs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/data/templates b/data/templates index 25ad173f0..f0347e7af 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit 25ad173f00bc7e07c72468deb1d955f707aeaea0 +Subproject commit f0347e7af09f8aad32287b2b2d808cfb57e4e50e diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index df11d79cc..c67daf13d 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -74,6 +74,12 @@ pandocToConTeXt options (Pandoc (Meta title authors date) blocks) = do let main = (render colwidth . vcat) body let context = writerVariables options ++ [ ("toc", if writerTableOfContents options then "yes" else "") + , ("placelist", intercalate "," $ + take (writerTOCDepth options + if writerChapters options + then 0 + else 1) + ["chapter","section","subsection","subsubsection", + "subsubsubsection","subsubsubsubsection"]) , ("body", main) , ("title", titletext) , ("date", datetext) ] ++ -- cgit v1.2.3