From 255aa7eb6e7f7176d3b7f339cb8035bc27a343af Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 13 Jul 2010 23:41:18 -0700 Subject: Improved Slidy writer. We now carve up slides at HorizontalRules, rather than by level-1 headers. This gives the user lots of flexibility. --- src/Text/Pandoc/Writers/HTML.hs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index cd03a51b5..3f9a417d2 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -104,7 +104,17 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do toc <- if writerTableOfContents opts then tableOfContents opts sects else return Nothing - blocks' <- liftM toHtmlFromList $ mapM (elementToHtml opts) sects + let cutUp (HorizontalRule : xs) = RawHtml "\n
\n" : + cutUp xs + cutUp (x:xs) = x : cutUp xs + cutUp [] = [] + blocks' <- liftM toHtmlFromList $ + case writerSlideVariant opts of + SlidySlides -> mapM (blockToHtml opts) $ + RawHtml "
\n" : + cutUp blocks ++ + [RawHtml "
"] + _ -> mapM (elementToHtml opts) sects st <- get let notes = reverse (stNotes st) let thebody = blocks' +++ footnoteSection notes @@ -199,8 +209,7 @@ elementToHtml opts (Sec level num id' title' elements) = do header' <- blockToHtml opts (Header level title') let stuff = header' : innerContents return $ case writerSlideVariant opts of - SlidySlides | level == 1 -> - thediv ! [prefixedId opts id', theclass "slide"] << stuff + SlidySlides -> toHtmlFromList stuff S5Slides -> toHtmlFromList stuff -- S5 gets confused by the extra divs around sections _ | (writerStrictMarkdown opts && -- cgit v1.2.3