diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2011-10-01 22:57:03 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2011-10-01 23:02:24 -0700 |
commit | 9b37c9cc35eff9008005afa3efc2e0855b89e056 (patch) | |
tree | 627495f0cbd29c974bdca980ad0fab26033f290b /src/Text/Pandoc | |
parent | 22e43b8e1711e9470216cd114218d8fe62973bba (diff) | |
download | pandoc-9b37c9cc35eff9008005afa3efc2e0855b89e056.tar.gz |
Added dzslides output option.
* Added DZSlides to HTMLSlideVariant.
* Added support for dzslides in HTML writer.
* Added dzslides template.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 1 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 12 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 9717e1bc8..be34bc823 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -458,6 +458,7 @@ data ObfuscationMethod = NoObfuscation -- | Varieties of HTML slide shows. data HTMLSlideVariant = S5Slides | SlidySlides + | DZSlides | NoSlides deriving (Show, Read, Eq) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 573adbf4a..25904e93f 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -226,8 +226,13 @@ elementToListItem opts (Sec _ num id' headerText subsecs) = do -- | Convert an Element to Html. elementToHtml :: WriterOptions -> Element -> State WriterState Html -elementToHtml opts (Blk HorizontalRule) | writerSlideVariant opts /= NoSlides = +elementToHtml opts (Blk HorizontalRule) + | writerSlideVariant opts == S5Slides || + writerSlideVariant opts == SlidySlides = return $ primHtml "</div>" +++ nl opts +++ primHtml "<div class=\"slide\">" +elementToHtml opts (Blk HorizontalRule) + | writerSlideVariant opts == DZSlides = + return $ primHtml "</section>" +++ nl opts +++ primHtml "<section>" elementToHtml opts (Blk block) = blockToHtml opts block elementToHtml opts (Sec level num id' title' elements) = do modify $ \st -> st{stSecNum = num} -- update section number @@ -239,12 +244,13 @@ elementToHtml opts (Sec level num id' title' elements) = do writerSlideVariant opts == S5Slides)] let stuff = header'' : innerContents let slide = writerSlideVariant opts /= NoSlides && level == 1 - let stuff' = if slide + let stuff' = if (writerSlideVariant opts == S5Slides || + writerSlideVariant opts == SlidySlides) && level == 1 then [thediv ! [theclass "slide"] << (nl opts : intersperse (nl opts) stuff ++ [nl opts])] else intersperse (nl opts) stuff let inNl x = nl opts : x ++ [nl opts] - return $ if writerSectionDivs opts + return $ if writerSectionDivs opts || writerSlideVariant opts == DZSlides then if writerHtml5 opts then tag "section" ! [prefixedId opts id'] << inNl stuff' else thediv ! [prefixedId opts id'] << inNl stuff' |