Made . . . for pause work in all slide show formats except slideous.
This commit is contained in:
parent
1911b619ee
commit
81e2df32c9
3 changed files with 18 additions and 14 deletions
5
README
5
README
|
@ -2680,9 +2680,8 @@ a single document.
|
||||||
Inserting pauses
|
Inserting pauses
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
In reveal.js and beamer slide shows, you can add "pauses" within
|
You can add "pauses" within a slide by including a paragraph containing
|
||||||
a slide by including a paragraph containing three dots, separated
|
three dots, separated by spaces:
|
||||||
by spaces:
|
|
||||||
|
|
||||||
# Slide with a pause
|
# Slide with a pause
|
||||||
|
|
||||||
|
|
|
@ -413,7 +413,7 @@
|
||||||
as markdown citations, it is redundant to have a bibliography,
|
as markdown citations, it is redundant to have a bibliography,
|
||||||
since one will be generated automatically.)
|
since one will be generated automatically.)
|
||||||
|
|
||||||
* Added syntax for "pauses" in beamer or reaveljs slide shows.
|
* Added syntax for "pauses" in slide shows:
|
||||||
|
|
||||||
This gives
|
This gives
|
||||||
|
|
||||||
|
@ -421,9 +421,6 @@
|
||||||
|
|
||||||
a pause.
|
a pause.
|
||||||
|
|
||||||
[note - no longer seems to work in recente revealjs - perhaps
|
|
||||||
this should be reverted]
|
|
||||||
|
|
||||||
* Use new flexible metadata type.
|
* Use new flexible metadata type.
|
||||||
|
|
||||||
+ Depend on `pandoc-types` 1.12. This changes the type of
|
+ Depend on `pandoc-types` 1.12. This changes the type of
|
||||||
|
|
|
@ -268,11 +268,24 @@ elementToHtml slideLevel opts (Sec level num (id',classes,keyvals) title' elemen
|
||||||
else blockToHtml opts (Header level' (id',classes,keyvals) title')
|
else blockToHtml opts (Header level' (id',classes,keyvals) title')
|
||||||
let isSec (Sec _ _ _ _ _) = True
|
let isSec (Sec _ _ _ _ _) = True
|
||||||
isSec (Blk _) = False
|
isSec (Blk _) = False
|
||||||
|
let isPause (Blk x) = x == Para [Str ".",Space,Str ".",Space,Str "."]
|
||||||
|
isPause _ = False
|
||||||
|
let fragmentClass = case writerSlideVariant opts of
|
||||||
|
RevealJsSlides -> "fragment"
|
||||||
|
_ -> "incremental"
|
||||||
|
let inDiv xs = Blk (RawBlock (Format "html") ("<div class=\""
|
||||||
|
++ fragmentClass ++ "\">")) :
|
||||||
|
(xs ++ [Blk (RawBlock (Format "html") "</div>")])
|
||||||
innerContents <- mapM (elementToHtml slideLevel opts)
|
innerContents <- mapM (elementToHtml slideLevel opts)
|
||||||
$ if titleSlide
|
$ if titleSlide
|
||||||
-- title slides have no content of their own
|
-- title slides have no content of their own
|
||||||
then filter isSec elements
|
then filter isSec elements
|
||||||
else elements
|
else if slide
|
||||||
|
then case splitBy isPause elements of
|
||||||
|
[] -> []
|
||||||
|
[x] -> x
|
||||||
|
xs -> concatMap inDiv xs
|
||||||
|
else elements
|
||||||
let inNl x = mconcat $ nl opts : intersperse (nl opts) x ++ [nl opts]
|
let inNl x = mconcat $ nl opts : intersperse (nl opts) x ++ [nl opts]
|
||||||
let classes' = ["titleslide" | titleSlide] ++ ["slide" | slide] ++
|
let classes' = ["titleslide" | titleSlide] ++ ["slide" | slide] ++
|
||||||
["section" | (slide || writerSectionDivs opts) &&
|
["section" | (slide || writerSectionDivs opts) &&
|
||||||
|
@ -401,10 +414,6 @@ blockToHtml opts (Para [Image txt (s,'f':'i':'g':':':tit)]) = do
|
||||||
[nl opts, img, capt, nl opts]
|
[nl opts, img, capt, nl opts]
|
||||||
else H.div ! A.class_ "figure" $ mconcat
|
else H.div ! A.class_ "figure" $ mconcat
|
||||||
[nl opts, img, capt, nl opts]
|
[nl opts, img, capt, nl opts]
|
||||||
-- . . . indicates a pause in a slideshow
|
|
||||||
blockToHtml opts (Para [Str ".",Space,Str ".",Space,Str "."])
|
|
||||||
| writerSlideVariant opts == RevealJsSlides =
|
|
||||||
blockToHtml opts (RawBlock "html" "<div class=\"fragment\" />")
|
|
||||||
blockToHtml opts (Para lst) = do
|
blockToHtml opts (Para lst) = do
|
||||||
contents <- inlineListToHtml opts lst
|
contents <- inlineListToHtml opts lst
|
||||||
return $ H.p contents
|
return $ H.p contents
|
||||||
|
@ -580,8 +589,7 @@ toListItem opts item = nl opts >> H.li item
|
||||||
|
|
||||||
blockListToHtml :: WriterOptions -> [Block] -> State WriterState Html
|
blockListToHtml :: WriterOptions -> [Block] -> State WriterState Html
|
||||||
blockListToHtml opts lst =
|
blockListToHtml opts lst =
|
||||||
mapM (blockToHtml opts) lst >>=
|
fmap (mconcat . intersperse (nl opts)) $ mapM (blockToHtml opts) lst
|
||||||
return . mconcat . intersperse (nl opts)
|
|
||||||
|
|
||||||
-- | Convert list of Pandoc inline elements to HTML.
|
-- | Convert list of Pandoc inline elements to HTML.
|
||||||
inlineListToHtml :: WriterOptions -> [Inline] -> State WriterState Html
|
inlineListToHtml :: WriterOptions -> [Inline] -> State WriterState Html
|
||||||
|
|
Loading…
Add table
Reference in a new issue