aboutsummaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-07-22 21:50:17 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2010-07-22 21:50:53 -0700
commitc5ed016616e1e6fef1801c98ef61a5eae6a3af55 (patch)
tree993b4456dd185060bc4edd84e2077b49d0fdd6d8 /src/pandoc.hs
parent5fd13892634b70c83ac4873e97f983bd3e491638 (diff)
downloadpandoc-c5ed016616e1e6fef1801c98ef61a5eae6a3af55.tar.gz
Added new --offline option for slidy.
Added slidy/slidy.min.{css,js}.
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs25
1 files changed, 20 insertions, 5 deletions
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