Commit b15cfa0d authored by Henrik Tramberend's avatar Henrik Tramberend
Browse files

Handouts now contain slide content and notes

parent df9a862e
......@@ -75,6 +75,15 @@ h3 {
}
address p.date {
float: right;
}
.container img {
width: 75%;
margin: 0px auto;
}
.container video {
width: 75%;
margin: 0px auto;
}
</style>
......
......@@ -90,7 +90,17 @@ $endfor$
.container address p.date {
float: right;
}
</style>
.container img {
width: 75%;
margin: 0px auto;
}
.container video {
width: 75%;
margin: 0px auto;
}
</style>
$if(math)$
$math$
......
......@@ -5,6 +5,7 @@ module Filter
( expandMacros
, makeSlides
, filterNotes
, makeBoxes
, useCachedImages
, escapeToFilePath
, cachePandocImages
......@@ -259,6 +260,9 @@ makeSlides (Just (Format "beamer")) =
walk (mapSlides wrapBoxes) . walk (mapSlides wrapNoteBeamer)
makeSlides _ = Prelude.id
makeBoxes :: Pandoc -> Pandoc
makeBoxes = walk (mapSlides wrapBoxes)
-- Only consider slides that have the 'notes' class in their header. In all
-- others pick only the boxes that are tagged as notes.
filterSlides :: [Block] -> [Block]
......@@ -337,10 +341,7 @@ videoExtensions =
renderImageVideo :: Inline -> IO Inline
renderImageVideo image@(Image (ident, cls, values) inlines (url, tit)) =
if takeExtension url `elem` videoExtensions
then do
let html = renderHtml videoTag
putStrLn html
return $ RawInline (Format "html") html
then return $ RawInline (Format "html") (renderHtml videoTag)
else return image
where
appendAttr element (key, value) =
......@@ -349,5 +350,6 @@ renderImageVideo image@(Image (ident, cls, values) inlines (url, tit)) =
foldl appendAttr video values ! A.id (toValue ident) !
class_ (toValue $ unwords cls) !
alt (toValue $ stringify inlines) !
title (toValue tit) $ source ! src (toValue url)
title (toValue tit) $
source ! src (toValue url)
renderImageVideo inline = return inline
......@@ -201,9 +201,7 @@ findFile dirs base path = do
Nothing ->
throw $
ResourceException $ "Cannot find local file system resource: " ++ path
Just resource -> do
putStrLn $ "local resource: " ++ resource
return resource
Just resource -> return resource
-- Finds local file system files that sre needed at compile time. If
-- path is a remote URL, leave it alone.
......
......@@ -435,16 +435,12 @@ markdownToHtmlHandout markdownFile out = do
let options =
pandocWriterOpts
{ writerHtml5 = True
-- , writerStandalone = True
, writerTemplate = Just handoutTemplate
, writerHighlight = True
-- , writerHighlightStyle = pygments
, writerHTMLMathMethod =
MathJax
(supportDir </> "MathJax-2.7/MathJax.js?config=TeX-AMS_HTML")
-- ,writerHTMLMathMethod =
-- KaTeX (supportDir </> "katex-0.6.0/katex.min.js")
-- (supportDir </> "katex-0.6.0/katex.min.css")
, writerVariables = [("decker-support-dir", supportDir)]
, writerCiteMethod = Citeproc
}
......@@ -836,7 +832,7 @@ processPandocHandout format pandoc = do
let f = Just (Format format)
dirs <- getProjectDirs
processed <-
liftIO $ processCites' pandoc >>= walkM (useCachedImages (cache dirs))
liftIO $ processCites' (makeBoxes pandoc) >>= walkM (useCachedImages (cache dirs))
-- processed <- liftIO $ walkM (useCachedImages (cache dirs)) pandoc
-- return $ (expandMacros f . filterNotes f) processed
return $ expandMacros f processed
......
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