diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-07-13 23:21:16 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-07-13 23:21:16 +0000 |
commit | ff43ff6229c9c6bdb2491142f0d5954a370b9583 (patch) | |
tree | 3132d85c7c122e312a54d8ca8bf961ed9c4de887 /templates/S5.hs | |
parent | 5fb67cab88c60cbd47cd3ebdc6ec365a7f04d12b (diff) | |
download | pandoc-ff43ff6229c9c6bdb2491142f0d5954a370b9583.tar.gz |
Code cleanup in S5 writer template.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1312 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'templates/S5.hs')
-rw-r--r-- | templates/S5.hs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/templates/S5.hs b/templates/S5.hs index 68787c3db..e2c02f40d 100644 --- a/templates/S5.hs +++ b/templates/S5.hs @@ -86,14 +86,18 @@ writeS5String options = (writeHtmlString options) . insertS5Structure layoutDiv :: [Inline] -- ^ Title of document (for header or footer) -> String -- ^ Date of document (for header or footer) -> [Block] -- ^ List of block elements returned -layoutDiv title date = [(RawHtml "<div class=\"layout\">\n<div id=\"controls\"></div>\n<div id=\"currentSlide\"></div>\n<div id=\"header\"></div>\n<div id=\"footer\">\n"), (Header 1 [Str date]), (Header 2 title), (RawHtml "</div>\n</div>\n")] +layoutDiv title' date = [(RawHtml "<div class=\"layout\">\n<div id=\"controls\"></div>\n<div id=\"currentSlide\"></div>\n<div id=\"header\"></div>\n<div id=\"footer\">\n"), (Header 1 [Str date]), (Header 2 title'), (RawHtml "</div>\n</div>\n")] +presentationStart :: Block presentationStart = RawHtml "<div class=\"presentation\">\n\n" +presentationEnd :: Block presentationEnd = RawHtml "</div>\n" +slideStart :: Block slideStart = RawHtml "<div class=\"slide\">\n" +slideEnd :: Block slideEnd = RawHtml "</div>\n" -- | Returns 'True' if block is a Header 1. @@ -120,14 +124,14 @@ insertSlides beginning blocks = -- | Insert blocks into 'Pandoc' for slide structure. insertS5Structure :: Pandoc -> Pandoc -insertS5Structure (Pandoc meta []) = Pandoc meta [] -insertS5Structure (Pandoc (Meta title authors date) blocks) = +insertS5Structure (Pandoc meta' []) = Pandoc meta' [] +insertS5Structure (Pandoc (Meta title' authors date) blocks) = let slides = insertSlides True blocks - firstSlide = if not (null title) - then [slideStart, (Header 1 title), + firstSlide = if not (null title') + then [slideStart, (Header 1 title'), (Header 3 [Str (joinWithSep ", " authors)]), (Header 4 [Str date]), slideEnd] else [] - newBlocks = (layoutDiv title date) ++ presentationStart:firstSlide ++ + newBlocks = (layoutDiv title' date) ++ presentationStart:firstSlide ++ slides ++ [presentationEnd] - in Pandoc (Meta title authors date) newBlocks + in Pandoc (Meta title' authors date) newBlocks |