From c5ed016616e1e6fef1801c98ef61a5eae6a3af55 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 22 Jul 2010 21:50:17 -0700 Subject: Added new --offline option for slidy. Added slidy/slidy.min.{css,js}. --- src/pandoc.hs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'src/pandoc.hs') diff --git a/src/pandoc.hs b/src/pandoc.hs index 31c43d907..cb1756ffb 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -144,6 +144,7 @@ data Opt = Opt , optNumberSections :: Bool -- ^ Number sections in LaTeX , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML , optIncremental :: Bool -- ^ Use incremental lists in Slidy/S5 + , optOffline :: Bool -- ^ Make slideshow accessible offline , optXeTeX :: Bool -- ^ Format latex for xetex , optSmart :: Bool -- ^ Use smart typography , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math @@ -185,6 +186,7 @@ defaultOpts = Opt , optNumberSections = False , optSectionDivs = False , optIncremental = False + , optOffline = False , optXeTeX = False , optSmart = False , optHTMLMathMethod = PlainMath @@ -317,6 +319,11 @@ options = (\opt -> return opt { optIncremental = True })) "" -- "Make list items display incrementally in Slidy/S5" + , Option "" ["offline"] + (NoArg + (\opt -> return opt { optOffline = True })) + "" -- "Make slide shows include all the needed js and css" + , Option "" ["xetex"] (NoArg (\opt -> return opt { optXeTeX = True })) @@ -652,6 +659,7 @@ main = do , optNumberSections = numberSections , optSectionDivs = sectionDivs , optIncremental = incremental + , optOffline = offline , optXeTeX = xetex , optSmart = smart , optHTMLMathMethod = mathMethod @@ -735,11 +743,18 @@ main = do refs <- if null biblioFile then return [] else readBiblioFile biblioFile biblioFormat #endif - variables' <- if writerName' == "s5" && standalone' - then do - inc <- s5HeaderIncludes datadir - return $ ("header-includes", inc) : variables - else return variables + variables' <- case (writerName', standalone', offline) of + ("s5", True, True) -> do + inc <- s5HeaderIncludes datadir + return $ ("header-includes", inc) : variables + ("slidy", True, True) -> do + slidyJs <- readDataFile datadir $ + "slidy" "slidy.min.js" + slidyCss <- readDataFile datadir $ + "slidy" "slidy.min.css" + return $ ("slidy-js", slidyJs) : + ("slidy-css", slidyCss) : variables + _ -> return variables variables'' <- case mathMethod of LaTeXMathML Nothing -> do -- cgit v1.2.3