aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-03-01 20:59:27 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-03-01 21:01:29 -0800
commit5990f14ad497999141a5b975651f83d751ec421f (patch)
treeddbc3532886311465e6b068d8ff1700696570ae0 /src/Text/Pandoc/Writers
parentc26d7f1e36a682fdefab90e35b33e356d7365984 (diff)
downloadpandoc-5990f14ad497999141a5b975651f83d751ec421f.tar.gz
HTML writer: include content under title slides.
This facilitates real 2D revealjs slideshows, with content under the top-level slide in each stack. It also enables notes on title slides. Closes #4317 and #5237.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 8b4949483..ddfb49b55 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -455,13 +455,16 @@ elementToHtml mbparentlevel slideLevel opts
let inDiv xs = Blk (RawBlock (Format "html") ("<div class=\""
++ fragmentClass ++ "\">")) :
(xs ++ [Blk (RawBlock (Format "html") "</div>")])
- innerContents <- mapM (elementToHtml (Just level) slideLevel opts)
- $ if titleSlide
+ let (titleBlocks, innerSecs) =
+ if titleSlide
-- title slides have no content of their own
- then filter isSec elements
+ then ([x | Blk x <- elements],
+ filter isSec elements)
else case splitBy isPause elements of
- [] -> []
- (x:xs) -> x ++ concatMap inDiv xs
+ [] -> ([],[])
+ (x:xs) -> ([],x ++ concatMap inDiv xs)
+ titleContents <- blockListToHtml opts titleBlocks
+ innerContents <- mapM (elementToHtml (Just level) slideLevel opts) innerSecs
let inNl x = mconcat $ nl opts : intersperse (nl opts) x ++ [nl opts]
let classes' = ["title-slide" | titleSlide] ++ ["slide" | slide] ++
["section" | (slide || writerSectionDivs opts) &&
@@ -474,8 +477,7 @@ elementToHtml mbparentlevel slideLevel opts
let attr = (id',classes',keyvals)
if titleSlide
then do
- t <- addAttrs opts attr $
- secttag header'
+ t <- addAttrs opts attr $ secttag $ header' <> titleContents
return $
(if slideVariant == RevealJsSlides && not (null innerContents)
-- revealjs doesn't like more than one level of section nesting: