Commit 5320521e authored by Henrik Tramberend's avatar Henrik Tramberend
Browse files

Ensure verisoned support dir exists whenever a html file is generated

parent 45fd3144
{-- Author: Henrik Tramberend <henrik@tramberend.de> --}
import Action
import Context
import Control.Exception
import Control.Monad ()
......@@ -21,7 +22,6 @@ import qualified Text.Mustache as M ()
import Text.Pandoc ()
import Text.Printf ()
import Utilities
import Action
main :: IO ()
main = do
......@@ -59,9 +59,13 @@ main = do
--
phony "version" $ putNormal $ "decker version " ++ deckerVersion
--
phony "decks" $ decksA >>= need
phony "decks" $ do
decksA >>= need
need ["support"]
--
phony "html" $ everythingA <++> indexA >>= need
phony "html" $ do
everythingA <++> indexA >>= need
need ["support"]
--
phony "pdf" $ pagesPdfA <++> handoutsPdfA <++> indexA >>= need
--
......@@ -72,12 +76,12 @@ main = do
allMarkdownA <++> metaA <++> allImagesA >>= watchFiles
--
phony "server" $ do
need ["watch", "support"]
need ["watch"]
runHttpServer dirs True
--
phony "example" writeExampleProject
--
phony "index" $ need [index]
phony "index" $ need [index, "support"]
--
priority 2 $
"//*-deck.html" %> \out -> do
......@@ -173,4 +177,3 @@ main = do
-- Calculate some directories
-- | Some constants that might need tweaking
options = shakeOptions {shakeFiles = ".shake"}
......@@ -94,7 +94,6 @@ $body$
<script src="$revealjs-url$/js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
......
......@@ -124,7 +124,7 @@ projectDirectories = do
projectDir <- findProjectDirectory
let publicDir = projectDir </> "public"
let cacheDir = publicDir </> "cache"
let supportDir = publicDir </> "support"
let supportDir = publicDir </> ("support" ++ "-" ++ deckerVersion)
let logDir = projectDir </> "log"
return (ProjectDirs projectDir publicDir cacheDir supportDir logDir)
......
......@@ -529,11 +529,11 @@ writeExampleProject = mapM_ writeOne deckerExampleDir
putNormal $ "# create (for " ++ path ++ ")"
writeEmbeddedFiles :: [(FilePath, B.ByteString)] -> FilePath -> Action ()
writeEmbeddedFiles files dir
-- let absolute = map (\(path, contents) -> (dir </> path, contents)) files
= do
let absolute = map (first (dir </>)) files
mapM_ write absolute
writeEmbeddedFiles files dir = do
exists <- doesDirectoryExist dir
unless exists $ do
let absolute = map (first (dir </>)) files
mapM_ write absolute
where
write (path, contents) = do
liftIO $ Dir.createDirectoryIfMissing True (takeDirectory path)
......
---
history: True
---
# Video Autoplay
## Slides
- Video without autoplay
- Video with autoplay
# Autoplay off
![](movie.mp4){controls="1"}
# Autoplay on
![](movie.mp4){controls="1" data-autoplay="1"}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment