From 465a4a66993eba9017faa950a9737ae1c5f68786 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 18 Jul 2010 23:05:48 -0700 Subject: Slidy writer: create new slide at every level 1 header. --- README | 8 +++----- src/Text/Pandoc/Writers/HTML.hs | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README b/README index 72d2c01b5..0b1f0c11f 100644 --- a/README +++ b/README @@ -1349,11 +1349,9 @@ directory. Using Slidy ----------- -If you use Slidy, things work a bit differently. Instead of -automatically chopping the document into sections on the level-1 -headers, you can choose how to segment the document into slides -yourself. Just insert a horizontal rule at each slide boundary. -For example: +If you use Slidy, things work a bit differently. As with S5, a new slide +will be created at every level 1 header. But you can also force a new +slide by inserting a horizontal rule. For example: % Eating Habits % John Doe diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index a0366006d..98e3045d3 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -105,8 +105,11 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do toc <- if writerTableOfContents opts then tableOfContents opts sects else return Nothing - let cutUp (HorizontalRule : xs) = RawHtml "\n
\n" : + let cutUp (HorizontalRule : Header 1 ys : xs) = cutUp (Header 1 ys : xs) + cutUp (HorizontalRule : xs) = RawHtml "
\n
\n" : cutUp xs + cutUp (Header 1 ys : xs) = RawHtml ("
\n
\n") : + Header 1 ys : cutUp xs cutUp (x:xs) = x : cutUp xs cutUp [] = [] blocks' <- liftM toHtmlFromList $ -- cgit v1.2.3