aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README18
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs11
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs7
3 files changed, 33 insertions, 3 deletions
diff --git a/README b/README
index ba1f93661..133c99f64 100644
--- a/README
+++ b/README
@@ -2731,6 +2731,24 @@ bibliographies:
# References {.allowframebreaks}
+Speaker notes
+-------------
+
+reveal.js has good support for speaker notes. You can add notes to your
+markdown document thus:
+
+ <div class="notes">
+ This is my note.
+
+ - It can contain markdown
+ - like this list
+
+ </div>
+
+To show the notes window, press `s` while viewing the presentation.
+Notes are not yet supported for other slide formats, but the notes
+will not appear on the slides themselves.
+
Literate Haskell support
========================
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index cee07cff5..22f5b8074 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -421,9 +421,16 @@ blockToHtml opts (Para [Image txt (s,'f':'i':'g':':':tit)]) = do
blockToHtml opts (Para lst) = do
contents <- inlineListToHtml opts lst
return $ H.p contents
-blockToHtml opts (Div attr bs) = do
+blockToHtml opts (Div attr@(_,classes,_) bs) = do
contents <- blockListToHtml opts bs
- return $ addAttrs opts attr $ H.div $ nl opts >> contents >> nl opts
+ let contents' = nl opts >> contents >> nl opts
+ return $
+ if "notes" `elem` classes
+ then case writerSlideVariant opts of
+ RevealJsSlides -> addAttrs opts attr $ H5.aside $ contents'
+ NoSlides -> addAttrs opts attr $ H.div $ contents'
+ _ -> mempty
+ else addAttrs opts attr $ H.div $ contents'
blockToHtml _ (RawBlock f str)
| f == Format "html" = return $ preEscapedString str
| otherwise = return mempty
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 8b05cfb43..d31e33a3a 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -285,7 +285,12 @@ isLineBreakOrSpace _ = False
blockToLaTeX :: Block -- ^ Block to convert
-> State WriterState Doc
blockToLaTeX Null = return empty
-blockToLaTeX (Div _ bs) = blockListToLaTeX bs
+blockToLaTeX (Div (_,classes,_) bs) = do
+ beamer <- writerBeamer `fmap` gets stOptions
+ contents <- blockListToLaTeX bs
+ if beamer && "notes" `elem` classes -- speaker notes
+ then return $ "\\note" <> braces contents
+ else return contents
blockToLaTeX (Plain lst) =
inlineListToLaTeX $ dropWhile isLineBreakOrSpace lst
-- title beginning with fig: indicates that the image is a figure