From ff43ff6229c9c6bdb2491142f0d5954a370b9583 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 13 Jul 2008 23:21:16 +0000 Subject: [PATCH] Code cleanup in S5 writer template. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1312 788f1e2b-df1e-0410-8736-df70ead52e1b --- templates/S5.hs | 18 +++++++++++------- 1 file 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 "
\n
\n
\n
\n
\n"), (Header 1 [Str date]), (Header 2 title), (RawHtml "
\n
\n")] +layoutDiv title' date = [(RawHtml "
\n
\n
\n
\n
\n"), (Header 1 [Str date]), (Header 2 title'), (RawHtml "
\n
\n")] +presentationStart :: Block presentationStart = RawHtml "
\n\n" +presentationEnd :: Block presentationEnd = RawHtml "
\n" +slideStart :: Block slideStart = RawHtml "
\n" +slideEnd :: Block slideEnd = RawHtml "
\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