diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-07-13 23:41:18 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-07-13 23:41:18 -0700 |
commit | 255aa7eb6e7f7176d3b7f339cb8035bc27a343af (patch) | |
tree | 66a8d66ce3e35ffaf8194b2c1beb06c136714595 /src/Text | |
parent | 9b833e874457d41914d097f1c7cb4b1da636fb4c (diff) | |
download | pandoc-255aa7eb6e7f7176d3b7f339cb8035bc27a343af.tar.gz |
Improved Slidy writer.
We now carve up slides at HorizontalRules, rather than by level-1
headers. This gives the user lots of flexibility.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 15 |
1 files changed, 12 insertions, 3 deletions
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 "</div>\n<div class=\"slide\">\n" : + cutUp xs + cutUp (x:xs) = x : cutUp xs + cutUp [] = [] + blocks' <- liftM toHtmlFromList $ + case writerSlideVariant opts of + SlidySlides -> mapM (blockToHtml opts) $ + RawHtml "<div class=\"slide\">\n" : + cutUp blocks ++ + [RawHtml "</div>"] + _ -> 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 && |