diff --git a/data/templates b/data/templates index 7ac22fea6..85ec1ef27 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit 7ac22fea6399ce6fdac093fa9d163d09fc28d440 +Subproject commit 85ec1ef277e914576af176b5ab43bcc27fa51936 diff --git a/pandoc.hs b/pandoc.hs index 322e74233..8ec570bb3 100644 --- a/pandoc.hs +++ b/pandoc.hs @@ -1113,7 +1113,7 @@ main = do >>= writerFn outputFile . handleEntities where htmlFormat = writerName' `elem` ["html","html+lhs","html5","html5+lhs", - "s5","slidy","slideous","dzslides"] + "s5","slidy","slideous","dzslides","reveal_js"] selfcontain = if selfContained && htmlFormat then makeSelfContained datadir else return diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs index ca923d091..7e9932c1b 100644 --- a/src/Text/Pandoc.hs +++ b/src/Text/Pandoc.hs @@ -231,6 +231,9 @@ writers = [ ,("dzslides" , PureStringWriter $ \o -> writeHtmlString o{ writerSlideVariant = DZSlides , writerHtml5 = True }) + ,("reveal_js" , PureStringWriter $ \o -> + writeHtmlString o{ writerSlideVariant = RevealJsSlides + , writerHtml5 = True }) ,("docbook" , PureStringWriter writeDocbook) ,("opml" , PureStringWriter writeOPML) ,("opendocument" , PureStringWriter writeOpenDocument) diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs index 39fa2a1b2..6549c506b 100644 --- a/src/Text/Pandoc/Options.hs +++ b/src/Text/Pandoc/Options.hs @@ -255,6 +255,7 @@ data HTMLSlideVariant = S5Slides | SlidySlides | SlideousSlides | DZSlides + | RevealJsSlides | NoSlides deriving (Show, Read, Eq) diff --git a/src/Text/Pandoc/Slides.hs b/src/Text/Pandoc/Slides.hs index b69057b7a..09d356a4a 100644 --- a/src/Text/Pandoc/Slides.hs +++ b/src/Text/Pandoc/Slides.hs @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Portability : portable Utility functions for splitting documents into slides for slide -show formats (dzslides, s5, slidy, slideous, beamer). +show formats (dzslides, reveal_js, s5, slidy, slideous, beamer). -} module Text.Pandoc.Slides ( getSlideLevel, prepSlides ) where import Text.Pandoc.Definition diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 1ea4442f9..fa64a8212 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -224,13 +224,20 @@ prefixedId opts s = "" -> mempty _ -> A.id $ toValue $ writerIdentifierPrefix opts ++ s --- | Replacement for Text.XHtml's unordList. -unordList :: WriterOptions -> ([Html] -> Html) -unordList opts items = H.ul $ mconcat $ toListItems opts items +toList :: (Html -> Html) -> WriterOptions -> ([Html] -> Html) +toList listop opts items = do + let items' = toListItems opts items + if (writerIncremental opts) + then if (writerSlideVariant opts /= RevealJsSlides) + then (listop $ mconcat items') ! A.class_ "incremental" + else listop $ mconcat $ map (! A.class_ "fragment") items' + else listop $ mconcat items' --- | Replacement for Text.XHtml's ordList. -ordList :: WriterOptions -> ([Html] -> Html) -ordList opts items = H.ol $ mconcat $ toListItems opts items +unordList :: WriterOptions -> [Html] -> Html +unordList = toList H.ul + +ordList :: WriterOptions -> [Html] -> Html +ordList = toList H.ol -- | Construct table of contents from list of elements. tableOfContents :: WriterOptions -> [Element] -> State WriterState (Maybe Html) @@ -476,18 +483,11 @@ blockToHtml opts (Header level (ident,_,_) lst) = do _ -> H.p contents'' blockToHtml opts (BulletList lst) = do contents <- mapM (blockListToHtml opts) lst - let lst' = unordList opts contents - let lst'' = if writerIncremental opts - then lst' ! A.class_ "incremental" - else lst' - return lst'' + return $ unordList opts contents blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do contents <- mapM (blockListToHtml opts) lst let numstyle' = camelCaseToHyphenated $ show numstyle - let attribs = (if writerIncremental opts - then [A.class_ "incremental"] - else []) ++ - (if startnum /= 1 + let attribs = (if startnum /= 1 then [A.start $ toValue startnum] else []) ++ (if numstyle /= DefaultStyle