aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-12-30 11:42:05 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-12-30 11:42:05 -0800
commitedf646a90de4dcb420a7b7426d266335e2f7c67f (patch)
tree2dc2957a70ba200b7740e7569fd97334435176d0 /src
parentc5c7aa653ae7ce50a2d2aa7b276cf7288f69cb7f (diff)
downloadpandoc-edf646a90de4dcb420a7b7426d266335e2f7c67f.tar.gz
ConTeXt writer: Made `--toc` work even without `--number-sections`.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index ad27daffe..58cba268f 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -76,6 +76,7 @@ pandocToConTeXt options (Pandoc (Meta title authors date) blocks) = do
, ("body", main)
, ("title", titletext)
, ("date", datetext) ] ++
+ [ ("number-sections", "yes") | writerNumberSections options ] ++
[ ("author", a) | a <- authorstext ]
return $ if writerStandalone options
then renderTemplate context $ writerTemplate options
@@ -175,11 +176,10 @@ blockToConTeXt (Header level lst) = do
contents <- inlineListToConTeXt lst
st <- get
let opts = stOptions st
- let base = if writerNumberSections opts then "section" else "subject"
let level' = if writerChapters opts then level - 1 else level
return $ if level' >= 1 && level' <= 5
then char '\\' <> text (concat (replicate (level' - 1) "sub")) <>
- text base <> char '{' <> contents <> char '}' <> blankline
+ text "section" <> char '{' <> contents <> char '}' <> blankline
else if level' == 0
then "\\chapter{" <> contents <> "}"
else contents <> blankline