From ab20da4be50c31a4c31574f73c74367aaea150f3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 16 Jan 2011 09:08:19 -0800 Subject: Support --chapters for ConTeXt output as well. --- src/Text/Pandoc/Writers/ConTeXt.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index 8e0387a84..b693bf7fa 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -169,10 +169,13 @@ blockToConTeXt (Header level lst) = do st <- get let opts = stOptions st let base = if writerNumberSections opts then "section" else "subject" - return $ if level >= 1 && level <= 5 - then char '\\' <> text (concat (replicate (level - 1) "sub")) <> + 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 - else contents <> blankline + else if level' == 0 + then "\\chapter{" <> contents <> "}" + else contents <> blankline blockToConTeXt (Table caption aligns widths heads rows) = do let colDescriptor colWidth alignment = (case alignment of AlignLeft -> 'l' -- cgit v1.2.3