From 31fb776c32ad24dd4e9fbf8e547350423ff53ccd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 29 Dec 2011 17:41:06 -0800 Subject: DZSlides: Added dzslides/template.html. This is the unaltered file from the dzslides repository. Pandoc now reads it, looking for the core part, and includes this in the new dzslides template via the 'dzslides-core' variable. When dzslides is updated, you can just put the new template.html in your `~/.pandoc/dzslides` directory, and things should work -- provided the core part can be identified as everything from + + +
+ +

My Presentation

+
by John Doe
+
+ +
+

Part one

+
+ +
+

An incremental list

+ +
+ +
+ + Soothe us with sweet lies. Is that a cooking show? No! I want to + live! There are still too many things I don't own! + +
+ +
+

Part two

+
+ +
+

An image

+ +
+ +
+

A video

+ +
+ +
+

End!

+
+ + + + + + + + + + + + + + + + + + + diff --git a/pandoc.cabal b/pandoc.cabal index 13e5d2375..d865862a3 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -74,6 +74,8 @@ Data-Files: slidy/graphics/nofold-dim.gif, slidy/graphics/unfold-dim.gif, slidy/graphics/fold-dim.gif, + -- data for dzslides writer + dzslides/template.html, -- data for citeproc default.csl, -- documentation diff --git a/src/pandoc.hs b/src/pandoc.hs index 6944a6a78..190248a29 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -40,7 +40,7 @@ import System.Exit ( exitWith, ExitCode (..) ) import System.FilePath import System.Console.GetOpt import Data.Char ( toLower ) -import Data.List ( intercalate, isSuffixOf ) +import Data.List ( intercalate, isSuffixOf, isPrefixOf ) import System.Directory ( getAppUserDataDirectory, doesFileExist ) import System.IO ( stdout, stderr ) import System.IO.Error ( isDoesNotExistError ) @@ -798,6 +798,12 @@ main = do (\_ -> throwIO e) else throwIO e) + let slideVariant = case writerName' of + "s5" -> S5Slides + "slidy" -> SlidySlides + "dzslides" -> DZSlides + _ -> NoSlides + variables' <- case mathMethod of LaTeXMathML Nothing -> do s <- readDataFile datadir $ "data" "LaTeXMathML.js" @@ -807,6 +813,14 @@ main = do return $ ("mathml-script", s) : variables _ -> return variables + variables'' <- case slideVariant of + DZSlides -> do + dztempl <- readDataFile datadir $ "dzslides" "template.html" + let dzcore = unlines $ dropWhile (not . isPrefixOf "