From 9b833e874457d41914d097f1c7cb4b1da636fb4c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 13 Jul 2010 20:44:56 -0700 Subject: Added a slidy writer. Resolves Issue #122. --- src/Text/Pandoc/Writers/HTML.hs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 08cd18ad0..cd03a51b5 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -197,10 +197,16 @@ elementToHtml opts (Sec level num id' title' elements) = do innerContents <- mapM (elementToHtml opts) elements modify $ \st -> st{stSecNum = num} -- update section number header' <- blockToHtml opts (Header level title') - return $ if writerS5 opts || (writerStrictMarkdown opts && not (writerTableOfContents opts)) - -- S5 gets confused by the extra divs around sections - then toHtmlFromList (header' : innerContents) - else thediv ! [prefixedId opts id'] << (header' : innerContents) + let stuff = header' : innerContents + return $ case writerSlideVariant opts of + SlidySlides | level == 1 -> + thediv ! [prefixedId opts id', theclass "slide"] << stuff + S5Slides -> toHtmlFromList stuff + -- S5 gets confused by the extra divs around sections + _ | (writerStrictMarkdown opts && + not (writerTableOfContents opts)) -> + toHtmlFromList stuff + _ -> thediv ! [prefixedId opts id'] << stuff -- | Convert list of Note blocks to a footnote
. -- Assumes notes are sorted. @@ -296,7 +302,7 @@ blockToHtml opts (BlockQuote blocks) = -- in S5, treat list in blockquote specially -- if default is incremental, make it nonincremental; -- otherwise incremental - if writerS5 opts + if writerSlideVariant opts /= NoSlides then let inc = not (writerIncremental opts) in case blocks of [BulletList lst] -> blockToHtml (opts {writerIncremental = inc}) -- cgit v1.2.3